Commit 7923c77f authored by Dongliang Mu's avatar Dongliang Mu Committed by Treehugger Robot
Browse files

UPSTREAM: fs: erofs: add sanity check for kobject in erofs_unregister_sysfs

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.

Bug: 254441685
Link: https://lore.kernel.org/r/20220315132814.12332-1-dzm91@hust.edu.cn


Signed-off-by: default avatarDongliang Mu <mudongliangabcd@gmail.com>
Fixes: 168e9a76 ("erofs: add sysfs interface")
Reviewed-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
(cherry picked from commit a942da24)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: I9b074a6b2d087b1fa4bd4fa50ccfda46d56c98d8
parent e7bbb894
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment