{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2025-21934",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2025-21934"
  ],
  "published": "2025-04-01T15:40:16Z",
  "summary": "rapidio: fix an API misues when rio_add_net() fails",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nrapidio: fix an API misues when rio_add_net() fails\n\nrio_add_net() calls device_register() and fails when device_register()\nfails.  Thus, put_device() should be used rather than kfree().  Add\n\"mport->net = NULL;\" to avoid a use after free issue.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.47-1+rpt4"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-2712",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt4"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.131",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2025-21934"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/d4ec862ce80f64db923a1d942b5d11cf6fc87d36"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/88ddad53e4cfb6de861c6d4fb7b25427f46baed5"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/cdd9f58f7fe41a55fae4305ea51fc234769fd466"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/a5f5e520e8fbc6294020ff8afa36f684d92c6e6a"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/2537f01d57f08c527e40bbb5862aa6ff43344898"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/22e4977141dfc6d109bf29b495bf2187b4250990"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/f0aa4ee1cbbf7789907e5a3f6810de01c146c211"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/b2ef51c74b0171fde7eb69b6152d3d2f743ef269"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T12:19:11Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The vulnerability is reached only through the RIO_DEV_ADD ioctl on the local character device /dev/rio_mportN, which requires local access to the system. RapidIO is a board-level fabric interconnect, not an IP network path, so no remote or adjacent reachability exists.\nAC:L - The attacker controls both sides of the unlocked mport->net race: two concurrent RIO_DEV_ADD ioctls both allocate a net and both register a device named \"rnet_<id>\" under the same parent, so the loser's device_register() fails deterministically with -EEXIST, and the sequence is freely retryable. Reclaiming the freed struct rio_net (which embeds a full struct device, landing in a common kmalloc cache) via standard heap spray is routine.\nPR:L - The driver performs no capable() or permission check on any ioctl path \u2014 access is gated purely by /dev/rio_mportN node permissions, and RapidIO deployments commonly delegate fabric enumeration to non-root userspace management daemons via group-accessible device nodes. An unprivileged user with access to the mport device node can fully drive the bug.\nUI:N - Exploitation is entirely self-driven through ioctl calls by the attacker's own process; no victim action, mount, or file open by another user is needed.\nS:U - The freed object, the corruption, and the resulting privilege gain all live within the kernel's own security authority, with no crossing of a VM, IOMMU, or sandbox boundary.\nC:H - The dangling mport->net is used as a struct device parent and list head, so after slab reclamation the attacker can leak kernel pointers written back into the sprayed object and dereference attacker-influenced sysfs/kobject pointers, yielding arbitrary kernel memory disclosure.\nI:H - list_add_tail(&rdev->net_list, &rdev->net->devices) inserts into a freed, attacker-reclaimed list head, giving a controllable write-what-where primitive, and device_add() increments a refcount inside the freed object \u2014 both leverageable into arbitrary kernel memory write and control-flow hijack.\nA:H - Even without full exploitation, the use-after-free on mport->net and the subsequent double free via rio_free_net()/device_unregister() on freed memory reliably produce slab corruption, oops, or kernel panic."
    }
  }
}
