syzbot


possible deadlock in lock_trace

Status: closed as dup on 2017/12/12 21:59
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+86a008206e8012f85c5feebf2873716e50f33fc4@syzkaller.appspotmail.com
First crash: 2548d, last: 2067d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
possible deadlock in seq_read fs C 19074 2057d 2547d
Similar bugs (7)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 possible deadlock in lock_trace syz error 42 1528d 2034d 0/1 upstream: reported syz repro on 2019/04/28 18:16
linux-4.14 possible deadlock in lock_trace C error 146 1586d 2043d 0/1 upstream: reported C repro on 2019/04/19 09:51
android-49 possible deadlock in lock_trace C 7424 1814d 2050d 0/3 public: reported C repro on 2019/04/12 00:00
upstream possible deadlock in lock_trace (2) fs 3 2015d 2045d 0/28 auto-closed as invalid on 2019/10/25 08:41
upstream possible deadlock in lock_trace (3) fs syz inconclusive done 69 1694d 1829d 15/28 fixed on 2020/08/18 22:40
android-414 possible deadlock in lock_trace syz 203 2059d 2050d 0/1 public: reported syz repro on 2019/04/12 00:01
android-44 possible deadlock in lock_trace C 41 1821d 2051d 0/2 public: reported C repro on 2019/04/11 08:44

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
4.15.0-rc2-mm1+ #39 Not tainted
------------------------------------------------------
syzkaller408042/3177 is trying to acquire lock:
 (&sig->cred_guard_mutex){+.+.}, at: [<00000000d8b74695>] lock_trace+0x44/0xc0 fs/proc/base.c:407

but task is already holding lock:
 (&p->lock){+.+.}, at: [<00000000453b9d10>] seq_read+0xd5/0x13d0 fs/seq_file.c:165

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&p->lock){+.+.}:
       lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893
       mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908
       seq_read+0xd5/0x13d0 fs/seq_file.c:165
       do_loop_readv_writev fs/read_write.c:673 [inline]
       do_iter_read+0x3db/0x5b0 fs/read_write.c:897
       vfs_readv+0x121/0x1c0 fs/read_write.c:959
       kernel_readv fs/splice.c:361 [inline]
       default_file_splice_read+0x508/0xae0 fs/splice.c:416
       do_splice_to+0x110/0x170 fs/splice.c:880
       do_splice fs/splice.c:1173 [inline]
       SYSC_splice fs/splice.c:1402 [inline]
       SyS_splice+0x11a8/0x1630 fs/splice.c:1382
       entry_SYSCALL_64_fastpath+0x1f/0x96

-> #1 (&pipe->mutex/1){+.+.}:
       lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893
       mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908
       __pipe_lock fs/pipe.c:88 [inline]
       fifo_open+0x15c/0xa40 fs/pipe.c:916
       do_dentry_open+0x682/0xd70 fs/open.c:752
       vfs_open+0x107/0x230 fs/open.c:866
       do_last fs/namei.c:3397 [inline]
       path_openat+0x1157/0x3530 fs/namei.c:3537
       do_filp_open+0x25b/0x3b0 fs/namei.c:3572
       do_open_execat+0x1b9/0x5c0 fs/exec.c:849
       do_execveat_common.isra.30+0x90c/0x22a0 fs/exec.c:1741
       do_execve fs/exec.c:1848 [inline]
       SYSC_execve fs/exec.c:1929 [inline]
       SyS_execve+0x39/0x50 fs/exec.c:1924
       do_syscall_64+0x26c/0x920 arch/x86/entry/common.c:285
       return_from_SYSCALL_64+0x0/0x75

-> #0 (&sig->cred_guard_mutex){+.+.}:
       check_prevs_add kernel/locking/lockdep.c:2031 [inline]
       validate_chain kernel/locking/lockdep.c:2473 [inline]
       __lock_acquire+0x3498/0x47f0 kernel/locking/lockdep.c:3500
       lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893
       mutex_lock_killable_nested+0x16/0x20 kernel/locking/mutex.c:923
       lock_trace+0x44/0xc0 fs/proc/base.c:407
       proc_pid_syscall+0xa3/0x550 fs/proc/base.c:624
       proc_single_show+0xf8/0x170 fs/proc/base.c:746
       seq_read+0x385/0x13d0 fs/seq_file.c:234
       do_loop_readv_writev fs/read_write.c:673 [inline]
       do_iter_read+0x3db/0x5b0 fs/read_write.c:897
       vfs_readv+0x121/0x1c0 fs/read_write.c:959
       kernel_readv fs/splice.c:361 [inline]
       default_file_splice_read+0x508/0xae0 fs/splice.c:416
       do_splice_to+0x110/0x170 fs/splice.c:880
       do_splice fs/splice.c:1173 [inline]
       SYSC_splice fs/splice.c:1402 [inline]
       SyS_splice+0x11a8/0x1630 fs/splice.c:1382
       entry_SYSCALL_64_fastpath+0x1f/0x96

other info that might help us debug this:

Chain exists of:
  &sig->cred_guard_mutex --> &pipe->mutex/1 --> &p->lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&p->lock);
                               lock(&pipe->mutex/1);
                               lock(&p->lock);
  lock(&sig->cred_guard_mutex);

 *** DEADLOCK ***

2 locks held by syzkaller408042/3177:
 #0:  (&pipe->mutex/1){+.+.}, at: [<00000000989db40a>] pipe_lock_nested fs/pipe.c:67 [inline]
 #0:  (&pipe->mutex/1){+.+.}, at: [<00000000989db40a>] pipe_lock+0x56/0x70 fs/pipe.c:75
 #1:  (&p->lock){+.+.}, at: [<00000000453b9d10>] seq_read+0xd5/0x13d0 fs/seq_file.c:165

stack backtrace:
CPU: 1 PID: 3177 Comm: syzkaller408042 Not tainted 4.15.0-rc2-mm1+ #39
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x194/0x257 lib/dump_stack.c:53
 print_circular_bug+0x42d/0x610 kernel/locking/lockdep.c:1271
 check_prev_add+0x666/0x15f0 kernel/locking/lockdep.c:1914
 check_prevs_add kernel/locking/lockdep.c:2031 [inline]
 validate_chain kernel/locking/lockdep.c:2473 [inline]
 __lock_acquire+0x3498/0x47f0 kernel/locking/lockdep.c:3500
 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004
 __mutex_lock_common kernel/locking/mutex.c:756 [inline]
 __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893
 mutex_lock_killable_nested+0x16/0x20 kernel/locking/mutex.c:923
 lock_trace+0x44/0xc0 fs/proc/base.c:407
 proc_pid_syscall+0xa3/0x550 fs/proc/base.c:624
 proc_single_show+0xf8/0x170 fs/proc/base.c:746
 seq_read+0x385/0x13d0 fs/seq_file.c:234
 do_loop_readv_writev fs/read_write.c:673 [inline]
 do_iter_read+0x3db/0x5b0 fs/read_write.c:897
 vfs_readv+0x121/0x1c0 fs/read_write.c:959
 kernel_readv fs/splice.c:361 [inline]
 default_file_splice_read+0x508/0xae0 fs/splice.c:416
 do_splice_to+0x110/0x170 fs/splice.c:880
 do_splice fs/splice.c:1173 [inline]
 SYSC_splice fs/splice.c:1402 [inline]
 SyS_splice+0x11a8/0x1630 fs/splice.c:1382
 entry_SYSCALL_64_fastpath+0x1f/0x96
RIP: 0033:0x44a559
RSP: 002b:00007fc37ca0bd28 EFLAGS: 00000212 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 00007fc37ca0c700 RCX: 000000000044a559
RDX: 0000000000000005 RSI: 0000000000000000 RDI: 0000000000000006
RBP: 00007ffdb54a6600 R08: 000000000000a3ea R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000212 R12: 0000000000000000
R13: 00007ffdb54a65ff R14: 00007fc37ca0c9c0 R15: 0000000000000000

Crashes (1847):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2017/12/09 20:46 mmots 82bcf1def3b5 5ad0ce95 .config console log report syz C ci-upstream-mmots-kasan-gce
2017/12/03 22:25 linux-next fb20eb9d798d 16668351 .config console log report syz C ci-upstream-next-kasan-gce
2018/10/15 22:56 upstream f0a7d1883d9f 8cd30605 .config console log report syz ci-upstream-kasan-gce-root
2018/10/15 22:55 upstream f0a7d1883d9f 8cd30605 .config console log report syz ci-upstream-kasan-gce
2018/10/15 22:15 upstream f0a7d1883d9f 8cd30605 .config console log report syz ci-upstream-kasan-gce-smack-root
2018/10/15 21:20 upstream f0a7d1883d9f 8cd30605 .config console log report syz ci-upstream-kasan-gce-selinux-root
2018/09/23 18:38 upstream 328c6333ba3d 37079712 .config console log report syz ci-upstream-kasan-gce
2018/09/23 15:46 upstream 328c6333ba3d 37079712 .config console log report syz ci-upstream-kasan-gce
2018/09/23 12:59 upstream 328c6333ba3d 37079712 .config console log report syz ci-upstream-kasan-gce-root
2018/09/23 09:57 upstream 328c6333ba3d 37079712 .config console log report syz ci-upstream-kasan-gce-smack-root
2018/09/23 08:45 upstream 328c6333ba3d 37079712 .config console log report syz ci-upstream-kasan-gce-selinux-root
2018/09/23 01:12 upstream 10dc890d4228 37079712 .config console log report syz ci-upstream-kasan-gce-smack-root
2018/09/23 01:10 upstream 10dc890d4228 37079712 .config console log report syz ci-upstream-kasan-gce-selinux-root
2018/09/23 01:08 upstream 10dc890d4228 37079712 .config console log report syz ci-upstream-kasan-gce-root
2018/10/15 22:43 upstream f0a7d1883d9f 8cd30605 .config console log report syz ci-upstream-kasan-gce-386
2018/09/23 01:13 upstream 10dc890d4228 37079712 .config console log report syz ci-upstream-kasan-gce-386
2018/10/15 21:35 linux-next ca0591d03a2d 8cd30605 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2018/09/23 13:26 linux-next 46c163a036b4 37079712 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2018/09/23 01:10 linux-next 46c163a036b4 37079712 .config console log report syz ci-upstream-linux-next-kasan-gce-root
2019/03/26 15:30 upstream a3ac7917b730 55684ce1 .config console log report ci-upstream-kasan-gce-root
2019/03/26 07:32 upstream a3ac7917b730 55684ce1 .config console log report ci-upstream-kasan-gce-root
2019/03/22 17:36 upstream 0939221e6468 dce6e62f .config console log report ci-upstream-kasan-gce-smack-root
2019/03/21 23:57 upstream 0939221e6468 dce6e62f .config console log report ci-upstream-kasan-gce-selinux-root
2019/03/21 07:03 upstream 54c490164523 427ea487 .config console log report ci-upstream-kasan-gce-root
2019/03/19 11:51 upstream 9e98c678c2d6 46264c32 .config console log report ci-upstream-kasan-gce-smack-root
2019/03/19 11:36 upstream 9e98c678c2d6 46264c32 .config console log report ci-upstream-kasan-gce-selinux-root
2019/03/18 19:40 upstream 9e98c678c2d6 4656beca .config console log report ci-upstream-kasan-gce-root
2019/03/07 12:18 upstream f90d64483ebd 8c085c5e .config console log report ci-upstream-kasan-gce-root
2019/03/07 11:16 upstream f90d64483ebd 8c085c5e .config console log report ci-upstream-kasan-gce
2019/03/06 03:41 upstream 63bdf4284c38 16559f86 .config console log report ci-upstream-kasan-gce-selinux-root
2019/03/06 02:07 upstream 63bdf4284c38 16559f86 .config console log report ci-upstream-kasan-gce-smack-root
2019/03/04 16:56 upstream 1c163f4c7b3f 7c693b52 .config console log report ci-upstream-kasan-gce-selinux-root
2019/03/04 13:28 upstream 1c163f4c7b3f 7c693b52 .config console log report ci-upstream-kasan-gce-root
2019/03/01 22:09 upstream 7d762d69145a 68d9e495 .config console log report ci-upstream-kasan-gce-selinux-root
2019/03/01 10:41 upstream 7d762d69145a 8a4b3a6b .config console log report ci-upstream-kasan-gce-selinux-root
2019/02/28 07:55 upstream 7d762d69145a 34ec456b .config console log report ci-upstream-kasan-gce-smack-root
2019/02/24 00:56 upstream e60b5f79bd75 7a06e792 .config console log report ci-upstream-kasan-gce-root
2019/02/22 11:02 upstream 8a61716ff2ab 7ff74a98 .config console log report ci-upstream-kasan-gce-selinux-root
2019/02/20 19:36 upstream 2137397c92ae c95f0707 .config console log report ci-upstream-kasan-gce-smack-root
2019/02/15 20:41 upstream cb5b020a8d38 f6f233c0 .config console log report ci-upstream-kasan-gce-smack-root
2019/02/13 02:03 upstream 57902dc0670c 1eedba36 .config console log report ci-upstream-kasan-gce-smack-root
2019/02/12 23:51 upstream 57902dc0670c 6ecc6d0f .config console log report ci-upstream-kasan-gce-smack-root
2019/02/12 00:20 upstream aa0c38cf39de 65a0d619 .config console log report ci-upstream-kasan-gce-root
2019/02/11 14:21 upstream d13937116f1e 73f5f452 .config console log report ci-upstream-kasan-gce-smack-root
2019/02/09 06:57 upstream 46c291e277f9 fa6c7b70 .config console log report ci-upstream-kasan-gce-smack-root
2019/02/09 04:33 upstream 74e96711e337 fa6c7b70 .config console log report ci-upstream-kasan-gce-smack-root
2019/02/08 12:00 upstream d47e3da17592 aa4feb03 .config console log report ci-upstream-kasan-gce-smack-root
2019/02/07 23:09 upstream b0314565da2b aa4feb03 .config console log report ci-upstream-kasan-gce-root
2019/02/07 11:48 upstream b0314565da2b aa4feb03 .config console log report ci-upstream-kasan-gce-smack-root
2019/02/07 08:27 upstream 8834f5600cf3 d25487bc .config console log report ci-upstream-kasan-gce-selinux-root
2019/02/06 04:55 upstream 8834f5600cf3 d672172c .config console log report ci-upstream-kasan-gce-selinux-root
2019/02/05 11:32 upstream 8834f5600cf3 d672172c .config console log report ci-upstream-kasan-gce-smack-root
2019/01/30 18:57 upstream 1c0490ce9022 aa432daf .config console log report ci-upstream-kasan-gce-root
2019/01/29 05:17 upstream 4aa9fc2a435a aa432daf .config console log report ci-upstream-kasan-gce-root
2019/01/26 23:59 upstream ba6069759381 c73f090a .config console log report ci-upstream-kasan-gce-root
2019/03/23 00:31 upstream fd1f297b794c 3361bde5 .config console log report ci-upstream-kasan-gce-386
2019/03/01 22:32 upstream 7d762d69145a 68d9e495 .config console log report ci-upstream-kasan-gce-386
2019/02/16 16:18 upstream 5ded5871030e f42dee6d .config console log report ci-upstream-kasan-gce-386
2019/02/14 18:17 upstream 1f947a7a011f 76dd003f .config console log report ci-upstream-kasan-gce-386
2019/02/14 02:26 upstream 1f947a7a011f 0a49c954 .config console log report ci-upstream-kasan-gce-386
2019/02/12 02:48 upstream aa0c38cf39de 65a0d619 .config console log report ci-upstream-kasan-gce-386
2019/02/07 13:00 upstream b0314565da2b aa4feb03 .config console log report ci-upstream-kasan-gce-386
2019/03/19 02:16 linux-next b99981945914 46264c32 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/03/17 08:35 linux-next cf08baa29613 bab43553 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/03/15 10:54 linux-next cf08baa29613 bab43553 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/03/15 01:39 linux-next cf08baa29613 d72db19b .config console log report ci-upstream-linux-next-kasan-gce-root
2019/03/03 09:18 linux-next c63e9e91a254 1c0e457a .config console log report ci-upstream-linux-next-kasan-gce-root
2019/02/14 01:16 linux-next c4f3ef3eb53f 0a49c954 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/02/09 06:51 linux-next a46228f6598a fa6c7b70 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/02/06 13:11 linux-next 1a82ba1c69e3 d25487bc .config console log report ci-upstream-linux-next-kasan-gce-root
2019/01/27 09:13 linux-next 494367cb57c9 c73f090a .config console log report ci-upstream-linux-next-kasan-gce-root
2017/12/27 19:23 mmots 37759fa6d0fa 09c8f4c0 .config console log report ci-upstream-mmots-kasan-gce
2017/12/19 07:06 linux-next 6084b576dca2 1c4160ef .config console log report ci-upstream-next-kasan-gce
* Struck through repros no longer work on HEAD.