syzbot


possible deadlock in pipe_write
Status: upstream: reported C repro on 2022/03/21 02:34
Reported-by: syzbot+011e4ea1da6692cf881c@syzkaller.appspotmail.com
First crash: 72d, last: 10d

Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: possible deadlock in pipe_write (log)
Repro: C syz .config

Sample crash report:
============================================
WARNING: possible recursive locking detected
5.17.0-rc8-syzkaller-00003-g56e337f2cf13 #0 Not tainted
--------------------------------------------
syz-executor704/3592 is trying to acquire lock:
ffff888079793468 (&pipe->mutex/1){+.+.}-{3:3}, at: __pipe_lock fs/pipe.c:103 [inline]
ffff888079793468 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_write+0x132/0x1c00 fs/pipe.c:431

but task is already holding lock:
ffff888079793068 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock_nested fs/pipe.c:82 [inline]
ffff888079793068 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock fs/pipe.c:90 [inline]
ffff888079793068 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_wait_readable+0x39b/0x420 fs/pipe.c:1049

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

       CPU0
       ----
  lock(&pipe->mutex/1);
  lock(&pipe->mutex/1);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

1 lock held by syz-executor704/3592:
 #0: ffff888079793068 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock_nested fs/pipe.c:82 [inline]
 #0: ffff888079793068 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock fs/pipe.c:90 [inline]
 #0: ffff888079793068 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_wait_readable+0x39b/0x420 fs/pipe.c:1049

stack backtrace:
CPU: 0 PID: 3592 Comm: syz-executor704 Not tainted 5.17.0-rc8-syzkaller-00003-g56e337f2cf13 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_deadlock_bug kernel/locking/lockdep.c:2956 [inline]
 check_deadlock kernel/locking/lockdep.c:2999 [inline]
 validate_chain kernel/locking/lockdep.c:3788 [inline]
 __lock_acquire.cold+0x213/0x3a9 kernel/locking/lockdep.c:5027
 lock_acquire kernel/locking/lockdep.c:5639 [inline]
 lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5604
 __mutex_lock_common kernel/locking/mutex.c:600 [inline]
 __mutex_lock+0x12f/0x12f0 kernel/locking/mutex.c:733
 __pipe_lock fs/pipe.c:103 [inline]
 pipe_write+0x132/0x1c00 fs/pipe.c:431
 call_write_iter include/linux/fs.h:2074 [inline]
 do_iter_readv_writev+0x47a/0x750 fs/read_write.c:725
 do_iter_write+0x188/0x710 fs/read_write.c:851
 vfs_iter_write+0x70/0xa0 fs/read_write.c:892
 iter_file_splice_write+0x723/0xc70 fs/splice.c:689
 do_splice_from fs/splice.c:767 [inline]
 do_splice+0xb7e/0x1960 fs/splice.c:1079
 __do_splice+0x134/0x250 fs/splice.c:1144
 __do_sys_splice fs/splice.c:1350 [inline]
 __se_sys_splice fs/splice.c:1332 [inline]
 __x64_sys_splice+0x198/0x250 fs/splice.c:1332
 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:0x7ff85a54eca9
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:00007ff85a501308 EFLAGS: 00000246 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffd

Crashes (24):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce 2022/03/17 04:11 upstream 56e337f2cf13 dfa9a8ed .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/03/17 03:52 upstream 56e337f2cf13 dfa9a8ed .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/03/17 03:31 upstream 56e337f2cf13 dfa9a8ed .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/03/17 03:11 upstream 56e337f2cf13 dfa9a8ed .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce-root 2022/03/17 02:45 upstream 56e337f2cf13 dfa9a8ed .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce-selinux-root 2022/03/17 02:42 upstream 56e337f2cf13 dfa9a8ed .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/03/17 02:40 upstream 56e337f2cf13 dfa9a8ed .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce-smack-root 2022/03/17 02:39 upstream 56e337f2cf13 dfa9a8ed .config log report syz C possible deadlock in pipe_write
ci-upstream-linux-next-kasan-gce-root 2022/03/17 02:44 linux-next 91265a6da44d dfa9a8ed .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce-selinux-root 2022/05/17 14:41 upstream 42226c989789 744a39e2 .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/04/28 12:54 upstream 8f4dd16603ce 8a1f1f07 .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/04/24 18:24 upstream 22da5264abf4 131df97d .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/04/15 02:17 upstream b9b4c79e5830 b17b2923 .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce-smack-root 2022/04/02 06:57 upstream 8467b0ed6ce3 79a2a8fc .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/03/19 07:53 upstream 34e047aa16c0 e2d91b1d .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce-smack-root 2022/03/17 03:51 upstream 56e337f2cf13 dfa9a8ed .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce-root 2022/03/17 02:35 upstream 56e337f2cf13 dfa9a8ed .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce-selinux-root 2022/03/17 02:30 upstream 56e337f2cf13 dfa9a8ed .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce-smack-root 2022/03/17 02:29 upstream 56e337f2cf13 dfa9a8ed .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/03/17 02:28 upstream 56e337f2cf13 dfa9a8ed .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce-386 2022/04/14 18:24 upstream a19944809fe9 b17b2923 .config log report info possible deadlock in pipe_write
ci-qemu-upstream-386 2022/03/17 15:24 upstream 56e337f2cf13 dfa9a8ed .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce-386 2022/03/17 02:59 upstream 56e337f2cf13 dfa9a8ed .config log report info possible deadlock in pipe_write
ci-upstream-linux-next-kasan-gce-root 2022/03/17 02:32 linux-next 91265a6da44d dfa9a8ed .config log report info possible deadlock in pipe_write