[Devel] [PATCH hci-8.2] fs: fix use-after-free in fs_send_uevent_work()

Konstantin Khorenko khorenko at virtuozzo.com
Mon Nov 30 16:52:24 MSK 2026


Applying with these fixes on my side:
- added: Fixes: 44897dc519b2 ("fs: Introduce fs_events_wq to use
  instead ext4's rsv_conversion_wq")

On Mon, 30 Nov 2026 14:19:52 +0100, Denis V. Lunev wrote:
> fs_send_uevent() queues a work item that carries plain pointers to the
> superblock and to the filesystem kobject. Nothing keeps them alive
> until the worker runs; each filesystem is expected to flush
> fs_events_wq before it frees them.

Before 44897dc519b2 ext4 queued the event on its own
rsv_conversion_wq and dropped it once ext4_put_super() had destroyed
that queue, before the journal goes away. The check became
!fs_events_wq, which never holds after boot, so a late ERROR is
queued and outlives the sbi.

> -	/* Do not forget to flush fs_events_wq before you kill sb */

No change needed, a note for later: the flushes in ext4_put_super()
and xfs_fs_put_super() are still needed, now to deliver UMOUNT.
Without them kobject_del() clears state_in_sysfs before the worker
runs and the new check drops UMOUNT silently. Worth keeping in mind
if someone wants to remove them as obsolete.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team



More information about the Devel mailing list