syzbot


possible deadlock in fuse_reverse_inval_entry

Status: fixed on 2022/03/08 16:11
Subsystems: fuse
[Documentation on labels]
Reported-by: syzbot+9f747458f5990eaa8d43@syzkaller.appspotmail.com
Fix commit: bda9a71980e0 fuse: annotate lock in fuse_reverse_inval_entry()
First crash: 990d, last: 959d
Cause bisection: failed (error log, bisect log)
  
Discussions (7)
Title Replies (including bot) Last reply
[PATCH 4.19 00/56] 4.19.222-rc1 review 66 (66) 2021/12/22 07:54
[PATCH 5.15 000/177] 5.15.11-rc1 review 183 (183) 2021/12/21 23:14
[PATCH 5.10 00/99] 5.10.88-rc1 review 106 (106) 2021/12/21 23:13
[PATCH 5.4 00/71] 5.4.168-rc1 review 78 (78) 2021/12/21 23:13
[PATCH 4.14 00/45] 4.14.259-rc1 review 48 (48) 2021/12/21 23:12
[PATCH 4.9 00/31] 4.9.294-rc1 review 36 (36) 2021/12/21 23:12
[syzbot] possible deadlock in fuse_reverse_inval_entry 1 (3) 2021/09/07 23:45
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 possible deadlock in fuse_reverse_inval_entry C error 1 596d 988d 0/1 upstream: reported C repro on 2021/08/10 04:41
linux-4.19 possible deadlock in fuse_reverse_inval_entry C error 89 450d 1032d 0/1 upstream: reported C repro on 2021/06/27 09:34
Last patch testing requests (1)
Created Duration User Patch Repo Result
2021/09/07 15:25 26m miklos@szeredi.hu patch upstream OK
Fix bisection attempts (1)
Created Duration User Patch Repo Result
2021/09/07 23:55 30m bisect fix upstream job log (0) log

Sample crash report:
============================================
WARNING: possible recursive locking detected
5.14.0-rc4-syzkaller #0 Not tainted
--------------------------------------------
syz-executor799/8433 is trying to acquire lock:
ffff888039930ed0 (&type->i_mutex_dir_key#7){++++}-{3:3}, at: inode_lock include/linux/fs.h:774 [inline]
ffff888039930ed0 (&type->i_mutex_dir_key#7){++++}-{3:3}, at: fuse_reverse_inval_entry+0x1f5/0x530 fs/fuse/dir.c:1093

but task is already holding lock:
ffff888039930150 (&type->i_mutex_dir_key#7){++++}-{3:3}, at: inode_lock include/linux/fs.h:774 [inline]
ffff888039930150 (&type->i_mutex_dir_key#7){++++}-{3:3}, at: fuse_reverse_inval_entry+0x4c/0x530 fs/fuse/dir.c:1074

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&type->i_mutex_dir_key#7);
  lock(&type->i_mutex_dir_key#7);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

2 locks held by syz-executor799/8433:
 #0: ffff888022b6bb38 (&fc->killsb){.+.+}-{3:3}, at: fuse_notify_delete fs/fuse/dev.c:1540 [inline]
 #0: ffff888022b6bb38 (&fc->killsb){.+.+}-{3:3}, at: fuse_notify fs/fuse/dev.c:1790 [inline]
 #0: ffff888022b6bb38 (&fc->killsb){.+.+}-{3:3}, at: fuse_dev_do_write+0x285f/0x2bd0 fs/fuse/dev.c:1865
 #1: ffff888039930150 (&type->i_mutex_dir_key#7){++++}-{3:3}, at: inode_lock include/linux/fs.h:774 [inline]
 #1: ffff888039930150 (&type->i_mutex_dir_key#7){++++}-{3:3}, at: fuse_reverse_inval_entry+0x4c/0x530 fs/fuse/dir.c:1074

stack backtrace:
CPU: 1 PID: 8433 Comm: syz-executor799 Not tainted 5.14.0-rc4-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105
 print_deadlock_bug kernel/locking/lockdep.c:2944 [inline]
 check_deadlock kernel/locking/lockdep.c:2987 [inline]
 validate_chain kernel/locking/lockdep.c:3776 [inline]
 __lock_acquire.cold+0x149/0x3ab kernel/locking/lockdep.c:5015
 lock_acquire kernel/locking/lockdep.c:5625 [inline]
 lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590
 down_write+0x92/0x150 kernel/locking/rwsem.c:1406
 inode_lock include/linux/fs.h:774 [inline]
 fuse_reverse_inval_entry+0x1f5/0x530 fs/fuse/dir.c:1093
 fuse_notify_delete fs/fuse/dev.c:1541 [inline]
 fuse_notify fs/fuse/dev.c:1790 [inline]
 fuse_dev_do_write+0x287f/0x2bd0 fs/fuse/dev.c:1865
 fuse_dev_write+0x144/0x1d0 fs/fuse/dev.c:1949
 call_write_iter include/linux/fs.h:2114 [inline]
 new_sync_write+0x426/0x650 fs/read_write.c:518
 vfs_write+0x75a/0xa40 fs/read_write.c:605
 ksys_write+0x12d/0x250 fs/read_write.c:658
 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:0x4455e9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 81 14 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f64ac9752f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00000000004ce4e0 RCX: 00000000004455e9
RDX: 000000000000002e RSI: 00000000200000c0 RDI: 0000000000000003

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/08/08 13:48 upstream 85a90500f9a1 6972b106 .config console log report syz C ci-upstream-kasan-gce possible deadlock in fuse_reverse_inval_entry
* Struck through repros no longer work on HEAD.