============================================ WARNING: possible recursive locking detected syzkaller #0 Not tainted -------------------------------------------- syz.0.0/5321 is trying to acquire lock: ffff88801bf592d8 (kn->active#67){++++}-{0:0}, at: __kernfs_remove+0x493/0x8e0 fs/kernfs/dir.c:1579 but task is already holding lock: ffff88801bf592d8 (kn->active#67){++++}-{0:0}, at: kernfs_get_active_of fs/kernfs/file.c:73 [inline] ffff88801bf592d8 (kn->active#67){++++}-{0:0}, at: kernfs_fop_write_iter+0x22b/0x540 fs/kernfs/file.c:337 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(kn->active#67); lock(kn->active#67); *** DEADLOCK *** May be due to missing lock nesting notation locks held by syz.0.0/5321: 4, last CPU#0: #0: ffff888034a8bb70 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x246/0x320 fs/file.c:1259 #1: ffff8880135ea460 (sb_writers#7){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2756 [inline] #1: ffff8880135ea460 (sb_writers#7){.+.+}-{0:0}, at: vfs_write+0x22b/0xba0 fs/read_write.c:683 #2: ffff88801bfb4c80 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x1d8/0x540 fs/kernfs/file.c:336 #3: ffff88801bf592d8 (kn->active#67){++++}-{0:0}, at: kernfs_get_active_of fs/kernfs/file.c:73 [inline] #3: ffff88801bf592d8 (kn->active#67){++++}-{0:0}, at: kernfs_fop_write_iter+0x22b/0x540 fs/kernfs/file.c:337 stack backtrace: CPU: 0 UID: 0 PID: 5321 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_deadlock_bug+0x27a/0x290 kernel/locking/lockdep.c:3085 check_deadlock kernel/locking/lockdep.c:3137 [inline] validate_chain kernel/locking/lockdep.c:3939 [inline] __lock_acquire+0x25db/0x2de0 kernel/locking/lockdep.c:5288 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942 kernfs_drain+0x293/0x640 fs/kernfs/dir.c:532 __kernfs_remove+0x493/0x8e0 fs/kernfs/dir.c:1579 kernfs_remove_by_name_ns+0xc0/0x140 fs/kernfs/dir.c:1797 kernfs_remove_by_name include/linux/kernfs.h:644 [inline] remove_files fs/sysfs/group.c:28 [inline] sysfs_remove_group+0x101/0x2e0 fs/sysfs/group.c:328 sysfs_remove_groups+0x54/0xb0 fs/sysfs/group.c:352 __kobject_del+0x83/0x310 lib/kobject.c:595 kobject_del+0x45/0x60 lib/kobject.c:627 rpc_sysfs_xprt_switch_destroy+0x59/0x90 net/sunrpc/sysfs.c:816 xprt_switch_free net/sunrpc/xprtmultipath.c:194 [inline] kref_put include/linux/kref.h:65 [inline] xprt_switch_put+0x33d/0x3c0 net/sunrpc/xprtmultipath.c:221 rpc_sysfs_xprt_switch_add_xprt_store+0x2c5/0x360 net/sunrpc/sysfs.c:362 kernfs_fop_write_iter+0x3a4/0x540 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x612/0xba0 fs/read_write.c:687 ksys_write+0x150/0x270 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f9580f9e559 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f9581f1ffe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f9581226090 RCX: 00007f9580f9e559 RDX: 0000000000000001 RSI: 0000200000001540 RDI: 000000000000002a RBP: 00007f9581035ab8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f9581226128 R14: 00007f9581226090 R15: 00007ffc20796a08