syzbot


possible deadlock in lock_trace

Status: public: reported C repro on 2019/04/12 00:00
Reported-by: syzbot+d5193c8ff411466c6053@syzkaller.appspotmail.com
First crash: 2548d, last: 1814d
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 2033d 0/1 upstream: reported syz repro on 2019/04/28 18:16
linux-4.14 possible deadlock in lock_trace C error 146 1585d 2043d 0/1 upstream: reported C repro on 2019/04/19 09:51
upstream possible deadlock in lock_trace (2) fs 3 2015d 2044d 0/28 auto-closed as invalid on 2019/10/25 08:41
upstream possible deadlock in lock_trace fs C 1847 2067d 2547d 0/28 closed as dup on 2017/12/12 21:59
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:
audit: type=1400 audit(1537689852.649:8): avc:  denied  { dac_override } for  pid=5747 comm="syz-executor766" capability=1  scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=cap_userns permissive=1

======================================================
[ INFO: possible circular locking dependency detected ]
4.9.128+ #45 Not tainted
-------------------------------------------------------
syz-executor766/5748 is trying to acquire lock:
 (&sig->cred_guard_mutex){+.+.+.}, at: [<ffffffff8163e0f4>] lock_trace+0x44/0xc0 fs/proc/base.c:431
but task is already holding lock:
 (&p->lock){+.+.+.}, at: [<ffffffff8155eafd>] seq_read+0xdd/0x12d0 fs/seq_file.c:178
which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

       lock_acquire+0x130/0x3e0 kernel/locking/lockdep.c:3756
       __mutex_lock_common kernel/locking/mutex.c:521 [inline]
       mutex_lock_nested+0xc0/0x870 kernel/locking/mutex.c:621
       seq_read+0xdd/0x12d0 fs/seq_file.c:178
       proc_reg_read+0xfd/0x180 fs/proc/inode.c:203
       do_loop_readv_writev.part.1+0xd5/0x280 fs/read_write.c:718
       do_loop_readv_writev fs/read_write.c:707 [inline]
       do_readv_writev+0x56e/0x7b0 fs/read_write.c:873
       vfs_readv+0x84/0xc0 fs/read_write.c:897
       kernel_readv fs/splice.c:363 [inline]
       default_file_splice_read+0x44b/0x7e0 fs/splice.c:435
       do_splice_to+0x10c/0x170 fs/splice.c:899
       do_splice fs/splice.c:1192 [inline]
       SYSC_splice fs/splice.c:1416 [inline]
       SyS_splice+0x10d2/0x14d0 fs/splice.c:1399
       do_syscall_32_irqs_on arch/x86/entry/common.c:325 [inline]
       do_fast_syscall_32+0x2f1/0x860 arch/x86/entry/common.c:387
       entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137

       lock_acquire+0x130/0x3e0 kernel/locking/lockdep.c:3756
       __mutex_lock_common kernel/locking/mutex.c:521 [inline]
       mutex_lock_nested+0xc0/0x870 kernel/locking/mutex.c:621
       __pipe_lock fs/pipe.c:87 [inline]
       fifo_open+0x15c/0x9e0 fs/pipe.c:921
       do_dentry_open+0x3ef/0xc90 fs/open.c:766
       vfs_open+0x11c/0x210 fs/open.c:879
       do_last fs/namei.c:3410 [inline]
       path_openat+0x542/0x2790 fs/namei.c:3534
       do_filp_open+0x197/0x270 fs/namei.c:3568
       do_open_execat+0x10f/0x640 fs/exec.c:844
       do_execveat_common.isra.15+0x687/0x1f80 fs/exec.c:1723
       compat_do_execve fs/exec.c:1856 [inline]
       C_SYSC_execve fs/exec.c:1931 [inline]
       compat_SyS_execve+0x48/0x60 fs/exec.c:1927
       do_syscall_32_irqs_on arch/x86/entry/common.c:325 [inline]
       do_fast_syscall_32+0x2f1/0x860 arch/x86/entry/common.c:387
       entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137

       check_prev_add kernel/locking/lockdep.c:1828 [inline]
       check_prevs_add kernel/locking/lockdep.c:1938 [inline]
       validate_chain kernel/locking/lockdep.c:2265 [inline]
       __lock_acquire+0x3189/0x4a10 kernel/locking/lockdep.c:3345
       lock_acquire+0x130/0x3e0 kernel/locking/lockdep.c:3756
       __mutex_lock_common kernel/locking/mutex.c:521 [inline]
       mutex_lock_killable_nested+0xcc/0x960 kernel/locking/mutex.c:641
       lock_trace+0x44/0xc0 fs/proc/base.c:431
       proc_pid_stack+0xdc/0x220 fs/proc/base.c:467
       proc_single_show+0xfd/0x170 fs/proc/base.c:771
       traverse+0x363/0x920 fs/seq_file.c:124
       seq_read+0xd1b/0x12d0 fs/seq_file.c:195
       do_loop_readv_writev.part.1+0xd5/0x280 fs/read_write.c:718
       do_loop_readv_writev fs/read_write.c:707 [inline]
       compat_do_readv_writev+0x570/0x7b0 fs/read_write.c:1091
       compat_readv+0xe2/0x150 fs/read_write.c:1120
       do_compat_preadv64+0x152/0x180 fs/read_write.c:1169
       C_SYSC_preadv fs/read_write.c:1189 [inline]
       compat_SyS_preadv+0x3b/0x50 fs/read_write.c:1183
       do_syscall_32_irqs_on arch/x86/entry/common.c:325 [inline]
       do_fast_syscall_32+0x2f1/0x860 arch/x86/entry/common.c:387
       entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137

other info that might help us debug this:

Chain exists of:
 Possible unsafe locking scenario:

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

 *** DEADLOCK ***

1 lock held by syz-executor766/5748:
 #0:  (&p->lock){+.+.+.}, at: [<ffffffff8155eafd>] seq_read+0xdd/0x12d0 fs/seq_file.c:178

stack backtrace:
CPU: 0 PID: 5748 Comm: syz-executor766 Not tainted 4.9.128+ #45
 ffff8801c5b37468 ffffffff81af2469 ffffffff83aa8440 ffffffff83aa2ad0
 ffffffff83aa1180 ffff8801c54fd010 ffff8801c54fc740 ffff8801c5b374b0
 ffffffff813e79ed 0000000000000001 00000000c54fcff0 0000000000000001
Call Trace:
 [<ffffffff81af2469>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81af2469>] dump_stack+0xc1/0x128 lib/dump_stack.c:51
 [<ffffffff813e79ed>] print_circular_bug.cold.36+0x2f7/0x432 kernel/locking/lockdep.c:1202
 [<ffffffff81202779>] check_prev_add kernel/locking/lockdep.c:1828 [inline]
 [<ffffffff81202779>] check_prevs_add kernel/locking/lockdep.c:1938 [inline]
 [<ffffffff81202779>] validate_chain kernel/locking/lockdep.c:2265 [inline]
 [<ffffffff81202779>] __lock_acquire+0x3189/0x4a10 kernel/locking/lockdep.c:3345
 [<ffffffff81204b10>] lock_acquire+0x130/0x3e0 kernel/locking/lockdep.c:3756
 [<ffffffff827837bc>] __mutex_lock_common kernel/locking/mutex.c:521 [inline]
 [<ffffffff827837bc>] mutex_lock_killable_nested+0xcc/0x960 kernel/locking/mutex.c:641
 [<ffffffff8163e0f4>] lock_trace+0x44/0xc0 fs/proc/base.c:431
 [<ffffffff8163e24c>] proc_pid_stack+0xdc/0x220 fs/proc/base.c:467
 [<ffffffff8163683d>] proc_single_show+0xfd/0x170 fs/proc/base.c:771
 [<ffffffff8155e0a3>] traverse+0x363/0x920 fs/seq_file.c:124
 [<ffffffff8155f73b>] seq_read+0xd1b/0x12d0 fs/seq_file.c:195
 [<ffffffff814ea805>] do_loop_readv_writev.part.1+0xd5/0x280 fs/read_write.c:718
 [<ffffffff814ed120>] do_loop_readv_writev fs/read_write.c:707 [inline]
 [<ffffffff814ed120>] compat_do_readv_writev+0x570/0x7b0 fs/read_write.c:1091
 [<ffffffff814ed442>] compat_readv+0xe2/0x150 fs/read_write.c:1120
 [<ffffffff814ed7d2>] do_compat_preadv64+0x152/0x180 fs/read_write.c:1169
 [<ffffffff814efd5b>] C_SYSC_preadv fs/read_write.c:1189 [inline]
 [<ffffffff814efd5b>] compat_SyS_preadv+0x3b/0x50 fs/read_write.c:1183
 [<ffffffff81005fd1>] do_syscall_32_irqs_on arch/x86/entry/common.c:325 [inline]
 [<ffffffff81005fd1>] do_fast_syscall_32+0x2f1/0x860 arch/x86/entry/common.c:387
 [<ffffffff8278f460>] entry_SYSENTER_compat+0x90/0xa2 arch/x86/entry/entry_64_compat.S:137

Crashes (7424):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/09/23 08:09 https://android.googlesource.com/kernel/common android-4.9 1c57ba4f543b 37079712 .config console log report syz C ci-android-49-kasan-gce-386
2018/09/23 08:22 https://android.googlesource.com/kernel/common android-4.9 1c57ba4f543b 37079712 .config console log report syz ci-android-49-kasan-gce-root
2018/10/15 20:25 https://android.googlesource.com/kernel/common android-4.9 d589c0d40671 8cd30605 .config console log report syz ci-android-49-kasan-gce-386
2019/12/04 01:30 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 ae13a849 .config console log report ci-android-49-kasan-gce
2019/12/04 00:15 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 ae13a849 .config console log report ci-android-49-kasan-gce
2019/12/03 10:38 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 ab342da3 .config console log report ci-android-49-kasan-gce
2019/12/02 17:06 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 f879db37 .config console log report ci-android-49-kasan-gce
2019/11/29 19:59 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 d29b9e84 .config console log report ci-android-49-kasan-gce
2019/11/29 17:31 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 d29b9e84 .config console log report ci-android-49-kasan-gce
2019/11/29 15:00 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 d29b9e84 .config console log report ci-android-49-kasan-gce
2019/11/28 19:11 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 46869e3e .config console log report ci-android-49-kasan-gce
2019/11/27 12:48 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 1048481f .config console log report ci-android-49-kasan-gce
2019/11/27 11:44 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 1048481f .config console log report ci-android-49-kasan-gce
2019/11/27 10:13 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 1048481f .config console log report ci-android-49-kasan-gce
2019/11/27 09:02 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 1048481f .config console log report ci-android-49-kasan-gce
2019/11/27 07:54 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 1048481f .config console log report ci-android-49-kasan-gce
2019/11/27 04:34 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 1048481f .config console log report ci-android-49-kasan-gce
2019/11/26 23:34 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 1048481f .config console log report ci-android-49-kasan-gce
2019/11/26 13:06 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 f746151a .config console log report ci-android-49-kasan-gce
2019/11/26 09:26 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 f746151a .config console log report ci-android-49-kasan-gce
2019/11/26 06:03 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 f746151a .config console log report ci-android-49-kasan-gce
2019/11/26 05:03 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 f746151a .config console log report ci-android-49-kasan-gce
2019/11/25 22:51 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 371caf77 .config console log report ci-android-49-kasan-gce
2019/11/25 22:45 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 371caf77 .config console log report ci-android-49-kasan-gce
2019/11/25 15:30 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 371caf77 .config console log report ci-android-49-kasan-gce
2019/11/25 14:02 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 371caf77 .config console log report ci-android-49-kasan-gce
2019/11/25 08:49 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 598ca6c8 .config console log report ci-android-49-kasan-gce
2019/11/25 05:13 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 598ca6c8 .config console log report ci-android-49-kasan-gce
2019/11/25 01:00 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 598ca6c8 .config console log report ci-android-49-kasan-gce
2019/11/24 12:58 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 598ca6c8 .config console log report ci-android-49-kasan-gce
2019/11/24 11:45 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 598ca6c8 .config console log report ci-android-49-kasan-gce
2019/11/24 06:17 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 598ca6c8 .config console log report ci-android-49-kasan-gce
2019/11/23 18:44 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 598ca6c8 .config console log report ci-android-49-kasan-gce
2019/11/23 13:03 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 598ca6c8 .config console log report ci-android-49-kasan-gce
2019/11/23 08:18 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 598ca6c8 .config console log report ci-android-49-kasan-gce
2019/11/23 06:02 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 598ca6c8 .config console log report ci-android-49-kasan-gce
2019/11/23 01:19 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 598ca6c8 .config console log report ci-android-49-kasan-gce
2019/11/23 00:23 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 598ca6c8 .config console log report ci-android-49-kasan-gce
2019/11/22 19:06 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 598ca6c8 .config console log report ci-android-49-kasan-gce
2019/11/22 06:03 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 8098ea0f .config console log report ci-android-49-kasan-gce
2019/11/22 04:53 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 8098ea0f .config console log report ci-android-49-kasan-gce
2019/11/21 15:48 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 8098ea0f .config console log report ci-android-49-kasan-gce
2019/11/21 13:42 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 8098ea0f .config console log report ci-android-49-kasan-gce
2019/11/21 11:02 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 8098ea0f .config console log report ci-android-49-kasan-gce
2019/11/21 08:05 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 8098ea0f .config console log report ci-android-49-kasan-gce
2019/11/16 07:37 https://android.googlesource.com/kernel/common android-4.9 7fe05eede1c8 cdac920b .config console log report ci-android-49-kasan-gce-root
2019/11/28 14:08 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 46869e3e .config console log report ci-android-49-kasan-gce-386
2019/11/24 04:17 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 598ca6c8 .config console log report ci-android-49-kasan-gce-386
* Struck through repros no longer work on HEAD.