Re: [PATCH v3 1/2] iio: accel: kxsd9: fix Use-After-Free in remove()
From: Andy Shevchenko
Date: Mon Jul 06 2026 - 16:04:16 EST
On Mon, Jul 06, 2026 at 01:16:51PM +0530, Biren Pandya wrote:
> The kxsd9 driver currently calls iio_triggered_buffer_cleanup() before
> iio_device_unregister() in the remove() function. This order creates a
> race condition where userspace can still access sysfs or ioctl interfaces
> while the triggered buffers are being torn down, potentially leading to
> a use-after-free.
>
> Fix this by swapping the cleanup order. Unregister the IIO device first
> to guarantee that all userspace interfaces are destroyed and no new
> accesses can occur before cleaning up the triggered buffers.
>
> This vulnerability was flagged by the Sashiko automated review system.
> Link: https://sashiko.dev/#/patchset/20260621193036.78549-2-birenpandya@xxxxxxxxx
I believe you wanted Closes: and Reported-by: tags instead of simple Link.
> Fixes: 0427a106a98a ("iio: accel: kxsd9: Add triggered buffer handling")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Biren Pandya <birenpandya@xxxxxxxxx>
...
You have a series, where is the cover letter and the changelog, please?
Do not abuse the process.
--
With Best Regards,
Andy Shevchenko