syzbot


possible deadlock in lock_trace

Status: public: reported syz repro on 2019/04/12 00:01
Reported-by: syzbot+93cba293055103e38a9f@syzkaller.appspotmail.com
First crash: 2291d, last: 2085d
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 1554d 2060d 0/1 upstream: reported syz repro on 2019/04/28 18:16
linux-4.14 possible deadlock in lock_trace C error 146 1612d 2069d 0/1 upstream: reported C repro on 2019/04/19 09:51
android-49 possible deadlock in lock_trace C 7424 1841d 2077d 0/3 public: reported C repro on 2019/04/12 00:00
upstream possible deadlock in lock_trace (2) fs 3 2041d 2071d 0/28 auto-closed as invalid on 2019/10/25 08:41
upstream possible deadlock in lock_trace fs C 1847 2093d 2574d 0/28 closed as dup on 2017/12/12 21:59
upstream possible deadlock in lock_trace (3) fs syz inconclusive done 69 1720d 1855d 15/28 fixed on 2020/08/18 22:40
android-44 possible deadlock in lock_trace C 41 1847d 2077d 0/2 public: reported C repro on 2019/04/11 08:44

Sample crash report:
random: cc1: uninitialized urandom read (8 bytes read)
audit: type=1400 audit(1539634773.910:9): avc:  denied  { map } for  pid=1787 comm="syz-execprog" path="/root/syzkaller-shm608069533" dev="sda1" ino=16482 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:file_t:s0 tclass=file permissive=1

======================================================
WARNING: possible circular locking dependency detected
4.14.76+ #19 Not tainted
------------------------------------------------------
syz-executor5/4863 is trying to acquire lock:
 (&sig->cred_guard_mutex){+.+.}, at: [<ffffffff8a6a320f>] lock_trace+0x3f/0xc0 fs/proc/base.c:408

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

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&p->lock){+.+.}:
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0xf5/0x1480 kernel/locking/mutex.c:893
       seq_read+0xd4/0x11d0 fs/seq_file.c:165
       proc_reg_read+0xef/0x170 fs/proc/inode.c:217
       do_loop_readv_writev fs/read_write.c:698 [inline]
       do_iter_read+0x3cc/0x580 fs/read_write.c:922
       vfs_readv+0xe6/0x150 fs/read_write.c:984
       kernel_readv fs/splice.c:361 [inline]
       default_file_splice_read+0x495/0x860 fs/splice.c:416
       do_splice_to+0x102/0x150 fs/splice.c:880
       do_splice fs/splice.c:1173 [inline]
       SYSC_splice fs/splice.c:1402 [inline]
       SyS_splice+0xf4d/0x12a0 fs/splice.c:1382
       do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
       entry_SYSCALL_64_after_hwframe+0x42/0xb7

-> #1 (&pipe->mutex/1){+.+.}:
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0xf5/0x1480 kernel/locking/mutex.c:893
       __pipe_lock fs/pipe.c:88 [inline]
       fifo_open+0x156/0x9d0 fs/pipe.c:921
       do_dentry_open+0x426/0xda0 fs/open.c:764
       vfs_open+0x11c/0x210 fs/open.c:878
       do_last fs/namei.c:3408 [inline]
       path_openat+0x4eb/0x23a0 fs/namei.c:3550
       do_filp_open+0x197/0x270 fs/namei.c:3584
       do_open_execat+0x10d/0x5b0 fs/exec.c:849
       do_execveat_common.isra.14+0x6cb/0x1d60 fs/exec.c:1740
       do_execve fs/exec.c:1847 [inline]
       SYSC_execve fs/exec.c:1928 [inline]
       SyS_execve+0x34/0x40 fs/exec.c:1923
       do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
       entry_SYSCALL_64_after_hwframe+0x42/0xb7

-> #0 (&sig->cred_guard_mutex){+.+.}:
       lock_acquire+0x10f/0x380 kernel/locking/lockdep.c:3991
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0xf5/0x1480 kernel/locking/mutex.c:893
       lock_trace+0x3f/0xc0 fs/proc/base.c:408
       proc_pid_syscall+0xa2/0x240 fs/proc/base.c:640
       proc_single_show+0xf1/0x160 fs/proc/base.c:762
       seq_read+0x4e0/0x11d0 fs/seq_file.c:237
       do_loop_readv_writev fs/read_write.c:698 [inline]
       do_iter_read+0x3cc/0x580 fs/read_write.c:922
       vfs_readv+0xe6/0x150 fs/read_write.c:984
       kernel_readv fs/splice.c:361 [inline]
       default_file_splice_read+0x495/0x860 fs/splice.c:416
       do_splice_to+0x102/0x150 fs/splice.c:880
       splice_direct_to_actor+0x21d/0x750 fs/splice.c:952
       do_splice_direct+0x17b/0x220 fs/splice.c:1061
       do_sendfile+0x4a1/0xb50 fs/read_write.c:1438
       SYSC_sendfile64 fs/read_write.c:1493 [inline]
       SyS_sendfile64+0xab/0x140 fs/read_write.c:1485
       do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
       entry_SYSCALL_64_after_hwframe+0x42/0xb7

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 syz-executor5/4863:
 #0:  (sb_writers#7){.+.+}, at: [<ffffffff8a559d55>] file_start_write include/linux/fs.h:2722 [inline]
 #0:  (sb_writers#7){.+.+}, at: [<ffffffff8a559d55>] do_sendfile+0x9b5/0xb50 fs/read_write.c:1437
 #1:  (&p->lock){+.+.}, at: [<ffffffff8a5d0bb4>] seq_read+0xd4/0x11d0 fs/seq_file.c:165

stack backtrace:
CPU: 1 PID: 4863 Comm: syz-executor5 Not tainted 4.14.76+ #19
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0xb9/0x11b lib/dump_stack.c:53
 print_circular_bug.isra.18.cold.43+0x2d3/0x40c kernel/locking/lockdep.c:1258
 check_prev_add kernel/locking/lockdep.c:1901 [inline]
 check_prevs_add kernel/locking/lockdep.c:2018 [inline]
 validate_chain kernel/locking/lockdep.c:2460 [inline]
 __lock_acquire+0x2ff9/0x4320 kernel/locking/lockdep.c:3487
 lock_acquire+0x10f/0x380 kernel/locking/lockdep.c:3991
 __mutex_lock_common kernel/locking/mutex.c:756 [inline]
 __mutex_lock+0xf5/0x1480 kernel/locking/mutex.c:893
 lock_trace+0x3f/0xc0 fs/proc/base.c:408
 proc_pid_syscall+0xa2/0x240 fs/proc/base.c:640
 proc_single_show+0xf1/0x160 fs/proc/base.c:762
 seq_read+0x4e0/0x11d0 fs/seq_file.c:237
 do_loop_readv_writev fs/read_write.c:698 [inline]
 do_iter_read+0x3cc/0x580 fs/read_write.c:922
 vfs_readv+0xe6/0x150 fs/read_write.c:984
 kernel_readv fs/splice.c:361 [inline]
 default_file_splice_read+0x495/0x860 fs/splice.c:416
 do_splice_to+0x102/0x150 fs/splice.c:880
 splice_direct_to_actor+0x21d/0x750 fs/splice.c:952
 do_splice_direct+0x17b/0x220 fs/splice.c:1061
 do_sendfile+0x4a1/0xb50 fs/read_write.c:1438
 SYSC_sendfile64 fs/read_write.c:1493 [inline]
 SyS_sendfile64+0xab/0x140 fs/read_write.c:1485
 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x457569
RSP: 002b:00007f78a3449c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000457569
RDX: 0000000020000240 RSI: 0000000000000007 RDI: 0000000000000006
RBP: 000000000072bfa0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000246 R12: 00007f78a344a6d4
R13: 00000000004c34d0 R14: 00000000004d5298 R15: 00000000ffffffff

Crashes (203):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/10/15 20:29 android-4.14 48091d94336e 8cd30605 .config console log report syz ci-android-414-kasan-gce-root
2018/09/23 08:05 android-4.14 666c420fa3ea 37079712 .config console log report syz ci-android-414-kasan-gce-root
2018/09/23 01:10 android-4.14 666c420fa3ea 37079712 .config console log report syz ci-android-414-kasan-gce-root
2019/04/03 07:29 android-4.14 140cda105bb8 dfd3394d .config console log report ci-android-414-kasan-gce-root
2019/04/02 23:22 android-4.14 140cda105bb8 dfd3394d .config console log report ci-android-414-kasan-gce-root
2019/04/02 20:39 android-4.14 140cda105bb8 dfd3394d .config console log report ci-android-414-kasan-gce-root
2019/03/27 09:39 android-4.14 db689dd813b7 55684ce1 .config console log report ci-android-414-kasan-gce-root
2019/03/26 11:54 android-4.14 02b246355459 55684ce1 .config console log report ci-android-414-kasan-gce-root
2019/03/26 03:31 android-4.14 02b246355459 55684ce1 .config console log report ci-android-414-kasan-gce-root
2019/03/24 18:45 android-4.14 4344de2f79ab acbc5b7d .config console log report ci-android-414-kasan-gce-root
2019/03/19 07:36 android-4.14 ea583d160621 46264c32 .config console log report ci-android-414-kasan-gce-root
2019/03/17 15:42 android-4.14 8ed9bc6e6401 ba18afea .config console log report ci-android-414-kasan-gce-root
2019/02/28 22:28 android-4.14 0cc8f104f45a 09aeeba4 .config console log report ci-android-414-kasan-gce-root
2019/02/24 00:56 android-4.14 6bdf39bb26fd 7a06e792 .config console log report ci-android-414-kasan-gce-root
2019/02/21 03:56 android-4.14 01709c953f89 c95f0707 .config console log report ci-android-414-kasan-gce-root
2019/02/20 23:37 android-4.14 01709c953f89 c95f0707 .config console log report ci-android-414-kasan-gce-root
2019/02/19 22:20 android-4.14 af9864a5122f 4df543c9 .config console log report ci-android-414-kasan-gce-root
2019/02/15 20:18 android-4.14 6142833f8318 f6f233c0 .config console log report ci-android-414-kasan-gce-root
2019/02/10 20:51 android-4.14 57de59b3cf53 b4f792e4 .config console log report ci-android-414-kasan-gce-root
2019/02/09 20:36 android-4.14 57de59b3cf53 d75f7686 .config console log report ci-android-414-kasan-gce-root
2019/02/01 15:21 android-4.14 63d1657d00e0 0c07abcf .config console log report ci-android-414-kasan-gce-root
2019/01/29 09:34 android-4.14 63d1657d00e0 aa432daf .config console log report ci-android-414-kasan-gce-root
2019/01/24 20:37 android-4.14 d34411de9b95 ce1ccf97 .config console log report ci-android-414-kasan-gce-root
2019/01/23 14:54 android-4.14 7af2b8dc5ab3 7cf3249c .config console log report ci-android-414-kasan-gce-root
2019/01/23 07:44 android-4.14 a4580ffc17d3 b1ff06b2 .config console log report ci-android-414-kasan-gce-root
2019/01/22 16:42 android-4.14 5a76363f1262 985f75cc .config console log report ci-android-414-kasan-gce-root
2019/01/22 15:30 android-4.14 5a76363f1262 985f75cc .config console log report ci-android-414-kasan-gce-root
2019/01/22 12:42 android-4.14 5a76363f1262 985f75cc .config console log report ci-android-414-kasan-gce-root
2019/01/22 04:57 android-4.14 5a76363f1262 badbbeee .config console log report ci-android-414-kasan-gce-root
2019/01/21 10:47 android-4.14 5a76363f1262 badbbeee .config console log report ci-android-414-kasan-gce-root
2019/01/21 00:30 android-4.14 5a76363f1262 fd37a550 .config console log report ci-android-414-kasan-gce-root
2019/01/20 22:39 android-4.14 5a76363f1262 fd37a550 .config console log report ci-android-414-kasan-gce-root
2019/01/20 19:39 android-4.14 5a76363f1262 fd37a550 .config console log report ci-android-414-kasan-gce-root
2019/01/20 11:20 android-4.14 5a76363f1262 353f32ea .config console log report ci-android-414-kasan-gce-root
2019/01/20 10:09 android-4.14 5a76363f1262 353f32ea .config console log report ci-android-414-kasan-gce-root
2019/01/20 07:35 android-4.14 5a76363f1262 353f32ea .config console log report ci-android-414-kasan-gce-root
2019/01/20 05:15 android-4.14 5a76363f1262 353f32ea .config console log report ci-android-414-kasan-gce-root
2019/01/17 19:53 android-4.14 42506d99b820 769e75ed .config console log report ci-android-414-kasan-gce-root
2019/01/11 06:16 android-4.14 fab7352ca8d1 80dde172 .config console log report ci-android-414-kasan-gce-root
2019/01/06 09:47 android-4.14 3c207c880674 53be0a37 .config console log report ci-android-414-kasan-gce-root
2019/01/05 21:17 android-4.14 3c207c880674 53be0a37 .config console log report ci-android-414-kasan-gce-root
2019/01/04 03:17 android-4.14 3c207c880674 7da23925 .config console log report ci-android-414-kasan-gce-root
2019/01/01 09:40 android-4.14 7d2d5fc1acda 3d85f48c .config console log report ci-android-414-kasan-gce-root
2018/12/30 07:31 android-4.14 7d2d5fc1acda 35e3f847 .config console log report ci-android-414-kasan-gce-root
2018/12/30 02:59 android-4.14 7d2d5fc1acda 35e3f847 .config console log report ci-android-414-kasan-gce-root
2018/12/29 22:53 android-4.14 7d2d5fc1acda 35e3f847 .config console log report ci-android-414-kasan-gce-root
2018/09/09 08:57 android-4.14 b859aa7d7a0c 6b5120a4 .config console log report ci-android-414-kasan-gce-root
* Struck through repros no longer work on HEAD.