Re: [PATCH] fs: erofs: add sanity check for kobject in erofs_unregister_sysfs

From: Chao Yu
Date: Tue Mar 15 2022 - 21:45:15 EST


On 2022/3/15 21:28, Dongliang Mu wrote:
From: Dongliang Mu <mudongliangabcd@xxxxxxxxx>

Syzkaller hit 'WARNING: kobject bug in erofs_unregister_sysfs'. This bug
is triggered by injecting fault in kobject_init_and_add of
erofs_unregister_sysfs.

Fix this by adding sanity check for kobject in erofs_unregister_sysfs

Note that I've tested the patch and the crash does not occur any more.

Signed-off-by: Dongliang Mu <mudongliangabcd@xxxxxxxxx>

Reviewed-by: Chao Yu <chao@xxxxxxxxxx>

Thanks,