Re: [PATCH v2] ext4: fix use-after-free in update_super_work when racing with umount

From: Jiayuan Chen

Date: Thu Mar 19 2026 - 07:21:15 EST



On 3/19/26 6:50 PM, Jan Kara wrote:
The initialization of s_error_notify_mutex should happen early in
ext4_fill_super() as ext4_notify_error_sysfs() can be called rather early
before ext4_register_sysfs() is called.

Also we should protect kobject_init_and_add() with s_error_notify_mutex to
handle the case where ext4_notify_error_sysfs() is racing with
ext4_register_sysfs().

Honza
-- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR


Hi Honza,

Thanks for the review! The AI catches are reasonable — I'll move
mutex_init() earlier in ext4_fill_super() and protect kobject_init_and_add()
with the mutex.

Thanks,
Jiayuan