syzbot


possible deadlock in lock_trace

Status: upstream: reported C repro on 2019/04/19 09:51
Reported-by: syzbot+15de275074ca85b268c7@syzkaller.appspotmail.com
First crash: 1258d, last: 801d

Fix bisection: failed (bisect log)
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 743d 1249d 0/1 upstream: reported syz repro on 2019/04/28 18:16
android-49 possible deadlock in lock_trace C 7424 1030d 1266d 0/3 public: reported C repro on 2019/04/12 00:00
upstream possible deadlock in lock_trace (2) 3 1230d 1260d 0/24 auto-closed as invalid on 2019/10/25 08:41
upstream possible deadlock in lock_trace C 1847 1282d 1763d 0/24 closed as dup on 2017/12/12 21:59
upstream possible deadlock in lock_trace (3) syz inconclusive done 69 909d 1044d 17/24 fixed on 2020/08/18 22:40
android-414 possible deadlock in lock_trace syz 203 1274d 1266d 0/1 public: reported syz repro on 2019/04/12 00:01
android-44 possible deadlock in lock_trace C 41 1036d 1266d 0/2 public: reported C repro on 2019/04/11 08:44
Patch testing requests:
Created Duration User Patch Repo Result
2022/09/09 10:27 11m linux-4.14.y report log
2022/09/09 09:27 8m linux-4.14.y report log

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
4.14.175-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor993/6341 is trying to acquire lock:
 (&sig->cred_guard_mutex){+.+.}, at: [<ffffffff81a45d4f>] lock_trace+0x3f/0xc0 fs/proc/base.c:407

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

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&p->lock){+.+.}:
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0xe8/0x1470 kernel/locking/mutex.c:893
       seq_read+0xba/0x1160 fs/seq_file.c:165
       do_loop_readv_writev fs/read_write.c:695 [inline]
       do_loop_readv_writev fs/read_write.c:682 [inline]
       do_iter_read+0x3e3/0x5a0 fs/read_write.c:919
       vfs_readv+0xd3/0x130 fs/read_write.c:981
       kernel_readv fs/splice.c:361 [inline]
       default_file_splice_read+0x41d/0x870 fs/splice.c:416
       do_splice_to+0xfb/0x150 fs/splice.c:880
       splice_direct_to_actor+0x20a/0x730 fs/splice.c:952
       do_splice_direct+0x164/0x210 fs/splice.c:1061
       do_sendfile+0x469/0xaf0 fs/read_write.c:1441
       SYSC_sendfile64 fs/read_write.c:1502 [inline]
       SyS_sendfile64+0xff/0x110 fs/read_write.c:1488
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x42/0xb7

-> #2 (sb_writers#3){.+.+}:
       percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline]
       percpu_down_read include/linux/percpu-rwsem.h:59 [inline]
       __sb_start_write+0x1a1/0x2e0 fs/super.c:1363
       sb_start_write include/linux/fs.h:1549 [inline]
       mnt_want_write+0x3a/0xb0 fs/namespace.c:386
       ovl_create_object+0x75/0x1d0 fs/overlayfs/dir.c:538
       lookup_open+0x10e8/0x1750 fs/namei.c:3241
       do_last fs/namei.c:3334 [inline]
       path_openat+0xfc1/0x3c50 fs/namei.c:3569
       do_filp_open+0x18e/0x250 fs/namei.c:3603
       do_sys_open+0x29d/0x3f0 fs/open.c:1081
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x42/0xb7

-> #1 (&ovl_i_mutex_dir_key[depth]){++++}:
       down_read+0x37/0xa0 kernel/locking/rwsem.c:24
       inode_lock_shared include/linux/fs.h:729 [inline]
       do_last fs/namei.c:3333 [inline]
       path_openat+0x185a/0x3c50 fs/namei.c:3569
       do_filp_open+0x18e/0x250 fs/namei.c:3603
       do_open_execat+0xda/0x430 fs/exec.c:849
       do_execveat_common.isra.0+0x694/0x1c70 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+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x42/0xb7

-> #0 (&sig->cred_guard_mutex){+.+.}:
       lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3994
       __mutex_lock_common kernel/locking/mutex.c:756 [inline]
       __mutex_lock+0xe8/0x1470 kernel/locking/mutex.c:893
       lock_trace+0x3f/0xc0 fs/proc/base.c:407
       proc_pid_syscall+0x81/0x1f0 fs/proc/base.c:639
       proc_single_show+0xe7/0x150 fs/proc/base.c:761
       seq_read+0x4d2/0x1160 fs/seq_file.c:237
       do_loop_readv_writev fs/read_write.c:695 [inline]
       do_loop_readv_writev fs/read_write.c:682 [inline]
       do_iter_read+0x3e3/0x5a0 fs/read_write.c:919
       vfs_readv+0xd3/0x130 fs/read_write.c:981
       kernel_readv fs/splice.c:361 [inline]
       default_file_splice_read+0x41d/0x870 fs/splice.c:416
       do_splice_to+0xfb/0x150 fs/splice.c:880
       splice_direct_to_actor+0x20a/0x730 fs/splice.c:952
       do_splice_direct+0x164/0x210 fs/splice.c:1061
       do_sendfile+0x469/0xaf0 fs/read_write.c:1441
       SYSC_sendfile64 fs/read_write.c:1502 [inline]
       SyS_sendfile64+0xff/0x110 fs/read_write.c:1488
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x42/0xb7

other info that might help us debug this:

Chain exists of:
  &sig->cred_guard_mutex --> sb_writers#3 --> &p->lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&p->lock);
                               lock(sb_writers#3);
                               lock(&p->lock);
  lock(&sig->cred_guard_mutex);

 *** DEADLOCK ***

2 locks held by syz-executor993/6341:
 #0:  (sb_writers#3){.+.+}, at: [<ffffffff818b2945>] file_start_write include/linux/fs.h:2708 [inline]
 #0:  (sb_writers#3){.+.+}, at: [<ffffffff818b2945>] do_sendfile+0x865/0xaf0 fs/read_write.c:1440
 #1:  (&p->lock){+.+.}, at: [<ffffffff8192f06a>] seq_read+0xba/0x1160 fs/seq_file.c:165

stack backtrace:
CPU: 0 PID: 6341 Comm: syz-executor993 Not tainted 4.14.175-syzkaller #0
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+0x13e/0x194 lib/dump_stack.c:58
 print_circular_bug.isra.0.cold+0x1c4/0x282 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+0x2cb3/0x4620 kernel/locking/lockdep.c:3487
 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3994
 __mutex_lock_common kernel/locking/mutex.c:756 [inline]
 __mutex_lock+0xe8/0x1470 kernel/locking/mutex.c:893
 lock_trace+0x3f/0xc0 fs/proc/base.c:407
 proc_pid_syscall+0x81/0x1f0 fs/proc/base.c:639
 proc_single_show+0xe7/0x150 fs/proc/base.c:761
 seq_read+0x4d2/0x1160 fs/seq_file.c:237
 do_loop_readv_writev fs/read_write.c:695 [inline]
 do_loop_readv_writev fs/read_write.c:682 [inline]
 do_iter_read+0x3e3/0x5a0 fs/read_write.c:919
 vfs_readv+0xd3/0x130 fs/read_write.c:981
 kernel_readv fs/splice.c:361 [inline]
 default_file_splice_read+0x41d/0x870 fs/splice.c:416
 do_splice_to+0xfb/0x150 fs/splice.c:880
 splice_direct_to_actor+0x20a/0x730 fs/splice.c:952
 do_splice_direct+0x164/0x210 fs/splice.c:1061
 do_sendfile+0x469/0xaf0 fs/read_write.c:1441
 SYSC_sendfile64 fs/read_write.c:1502 [inline]
 SyS_sendfile64+0xff/0x110 fs/read_write.c:1488
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x440389
RSP: 002b:00007fffe

Crashes (146):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-14 2020/04/04 09:35 linux-4.14.y 4520f06b03ae ef26b610 .config log report syz C
ci2-linux-4-14 2020/01/22 13:25 linux-4.14.y c1141b3aab36 8eda0b95 .config log report syz C
ci2-linux-4-14 2020/07/19 21:29 linux-4.14.y b850307b279c 9c812472 .config log report
ci2-linux-4-14 2020/07/14 09:14 linux-4.14.y b850307b279c ce4c95b3 .config log report
ci2-linux-4-14 2020/06/25 01:57 linux-4.14.y b850307b279c 9d60b18e .config log report
ci2-linux-4-14 2020/06/14 09:07 linux-4.14.y b850307b279c a61674a5 .config log report
ci2-linux-4-14 2020/06/09 11:51 linux-4.14.y c6db52a88798 0d60b78a .config log report
ci2-linux-4-14 2020/06/07 05:31 linux-4.14.y c6db52a88798 e6b89e4e .config log report
ci2-linux-4-14 2020/06/01 21:10 linux-4.14.y 4f68020fef1c a0331e89 .config log report
ci2-linux-4-14 2020/05/26 10:04 linux-4.14.y a41ba30d9df2 8ca3b7d2 .config log report
ci2-linux-4-14 2020/05/22 16:44 linux-4.14.y a41ba30d9df2 4afdfa20 .config log report
ci2-linux-4-14 2020/05/21 01:00 linux-4.14.y a41ba30d9df2 4afdfa20 .config log report
ci2-linux-4-14 2020/05/07 05:06 linux-4.14.y d71f695ce745 4618eb2d .config log report
ci2-linux-4-14 2020/05/02 09:50 linux-4.14.y 050272a0423e bc734e7a .config log report
ci2-linux-4-14 2020/04/25 06:04 linux-4.14.y 050272a0423e 03d97a1b .config log report
ci2-linux-4-14 2020/04/24 18:37 linux-4.14.y 050272a0423e 03d97a1b .config log report
ci2-linux-4-14 2020/04/18 13:11 linux-4.14.y c10b57a567e4 435c6d53 .config log report
ci2-linux-4-14 2020/04/17 07:39 linux-4.14.y c10b57a567e4 18397578 .config log report
ci2-linux-4-14 2020/04/16 22:21 linux-4.14.y c10b57a567e4 c743fcb3 .config log report
ci2-linux-4-14 2020/04/16 07:27 linux-4.14.y c10b57a567e4 c743fcb3 .config log report
ci2-linux-4-14 2020/04/15 17:57 linux-4.14.y c10b57a567e4 3f3c5574 .config log report
ci2-linux-4-14 2020/04/13 12:28 linux-4.14.y c10b57a567e4 17a986e5 .config log report
ci2-linux-4-14 2020/04/12 07:51 linux-4.14.y 4520f06b03ae a8c6a3f8 .config log report
ci2-linux-4-14 2020/04/12 03:38 linux-4.14.y 4520f06b03ae a8c6a3f8 .config log report
ci2-linux-4-14 2020/04/10 18:10 linux-4.14.y 4520f06b03ae a8c6a3f8 .config log report
ci2-linux-4-14 2020/04/08 22:52 linux-4.14.y 4520f06b03ae db9bcd4b .config log report
ci2-linux-4-14 2020/04/03 04:04 linux-4.14.y 4520f06b03ae a34e2c33 .config log report
ci2-linux-4-14 2020/04/02 12:54 linux-4.14.y 01364dad1d45 a34e2c33 .config log report
ci2-linux-4-14 2020/04/01 23:43 linux-4.14.y 01364dad1d45 a34e2c33 .config log report
ci2-linux-4-14 2020/04/01 22:23 linux-4.14.y 01364dad1d45 a34e2c33 .config log report
ci2-linux-4-14 2020/04/01 18:10 linux-4.14.y 01364dad1d45 a34e2c33 .config log report
ci2-linux-4-14 2020/04/01 00:43 linux-4.14.y 01364dad1d45 a34e2c33 .config log report
ci2-linux-4-14 2020/03/30 23:13 linux-4.14.y 01364dad1d45 c8d1cc20 .config log report
ci2-linux-4-14 2020/03/30 10:52 linux-4.14.y 01364dad1d45 c8d1cc20 .config log report
ci2-linux-4-14 2020/03/30 09:52 linux-4.14.y 01364dad1d45 c8d1cc20 .config log report
ci2-linux-4-14 2020/03/30 06:01 linux-4.14.y 01364dad1d45 05736b29 .config log report
ci2-linux-4-14 2020/03/30 04:50 linux-4.14.y 01364dad1d45 05736b29 .config log report
ci2-linux-4-14 2020/03/30 02:40 linux-4.14.y 01364dad1d45 05736b29 .config log report
ci2-linux-4-14 2020/03/28 00:48 linux-4.14.y 01364dad1d45 831e9a81 .config log report
ci2-linux-4-14 2020/03/26 00:43 linux-4.14.y 01364dad1d45 e8e6c7d2 .config log report
ci2-linux-4-14 2020/03/22 21:10 linux-4.14.y 01364dad1d45 78267cec .config log report
ci2-linux-4-14 2020/03/22 19:48 linux-4.14.y 01364dad1d45 78267cec .config log report
ci2-linux-4-14 2020/03/17 14:45 linux-4.14.y 12cd844a39ed 749688d2 .config log report
ci2-linux-4-14 2020/03/16 21:31 linux-4.14.y 12cd844a39ed 749688d2 .config log report
ci2-linux-4-14 2020/03/13 08:11 linux-4.14.y 12cd844a39ed fd69032d .config log report
ci2-linux-4-14 2020/03/13 03:31 linux-4.14.y 12cd844a39ed d850e9d0 .config log report
ci2-linux-4-14 2020/03/11 11:14 linux-4.14.y 78d697fc93f9 e103bc9e .config log report
ci2-linux-4-14 2020/03/11 09:53 linux-4.14.y 78d697fc93f9 35f53e45 .config log report
ci2-linux-4-14 2019/04/19 08:50 linux-4.14.y 58b454ebf81e b0e8efcb .config log report
* Struck through repros no longer work on HEAD.