syzbot


possible deadlock in pipe_lock (2)

Status: upstream: reported C repro on 2019/12/26 07:17
Reported-by: syzbot+53f68fd7f9d60fc0f4b3@syzkaller.appspotmail.com
First crash: 963d, last: 15h58m

Fix bisection: failed (bisect log)
similar bugs (8):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in pipe_lock 50806 1700d 1748d 0/23 closed as invalid on 2018/02/14 14:20
upstream possible deadlock in pipe_lock (4) 1 467d 463d 0/23 auto-closed as invalid on 2021/07/03 13:02
upstream possible deadlock in pipe_lock (2) 3 1211d 1281d 0/23 auto-closed as invalid on 2019/10/18 15:02
upstream possible deadlock in pipe_lock (5) C done 5 386d 386d 22/23 fixed on 2021/11/10 00:50
android-49 possible deadlock in pipe_lock 5 1025d 1218d 0/3 auto-closed as invalid on 2020/02/21 12:40
linux-4.19 possible deadlock in pipe_lock C done 2 1205d 1208d 1/1 fixed on 2019/11/29 10:34
android-44 possible deadlock in pipe_lock C 82 985d 1219d 0/2 public: reported C repro on 2019/04/14 08:51
upstream possible deadlock in pipe_lock (3) C inconclusive done 4 925d 962d 17/23 fixed on 2020/08/18 22:40

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
4.19.211-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor417/10047 is trying to acquire lock:
0000000077f8b40c (&pipe->mutex/1){+.+.}, at: pipe_lock_nested fs/pipe.c:77 [inline]
0000000077f8b40c (&pipe->mutex/1){+.+.}, at: pipe_lock+0x63/0x80 fs/pipe.c:85

but task is already holding lock:
00000000b030b0c9 (sb_writers#3){.+.+}, at: file_start_write include/linux/fs.h:2779 [inline]
00000000b030b0c9 (sb_writers#3){.+.+}, at: do_splice fs/splice.c:1153 [inline]
00000000b030b0c9 (sb_writers#3){.+.+}, at: __do_sys_splice fs/splice.c:1428 [inline]
00000000b030b0c9 (sb_writers#3){.+.+}, at: __se_sys_splice+0x11de/0x16d0 fs/splice.c:1408

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (sb_writers#3){.+.+}:
       file_start_write include/linux/fs.h:2779 [inline]
       ovl_write_iter+0x932/0xb40 fs/overlayfs/file.c:282
       call_write_iter include/linux/fs.h:1821 [inline]
       new_sync_write fs/read_write.c:474 [inline]
       __vfs_write+0x51b/0x770 fs/read_write.c:487
       __kernel_write+0x109/0x370 fs/read_write.c:506
       write_pipe_buf+0x153/0x1f0 fs/splice.c:798
       splice_from_pipe_feed fs/splice.c:503 [inline]
       __splice_from_pipe+0x389/0x800 fs/splice.c:627
       splice_from_pipe fs/splice.c:662 [inline]
       default_file_splice_write+0xd8/0x180 fs/splice.c:810
       do_splice_from fs/splice.c:852 [inline]
       do_splice fs/splice.c:1154 [inline]
       __do_sys_splice fs/splice.c:1428 [inline]
       __se_sys_splice+0xfe7/0x16d0 fs/splice.c:1408
       do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #1 (&ovl_i_mutex_key[depth]){+.+.}:
       inode_lock include/linux/fs.h:748 [inline]
       ovl_write_iter+0x148/0xb40 fs/overlayfs/file.c:270
       call_write_iter include/linux/fs.h:1821 [inline]
       new_sync_write fs/read_write.c:474 [inline]
       __vfs_write+0x51b/0x770 fs/read_write.c:487
       __kernel_write+0x109/0x370 fs/read_write.c:506
       write_pipe_buf+0x153/0x1f0 fs/splice.c:798
       splice_from_pipe_feed fs/splice.c:503 [inline]
       __splice_from_pipe+0x389/0x800 fs/splice.c:627
       splice_from_pipe fs/splice.c:662 [inline]
       default_file_splice_write+0xd8/0x180 fs/splice.c:810
       do_splice_from fs/splice.c:852 [inline]
       do_splice fs/splice.c:1154 [inline]
       __do_sys_splice fs/splice.c:1428 [inline]
       __se_sys_splice+0xfe7/0x16d0 fs/splice.c:1408
       do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #0 (&pipe->mutex/1){+.+.}:
       __mutex_lock_common kernel/locking/mutex.c:937 [inline]
       __mutex_lock+0xd7/0x1190 kernel/locking/mutex.c:1078
       pipe_lock_nested fs/pipe.c:77 [inline]
       pipe_lock+0x63/0x80 fs/pipe.c:85
       iter_file_splice_write+0x183/0xbb0 fs/splice.c:700
       do_splice_from fs/splice.c:852 [inline]
       do_splice fs/splice.c:1154 [inline]
       __do_sys_splice fs/splice.c:1428 [inline]
       __se_sys_splice+0xfe7/0x16d0 fs/splice.c:1408
       do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

other info that might help us debug this:

Chain exists of:
  &pipe->mutex/1 --> &ovl_i_mutex_key[depth] --> sb_writers#3

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(sb_writers#3);
                               lock(&ovl_i_mutex_key[depth]);
                               lock(sb_writers#3);
  lock(&pipe->mutex/1);

 *** DEADLOCK ***

1 lock held by syz-executor417/10047:
 #0: 00000000b030b0c9 (sb_writers#3){.+.+}, at: file_start_write include/linux/fs.h:2779 [inline]
 #0: 00000000b030b0c9 (sb_writers#3){.+.+}, at: do_splice fs/splice.c:1153 [inline]
 #0: 00000000b030b0c9 (sb_writers#3){.+.+}, at: __do_sys_splice fs/splice.c:1428 [inline]
 #0: 00000000b030b0c9 (sb_writers#3){.+.+}, at: __se_sys_splice+0x11de/0x16d0 fs/splice.c:1408

stack backtrace:
CPU: 1 PID: 10047 Comm: syz-executor417 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1222
 check_prev_add kernel/locking/lockdep.c:1866 [inline]
 check_prevs_add kernel/locking/lockdep.c:1979 [inline]
 validate_chain kernel/locking/lockdep.c:2420 [inline]
 __lock_acquire+0x30c9/0x3ff0 kernel/locking/lockdep.c:3416
 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908
 __mutex_lock_common kernel/locking/mutex.c:937 [inline]
 __mutex_lock+0xd7/0x1190 kernel/locking/mutex.c:1078
 pipe_lock_nested fs/pipe.c:77 [inline]
 pipe_lock+0x63/0x80 fs/pipe.c:85
 iter_file_splice_write+0x183/0xbb0 fs/splice.c:700
 do_splice_from fs/splice.c:852 [inline]
 do_splice fs/splice.c:1154 [inline]
 __do_sys_splice fs/splice.c:1428 [inline]
 __se_sys_splice+0xfe7/0x16d0 fs/splice.c:1408
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7fd7001ba2e9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 15 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:00007fd70014a2e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 00007fd7002434d0 RCX: 00007fd7001ba2e9
RDX: 0000000000000003 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 00007fd700210088 R08: 0000000000000015 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0079616c7265766f
R13: 0030656c69662f2e R14: 752e303030325039 R15: 00007fd7002434d8

Crashes (49):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-19 2022/08/14 17:17 linux-4.19.y 3f8a27f9e27b 8dfcaa3d .config log report syz C possible deadlock in pipe_lock
ci2-linux-4-19 2021/07/29 15:23 linux-4.19.y a89b48fe9308 b44001ce .config log report syz C possible deadlock in pipe_lock
ci2-linux-4-19 2021/07/26 21:36 linux-4.19.y 4938296e03bd fd511809 .config log report syz C possible deadlock in pipe_lock
ci2-linux-4-19 2019/12/26 07:16 linux-4.19.y 672481c2deff be5c2c81 .config log report syz C
ci2-linux-4-19 2022/08/14 02:01 linux-4.19.y 3f8a27f9e27b 8dfcaa3d .config log report syz possible deadlock in pipe_lock
ci2-linux-4-19 2020/08/02 18:01 linux-4.19.y 13af6c74b14a 96dd3623 .config log report syz
ci2-linux-4-19 2020/07/17 01:03 linux-4.19.y 17a87580a885 54b3c45e .config log report syz
ci2-linux-4-19 2022/08/14 01:36 linux-4.19.y 3f8a27f9e27b 8dfcaa3d .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/05/04 09:48 linux-4.19.y 3f8a27f9e27b dc9e5259 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/05/04 07:11 linux-4.19.y 3f8a27f9e27b dc9e5259 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/05/03 06:11 linux-4.19.y 3f8a27f9e27b 2df221f6 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/05/03 03:18 linux-4.19.y 3f8a27f9e27b 2df221f6 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/05/02 08:06 linux-4.19.y 3f8a27f9e27b 2df221f6 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/05/01 04:02 linux-4.19.y 3f8a27f9e27b 2df221f6 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/29 07:21 linux-4.19.y 3f8a27f9e27b 6bdac766 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/27 01:56 linux-4.19.y 3f8a27f9e27b 89bc8608 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/25 14:14 linux-4.19.y 3f8a27f9e27b 89bc8608 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/23 21:12 linux-4.19.y 3f8a27f9e27b 5ff41e94 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/23 03:11 linux-4.19.y 3f8a27f9e27b 5ff41e94 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/23 02:37 linux-4.19.y 3f8a27f9e27b 5ff41e94 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/21 06:46 linux-4.19.y 3f8a27f9e27b e2d91b1d .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/20 01:04 linux-4.19.y 3f8a27f9e27b e2d91b1d .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/19 01:24 linux-4.19.y 3f8a27f9e27b e2d91b1d .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/17 04:04 linux-4.19.y 3f8a27f9e27b dfa9a8ed .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/16 23:33 linux-4.19.y 3f8a27f9e27b 46cc3b21 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/16 16:23 linux-4.19.y 3f8a27f9e27b 46cc3b21 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/16 15:45 linux-4.19.y 3f8a27f9e27b 46cc3b21 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/16 05:33 linux-4.19.y 3f8a27f9e27b 9e8eaa75 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/14 13:55 linux-4.19.y 3f8a27f9e27b 9e8eaa75 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/13 06:22 linux-4.19.y 3f8a27f9e27b 9e8eaa75 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/11 20:17 linux-4.19.y 3f8a27f9e27b 9e8eaa75 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/10 22:54 linux-4.19.y 3f8a27f9e27b 9e8eaa75 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/10 20:38 linux-4.19.y 3f8a27f9e27b 9e8eaa75 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/10 13:54 linux-4.19.y 3f8a27f9e27b 9e8eaa75 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/10 11:38 linux-4.19.y 3f8a27f9e27b 9e8eaa75 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/06 04:10 linux-4.19.y 3f8a27f9e27b 7bdd8b2c .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/05 19:09 linux-4.19.y 3f8a27f9e27b 7bdd8b2c .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/05 18:36 linux-4.19.y 3f8a27f9e27b 7bdd8b2c .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/05 00:14 linux-4.19.y 3f8a27f9e27b 45a13a73 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/03/04 14:36 linux-4.19.y 3f8a27f9e27b 45a13a73 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/02/01 03:46 linux-4.19.y 3f8a27f9e27b 6b7c57fe .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/01/18 22:31 linux-4.19.y 3f8a27f9e27b 731a2d23 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2022/01/14 23:04 linux-4.19.y 3f8a27f9e27b 53e00b45 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2021/11/29 06:36 linux-4.19.y 3f8a27f9e27b 63eeac02 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2021/09/30 18:59 linux-4.19.y c2276d585654 0f01403d .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2021/07/19 10:01 linux-4.19.y fcfbdfe9626e f115ae98 .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2021/07/08 19:51 linux-4.19.y 9f84340f012e 1b20171a .config log report info possible deadlock in pipe_lock
ci2-linux-4-19 2021/01/03 01:35 linux-4.19.y 3207316b3bee 79264ae3 .config log report info
ci2-linux-4-19 2020/03/19 18:42 linux-4.19.y 93556fb211fa 2c31c529 .config log report