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: 200d, last: 3d19h

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
6.0.0-rc5-syzkaller-00025-g3245cb65fd91 #0 Not tainted
--------------------------------------------
syz-executor241/3615 is trying to acquire lock:
ffff88801d470c68 (&pipe->mutex/1){+.+.}-{3:3}, at: __pipe_lock fs/pipe.c:103 [inline]
ffff88801d470c68 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_write+0x12b/0x1aa0 fs/pipe.c:431

but task is already holding lock:
ffff888012222868 (&pipe->mutex/1){+.+.}-{3:3}, at: iter_file_splice_write+0x2a2/0xff0 fs/splice.c:632

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-executor241/3615:
 #0: ffff888012222868 (&pipe->mutex/1){+.+.}-{3:3}, at: iter_file_splice_write+0x2a2/0xff0 fs/splice.c:632

stack backtrace:
CPU: 0 PID: 3615 Comm: syz-executor241 Not tainted 6.0.0-rc5-syzkaller-00025-g3245cb65fd91 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 print_deadlock_bug kernel/locking/lockdep.c:2988 [inline]
 check_deadlock kernel/locking/lockdep.c:3031 [inline]
 validate_chain+0x4897/0x6600 kernel/locking/lockdep.c:3816
 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5053
 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5666
 __mutex_lock_common+0x1de/0x26c0 kernel/locking/mutex.c:603
 __mutex_lock kernel/locking/mutex.c:747 [inline]
 mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799
 __pipe_lock fs/pipe.c:103 [inline]
 pipe_write+0x12b/0x1aa0 fs/pipe.c:431
 do_iter_write+0x6f0/0xc50 fs/read_write.c:855
 iter_file_splice_write+0x830/0xff0 fs/splice.c:686
 do_splice_from fs/splice.c:764 [inline]
 do_splice+0x1105/0x1930 fs/splice.c:1074
 __do_splice fs/splice.c:1139 [inline]
 __do_sys_splice fs/splice.c:1346 [inline]
 __se_sys_splice+0x2a8/0x410 fs/splice.c:1328
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fd5c0e47c79
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:00007fd5c0dd9308 EFLAGS: 00000246 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 00007fd5c0ed0418 RCX: 00007fd5c0e47c79
RDX: 0000000000000006 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 00007fd5c0ed0410 R08: 0000002000002001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fd5c0ed041c
R13: 00007ffc1007c76f R14: 00007fd5c0dd9400 R15: 0000000000022000
 </TASK>

Crashes (66):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-smack-root 2022/09/16 00:47 upstream 3245cb65fd91 dd9a85ff .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce-selinux-root 2022/08/18 16:01 upstream 274a2eebf80c d58e263f .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce-selinux-root 2022/08/18 15:39 upstream 274a2eebf80c d58e263f .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce-selinux-root 2022/08/18 15:07 upstream 274a2eebf80c d58e263f .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce-selinux-root 2022/08/18 14:46 upstream 274a2eebf80c d58e263f .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce-smack-root 2022/07/24 16:36 upstream 515f71412bb7 22343af4 .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce-smack-root 2022/07/24 15:56 upstream 515f71412bb7 22343af4 .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce-smack-root 2022/07/24 15:38 upstream 515f71412bb7 22343af4 .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce-root 2022/07/21 02:57 upstream 353f7988dd84 88cb1383 .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/06/11 19:56 upstream fe43c0188911 0d5abf15 .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce-root 2022/06/07 09:10 upstream e71e60cd74df c8857892 .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce-root 2022/06/07 08:34 upstream e71e60cd74df c8857892 .config log report syz C possible deadlock in pipe_write
ci-upstream-kasan-gce-root 2022/06/07 07:43 upstream e71e60cd74df c8857892 .config log report syz C possible deadlock in pipe_write
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/07/16 20:55 linux-next cb71b93c2dc3 95cb00d1 .config log report syz C possible deadlock in pipe_write
ci-upstream-linux-next-kasan-gce-root 2022/07/16 20:35 linux-next cb71b93c2dc3 95cb00d1 .config log report syz C possible deadlock in pipe_write
ci-upstream-linux-next-kasan-gce-root 2022/07/16 20:14 linux-next cb71b93c2dc3 95cb00d1 .config log report syz C possible deadlock in pipe_write
ci-upstream-linux-next-kasan-gce-root 2022/07/16 20:03 linux-next cb71b93c2dc3 95cb00d1 .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 2022/09/30 00:58 upstream 511cce163b75 1d385642 .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/09/28 20:46 upstream 49c13ed0316d e2556bc3 .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce-selinux-root 2022/09/27 08:18 upstream 3800a713b607 10323ddf .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/09/26 05:14 upstream f76349cf4145 0042f2b4 .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce-smack-root 2022/09/19 05:44 upstream 38eddeedbbea dd9a85ff .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce-root 2022/09/17 21:53 upstream a335366bad13 dd9a85ff .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce-selinux-root 2022/08/28 22:05 upstream 10d4879f9ef0 07177916 .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce-root 2022/08/19 08:11 upstream 3b06a2755758 26a13b38 .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/08/11 10:17 upstream 200e340f2196 a6201f11 .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/08/09 15:25 upstream 200e340f2196 da700653 .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/06/29 13:20 upstream 941e3e791269 496a8536 .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/06/26 22:03 upstream 0840a7914caa a371c43c .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/06/24 18:54 upstream 92f20ff72066 a5dbd430 .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce-selinux-root 2022/06/18 04:31 upstream f0ec9c65a8d6 cb58b3b2 .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce-root 2022/06/18 01:07 upstream f0ec9c65a8d6 cb58b3b2 .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/06/01 20:14 upstream 700170bf6b4d 3666edfe .config log report info possible deadlock in pipe_write
ci-upstream-kasan-gce 2022/05/31 06:27 upstream 2c5ca23f7414 af70c3a9 .config log report info 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/07/16 03:18 upstream 9b59ec8d50a1 95cb00d1 .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/08/12 16:01 linux-next 6c8f479764eb 402cd70d .config log report info possible deadlock in pipe_write
ci-upstream-linux-next-kasan-gce-root 2022/06/11 04:45 linux-next 6d0c80680317 0d5abf15 .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
ci-upstream-gce-arm64 2022/09/17 04:59 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a6b443748715 dd9a85ff .config log report info possible deadlock in pipe_write
* Struck through repros no longer work on HEAD.