{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2025-38485",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2025-38485"
  ],
  "published": "2025-07-28T11:22:31Z",
  "summary": "iio: accel: fxls8962af: Fix use after free in fxls8962af_fifo_flush",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\niio: accel: fxls8962af: Fix use after free in fxls8962af_fifo_flush\n\nfxls8962af_fifo_flush() uses indio_dev->active_scan_mask (with\niio_for_each_active_channel()) without making sure the indio_dev\nstays in buffer mode.\nThere is a race if indio_dev exits buffer mode in the middle of the\ninterrupt that flushes the fifo. Fix this by calling\nsynchronize_irq() to ensure that no interrupt is currently running when\ndisabling buffer mode.\n\nUnable to handle kernel NULL pointer dereference at virtual address 00000000 when read\n[...]\n_find_first_bit_le from fxls8962af_fifo_flush+0x17c/0x290\nfxls8962af_fifo_flush from fxls8962af_interrupt+0x80/0x178\nfxls8962af_interrupt from irq_thread_fn+0x1c/0x7c\nirq_thread_fn from irq_thread+0x110/0x1f4\nirq_thread from kthread+0xe0/0xfc\nkthread from ret_from_fork+0x14/0x2c",
  "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.147",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2025-38485"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/6ecd61c201b27ad2760b3975437ad2b97d725b98"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/dda42f23a8f5439eaac9521ce0531547d880cc54"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/bfcda3e1015791b3a63fb4d3aad408da9cf76e8f"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/1803d372460aaa9ae0188a30c9421d3f157f2f04"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/1fe16dc1a2f5057772e5391ec042ed7442966c9a"
    }
  ],
  "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 race is driven entirely from local userspace by toggling `/sys/bus/iio/devices/iio:deviceN/buffer/enable` and reading `/dev/iio:deviceN`; there is no network-facing path to the IIO buffer core or this accelerometer driver.\nAC:L - The attacker controls both sides \u2014 the sensor IRQ cadence via `sampling_frequency`/`hwfifo_watermark`, and the free via the buffer-disable write \u2014 and the threaded handler spends milliseconds in I2C FIFO reads inside the unprotected window, so the race is reliably hit and freely retried in a loop.\nPR:L - Only an unprivileged local account with access to the IIO sysfs/chardev nodes is required; on the Android/embedded/automotive platforms that ship FXLS8962AF/8964AF these nodes are group-owned by the sensor service, so a low-privileged process can enable and disable the hardware FIFO buffer.\nUI:N - The attacker performs every step \u2014 configure rate/watermark, enable the buffer, disable it mid-flush \u2014 with no action from any other user or administrator.\nS:U - The freed bitmap, the corrupted stack buffer and the driver private data all live in the kernel's own security authority; no VM, IOMMU or sandbox boundary is crossed.\nC:H - Reading the freed, sprayable scan mask makes `bit` attacker-influenced, so `buffer[i * 3 + bit]` reads past the valid samples and off the end of the stack array, and those bytes are pushed via `iio_push_to_buffers_with_ts()` into the userspace-readable kfifo \u2014 a direct kernel memory disclosure on top of the use-after-free read itself.\nI:H - With a groomed kmalloc-8/16 replacement object the loop index `j` exceeds the 3-element `data->scan.channels[]` array, giving an out-of-bounds write into adjacent heap-resident driver state; per use-after-free scoring this is exploitable for control over kernel data.\nA:H - The reported failure mode is a kernel NULL pointer dereference oops in `_find_first_bit_le` from `fxls8962af_fifo_flush()` in the IRQ thread, and the UAF path can be re-triggered repeatedly to crash the system."
    }
  }
}
