syzbot


WARNING: kobject bug in erofs_unregister_sysfs

Status: fixed on 2023/02/24 13:50
Subsystems: erofs
[Documentation on labels]
Reported-by: syzbot+f05ba4652c0471416eaf@syzkaller.appspotmail.com
Fix commit: a942da24abc5 fs: erofs: add sanity check for kobject in erofs_unregister_sysfs
First crash: 1060d, last: 994d
Cause bisection: introduced by (bisect log) :
commit 2768c206f2c3e95c0e5cf2e7f846103fda7cd429
Author: Muchun Song <songmuchun@bytedance.com>
Date: Thu Mar 3 01:15:36 2022 +0000

  mm: list_lru: allocate list_lru_one only when needed

Crash: WARNING: kobject bug in erofs_unregister_sysfs (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[syzbot] WARNING: kobject bug in erofs_unregister_sysfs 6 (9) 2022/03/23 01:54
Re: Fw:Re: [PATCH] fs: nilfs2: fix memory leak in nilfs sysfs create device group 18 (18) 2022/03/15 09:18
Last patch testing requests (1)
Created Duration User Patch Repo Result
2022/03/18 18:03 11m xiang@kernel.org https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git dev OK

Sample crash report:
RBP: 00007fff8eeb06e0 R08: 00007fff8eeb0720 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000286 R12: 00000000200000b0
R13: 0000000000000004 R14: 0000000000000005 R15: 0000000000000002
 </TASK>
------------[ cut here ]------------
kobject: '(null)' (ffff888077324190): is not initialized, yet kobject_put() is being called.
WARNING: CPU: 0 PID: 3610 at lib/kobject.c:750 kobject_put+0x22b/0x540 lib/kobject.c:750
Modules linked in:
CPU: 0 PID: 3610 Comm: syz-executor471 Not tainted 5.17.0-rc6-next-20220303-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:kobject_put+0x22b/0x540 lib/kobject.c:750
Code: e8 6a 83 67 fd 48 89 e8 48 c1 e8 03 42 80 3c 20 00 0f 85 94 02 00 00 48 8b 75 00 48 89 ea 48 c7 c7 c0 0d 2a 8a e8 c1 5b 07 05 <0f> 0b e9 32 fe ff ff e8 39 83 67 fd 4d 89 f9 48 89 e9 4c 89 f2 49
RSP: 0018:ffffc90003b9fc48 EFLAGS: 00010286
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff88801c67ba80 RSI: ffffffff81602878 RDI: fffff52000773f7b
RBP: ffff888077324190 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffff815fd23e R11: 0000000000000000 R12: dffffc0000000000
R13: ffff8880773241cc R14: ffff888073799cf8 R15: ffff8880207dc068
FS:  0000555556165300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fff8eeb1000 CR3: 000000001ac3f000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 erofs_unregister_sysfs+0x46/0x60 fs/erofs/sysfs.c:225
 erofs_put_super+0x37/0xb0 fs/erofs/super.c:771
 generic_shutdown_super+0x14c/0x400 fs/super.c:462
 kill_block_super+0x97/0xf0 fs/super.c:1394
 erofs_kill_sb+0x60/0x190 fs/erofs/super.c:752
 deactivate_locked_super+0x94/0x160 fs/super.c:332
 get_tree_bdev+0x573/0x760 fs/super.c:1294
 vfs_get_tree+0x89/0x2f0 fs/super.c:1497
 do_new_mount fs/namespace.c:3025 [inline]
 path_mount+0x1320/0x1fa0 fs/namespace.c:3355
 do_mount fs/namespace.c:3368 [inline]
 __do_sys_mount fs/namespace.c:3576 [inline]
 __se_sys_mount fs/namespace.c:3553 [inline]
 __x64_sys_mount+0x27f/0x300 fs/namespace.c:3553
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fa80fa1344a
Code: 48 c7 c2 c0 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 a8 00 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff8eeb06c8 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fff8eeb0720 RCX: 00007fa80fa1344a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fff8eeb06e0
RBP: 00007fff8eeb06e0 R08: 00007fff8eeb0720 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000286 R12: 00000000200000b0
R13: 0000000000000004 R14: 0000000000000005 R15: 0000000000000002
 </TASK>

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/03/18 16:38 linux-next 91265a6da44d e2d91b1d .config console log report syz C ci-upstream-linux-next-kasan-gce-root WARNING: kobject bug in erofs_unregister_sysfs
2022/01/14 03:43 upstream 147cc5838c0f b8d780ab .config console log report info ci-qemu-upstream-386 WARNING: kobject bug in erofs_unregister_sysfs
2022/03/20 17:05 linux-next 91265a6da44d e2d91b1d .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING: kobject bug in erofs_unregister_sysfs
2022/03/18 15:35 linux-next 91265a6da44d e2d91b1d .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING: kobject bug in erofs_unregister_sysfs
2022/03/01 19:23 linux-next e6ada6df471f 45a13a73 .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING: kobject bug in erofs_unregister_sysfs
* Struck through repros no longer work on HEAD.