====================================================== WARNING: possible circular locking dependency detected 4.18.0-rc8+ #182 Not tainted ------------------------------------------------------ syz-executor4/3580 is trying to acquire lock: 000000005a3417de (sb_writers#18){.+.+}, at: sb_start_write include/linux/fs.h:1554 [inline] 000000005a3417de (sb_writers#18){.+.+}, at: mnt_want_write+0x3f/0xc0 fs/namespace.c:386 but task is already holding lock: 000000002d27f142 (&fi->mutex){+.+.}, at: fuse_lock_inode+0xaf/0xe0 fs/fuse/inode.c:363 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&fi->mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:757 [inline] __mutex_lock+0x176/0x1820 kernel/locking/mutex.c:894 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:909 fuse_lock_inode+0xaf/0xe0 fs/fuse/inode.c:363 fuse_lookup+0x8f/0x4c0 fs/fuse/dir.c:359 __lookup_slow+0x2b5/0x540 fs/namei.c:1630 lookup_slow+0x57/0x80 fs/namei.c:1647 walk_component+0x94a/0x2630 fs/namei.c:1769 lookup_last fs/namei.c:2237 [inline] path_lookupat.isra.45+0x202/0xbf0 fs/namei.c:2287 filename_lookup+0x264/0x510 fs/namei.c:2321 kern_path+0x33/0x40 fs/namei.c:2410 bpf_obj_do_get kernel/bpf/inode.c:455 [inline] bpf_obj_get_user+0x174/0x610 kernel/bpf/inode.c:495 bpf_obj_get+0xbe/0x100 kernel/bpf/syscall.c:1409 __do_sys_bpf kernel/bpf/syscall.c:2313 [inline] __se_sys_bpf kernel/bpf/syscall.c:2269 [inline] __x64_sys_bpf+0x396/0x510 kernel/bpf/syscall.c:2269 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (&type->i_mutex_dir_key#5){++++}: down_write+0x8f/0x130 kernel/locking/rwsem.c:70 inode_lock include/linux/fs.h:715 [inline] utimes_common.isra.1+0x45c/0x8e0 fs/utimes.c:90 do_utimes+0x1f7/0x380 fs/utimes.c:156 __do_sys_utime fs/utimes.c:35 [inline] __se_sys_utime fs/utimes.c:24 [inline] __x64_sys_utime+0x1df/0x290 fs/utimes.c:24 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (sb_writers#18){.+.+}: lock_acquire+0x1e4/0x540 kernel/locking/lockdep.c:3924 percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] __sb_start_write+0x1e9/0x300 fs/super.c:1403 sb_start_write include/linux/fs.h:1554 [inline] mnt_want_write+0x3f/0xc0 fs/namespace.c:386 do_last fs/namei.c:3389 [inline] path_openat+0x931/0x4e10 fs/namei.c:3540 do_filp_open+0x255/0x380 fs/namei.c:3574 do_sys_open+0x584/0x760 fs/open.c:1101 ksys_open include/linux/syscalls.h:1275 [inline] __do_sys_creat fs/open.c:1159 [inline] __se_sys_creat fs/open.c:1157 [inline] __x64_sys_creat+0x61/0x80 fs/open.c:1157 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe other info that might help us debug this: Chain exists of: sb_writers#18 --> &type->i_mutex_dir_key#5 --> &fi->mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&fi->mutex); lock(&type->i_mutex_dir_key#5); lock(&fi->mutex); lock(sb_writers#18); *** DEADLOCK *** 1 lock held by syz-executor4/3580: #0: 000000002d27f142 (&fi->mutex){+.+.}, at: fuse_lock_inode+0xaf/0xe0 fs/fuse/inode.c:363 stack backtrace: CPU: 0 PID: 3580 Comm: syz-executor4 Not tainted 4.18.0-rc8+ #182 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113 print_circular_bug.isra.36.cold.57+0x1bd/0x27d kernel/locking/lockdep.c:1227 check_prev_add kernel/locking/lockdep.c:1867 [inline] check_prevs_add kernel/locking/lockdep.c:1980 [inline] validate_chain kernel/locking/lockdep.c:2421 [inline] __lock_acquire+0x3449/0x5020 kernel/locking/lockdep.c:3435 lock_acquire+0x1e4/0x540 kernel/locking/lockdep.c:3924 percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] __sb_start_write+0x1e9/0x300 fs/super.c:1403 sb_start_write include/linux/fs.h:1554 [inline] mnt_want_write+0x3f/0xc0 fs/namespace.c:386 do_last fs/namei.c:3389 [inline] path_openat+0x931/0x4e10 fs/namei.c:3540 do_filp_open+0x255/0x380 fs/namei.c:3574 do_sys_open+0x584/0x760 fs/open.c:1101 ksys_open include/linux/syscalls.h:1275 [inline] __do_sys_creat fs/open.c:1159 [inline] __se_sys_creat fs/open.c:1157 [inline] __x64_sys_creat+0x61/0x80 fs/open.c:1157 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457089 Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fb3dd6e3c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007fb3dd6e46d4 RCX: 0000000000457089 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000180 RBP: 0000000000930140 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000004cb428 R14: 00000000004c31db R15: 0000000000000001 device bridge_slave_0 entered promiscuous mode device bridge_slave_0 left promiscuous mode device bridge_slave_0 entered promiscuous mode device bridge_slave_0 left promiscuous mode device bridge_slave_0 entered promiscuous mode device bridge_slave_0 left promiscuous mode device bridge_slave_0 entered promiscuous mode device bridge_slave_0 left promiscuous mode device bridge_slave_0 entered promiscuous mode device bridge_slave_0 left promiscuous mode device bridge_slave_0 entered promiscuous mode device bridge_slave_0 left promiscuous mode