{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2023-53759",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2023-53759"
  ],
  "published": "2025-12-08T01:19:54Z",
  "summary": "HID: hidraw: fix data race on device refcount",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nHID: hidraw: fix data race on device refcount\n\nThe hidraw_open() function increments the hidraw device reference\ncounter. The counter has no dedicated synchronization mechanism,\nresulting in a potential data race when concurrently opening a device.\n\nThe race is a regression introduced by commit 8590222e4b02 (\"HID:\nhidraw: Replace hidraw device table mutex with a rwsem\"). While\nminors_rwsem is intended to protect the hidraw_table itself, by instead\nacquiring the lock for writing, the reference counter is also protected.\nThis is symmetrical to hidraw_release().",
  "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.21-1+rpt1"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v6",
            "binary_version": "1:6.1.21-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v7",
            "binary_version": "1:6.1.21-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v7l",
            "binary_version": "1:6.1.21-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v8",
            "binary_version": "1:6.1.21-1+rpt1"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.21-1+rpt1": {
            "linux_commit": "0afb5e98488aed7017b9bf321b575d0177feb7ed",
            "upstream_version": "6.1.21",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.37"
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2023-53759"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/879e79c3aead41b8aa2e91164354b30bd1c4ef3b"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/ff348eabd97577da974d3db7038857f28c61d2bd"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/05b47034e2488c2924e5c032e20a1979d012b5b5"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/944ee77dc6ec7b0afd8ec70ffc418b238c92f12b"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T11:24:39Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The vulnerable code is reached by `open()`/`read()`/`poll()`/`close()` on the `/dev/hidrawN` character device, requiring local access to the system. No network or physical interaction with the bus is needed to drive the race itself.\nAC:L - The attacker controls both sides of the race \u2014 it is simply two or more threads calling `open()` on the same hidraw node in a loop, retryable indefinitely until the non-atomic `dev->open++` loses an update. The race is known to trigger accidentally during normal FIDO2 device probing (systemd issue #27947), and HID hot-unplug/Bluetooth-link-loss events needed to convert the refcount skew into a free are routine and inducible.\nPR:L - An unprivileged local user needs only read access to a hidraw node; systemd's uaccess/seat udev rules grant the logged-in user an ACL on hidraw devices for FIDO2 tokens, hardware wallets, 3D mice and game controllers (empirically confirmed: `crw-rw----+` with `user:<uid>:rw-`). No capability, no root, no ioctl gate.\nUI:N - The attacker's own threads perform every step of the attack; no victim action is required. Device detach events occur spontaneously (Bluetooth link loss, dongle removal, uhid teardown) or can be caused by the attacker themselves.\nS:U - The refcount corruption and resulting use-after-free are confined to kernel memory within the same security authority; there is no VM, IOMMU, or sandbox boundary crossed.\nC:H - The premature `kfree(struct hidraw)` leaves `list->hidraw` dangling, and `hidraw_read()` dereferences `list->hidraw->exist` and the embedded wait queue on reclaimed memory; a UAF on a small kmalloc object with attacker-sprayed contents yields an arbitrary-read primitive and kernel memory disclosure.\nI:H - `add_wait_queue()`/`remove_wait_queue()` on the freed `hidraw->wait` write list pointers into reclaimed heap memory, and a sprayed replacement object gives attacker-controlled `list_head` pointers plus a controlled `wait_queue_entry->func` call \u2014 an arbitrary write and control-flow hijack. The stale-minor path also corrupts a different, live `struct hidraw`'s refcount.\nA:H - `hidraw_release()` on the orphaned fd dereferences a NULL `hidraw_table[minor]` for a guaranteed oops, and the UAF crashes the kernel outright; additionally the refcount underflow permanently leaks hidraw minors (only 64 exist), denying hidraw registration to all future HID devices."
    }
  }
}
