syzbot


possible deadlock in seq_read

Status: public: reported C repro on 2019/04/12 00:00
Reported-by: syzbot+8cb007c5997af8c27781@syzkaller.appspotmail.com
Fix commit: 7d7637dafc59 fs/open.c: allow opening only regular files during execve()
Patched on: [ci-android-49-kasan-gce-root], missing on: [ci-android-49-kasan-gce ci-android-49-kasan-gce-386]
First crash: 2338d, last: 1601d
Similar bugs (7)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 possible deadlock in seq_read (2) 1 718d 718d 0/1 auto-obsoleted due to no activity on 2022/09/01 16:45
linux-4.14 possible deadlock in seq_read 144 1085d 1759d 0/1 auto-closed as invalid on 2021/08/31 02:48
android-44 possible deadlock in seq_read C 632 1601d 1838d 0/2 public: reported C repro on 2019/04/11 08:44
linux-4.19 possible deadlock in seq_read C error 290 451d 1721d 0/1 upstream: reported C repro on 2019/08/05 16:40
upstream possible deadlock in seq_read (2) overlayfs C done error 95 1298d 1834d 0/26 auto-obsoleted due to no activity on 2022/09/24 20:28
upstream possible deadlock in seq_read fs C 19074 1844d 2334d 12/26 fixed on 2019/04/12 08:05
android-414 possible deadlock in seq_read C 1737 1691d 1838d 0/1 public: reported C repro on 2019/04/11 00:00

Sample crash report:
======================================================
[ INFO: possible circular locking dependency detected ]
4.9.141+ #1 Not tainted
-------------------------------------------------------
syz-executor246/2065 is trying to acquire lock:
 (&p->lock){+.+.+.}, at: [<ffffffff8158080d>] seq_read+0xdd/0x12d0 fs/seq_file.c:178
but task is already holding lock:
 (&pipe->mutex/1){+.+.+.}, at: [<ffffffff81523c1e>] pipe_lock_nested fs/pipe.c:66 [inline]
 (&pipe->mutex/1){+.+.+.}, at: [<ffffffff81523c1e>] pipe_lock+0x5e/0x70 fs/pipe.c:74
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/0x900 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.14+0x687/0x1ed0 fs/exec.c:1723
       do_execve fs/exec.c:1829 [inline]
       SYSC_execve fs/exec.c:1910 [inline]
       SyS_execve+0x42/0x50 fs/exec.c:1905
       do_syscall_64+0x19f/0x550 arch/x86/entry/common.c:285
       entry_SYSCALL_64_after_swapgs+0x5d/0xdb

       lock_acquire+0x130/0x3e0 kernel/locking/lockdep.c:3756
       __mutex_lock_common kernel/locking/mutex.c:521 [inline]
       mutex_lock_killable_nested+0xcc/0x9f0 kernel/locking/mutex.c:641
       lock_trace+0x44/0xc0 fs/proc/base.c:431
       proc_pid_syscall+0xa9/0x260 fs/proc/base.c:663
       proc_single_show+0xfd/0x170 fs/proc/base.c:785
       seq_read+0x4b6/0x12d0 fs/seq_file.c:240
       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+0x451/0x7f0 fs/splice.c:435
       do_splice_to+0x10c/0x170 fs/splice.c:899
       splice_direct_to_actor+0x23f/0x7e0 fs/splice.c:971
       do_splice_direct+0x1a3/0x270 fs/splice.c:1080
       do_sendfile+0x4f0/0xc30 fs/read_write.c:1393
       SYSC_sendfile64 fs/read_write.c:1454 [inline]
       SyS_sendfile64+0x144/0x160 fs/read_write.c:1440
       do_syscall_64+0x19f/0x550 arch/x86/entry/common.c:285
       entry_SYSCALL_64_after_swapgs+0x5d/0xdb

       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_nested+0xc0/0x900 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+0x451/0x7f0 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_64+0x19f/0x550 arch/x86/entry/common.c:285
       entry_SYSCALL_64_after_swapgs+0x5d/0xdb

other info that might help us debug this:

Chain exists of:
 Possible unsafe locking scenario:

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

 *** DEADLOCK ***

1 lock held by syz-executor246/2065:
 #0:  (&pipe->mutex/1){+.+.+.}, at: [<ffffffff81523c1e>] pipe_lock_nested fs/pipe.c:66 [inline]
 #0:  (&pipe->mutex/1){+.+.+.}, at: [<ffffffff81523c1e>] pipe_lock+0x5e/0x70 fs/pipe.c:74

stack backtrace:
CPU: 1 PID: 2065 Comm: syz-executor246 Not tainted 4.9.141+ #1
 ffff8801ce997278 ffffffff81b42e79 ffffffff83ca2c70 ffffffff83ca9f30
 ffffffff83ca4920 ffff8801d27c5010 ffff8801d27c4740 ffff8801ce9972c0
 ffffffff813fee40 0000000000000001 00000000d27c4ff0 0000000000000001
Call Trace:
 [<ffffffff81b42e79>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81b42e79>] dump_stack+0xc1/0x128 lib/dump_stack.c:51
 [<ffffffff813fee40>] print_circular_bug.cold.36+0x2f7/0x432 kernel/locking/lockdep.c:1202
 [<ffffffff8120a539>] check_prev_add kernel/locking/lockdep.c:1828 [inline]
 [<ffffffff8120a539>] check_prevs_add kernel/locking/lockdep.c:1938 [inline]
 [<ffffffff8120a539>] validate_chain kernel/locking/lockdep.c:2265 [inline]
 [<ffffffff8120a539>] __lock_acquire+0x3189/0x4a10 kernel/locking/lockdep.c:3345
 [<ffffffff8120c8d0>] lock_acquire+0x130/0x3e0 kernel/locking/lockdep.c:3756
 [<ffffffff8280b250>] __mutex_lock_common kernel/locking/mutex.c:521 [inline]
 [<ffffffff8280b250>] mutex_lock_nested+0xc0/0x900 kernel/locking/mutex.c:621
 [<ffffffff8158080d>] seq_read+0xdd/0x12d0 fs/seq_file.c:178
 [<ffffffff8165c00d>] proc_reg_read+0xfd/0x180 fs/proc/inode.c:203
 [<ffffffff81509df5>] do_loop_readv_writev.part.1+0xd5/0x280 fs/read_write.c:718
 [<ffffffff8150b49e>] do_loop_readv_writev fs/read_write.c:707 [inline]
 [<ffffffff8150b49e>] do_readv_writev+0x56e/0x7b0 fs/read_write.c:873
 [<ffffffff8150b764>] vfs_readv+0x84/0xc0 fs/read_write.c:897
 [<ffffffff815ac2a1>] kernel_readv fs/splice.c:363 [inline]
 [<ffffffff815ac2a1>] default_file_splice_read+0x451/0x7f0 fs/splice.c:435
 [<ffffffff815ab39c>] do_splice_to+0x10c/0x170 fs/splice.c:899
 [<ffffffff815b08f2>] do_splice fs/splice.c:1192 [inline]
 [<ffffffff815b08f2>] SYSC_splice fs/splice.c:1416 [inline]
 [<ffffffff815b08f2>] SyS_splice+0x10d2/0x14d0 fs/splice.c:1399
 [<ffffffff810056ef>] do_syscall_64+0x19f/0x550 arch/x86/entry/common.c:285
 [<ffffffff82817893>] entry_SYSCALL_64_after_swapgs+0x5d/0xdb

Crashes (56124):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/03/26 03:25 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 55684ce1 .config console log report syz C ci-android-49-kasan-gce
2019/03/26 03:24 https://android.googlesource.com/kernel/common android-4.9 de12cfe6e937 55684ce1 .config console log report syz C ci-android-49-kasan-gce-root
2018/12/11 22:53 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 7795ae03 .config console log report syz C ci-android-49-kasan-gce
2018/11/28 02:11 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 4b6d14f2 .config console log report syz C ci-android-49-kasan-gce-root
2018/09/24 08:05 https://android.googlesource.com/kernel/common android-4.9 1c57ba4f543b 28d9ac76 .config console log report syz C ci-android-49-kasan-gce-root
2018/09/24 03:55 https://android.googlesource.com/kernel/common android-4.9 1c57ba4f543b 28d9ac76 .config console log report syz C ci-android-49-kasan-gce
2018/09/23 03:17 https://android.googlesource.com/kernel/common android-4.9 1c57ba4f543b 37079712 .config console log report syz C ci-android-49-kasan-gce-root
2018/09/23 03:10 https://android.googlesource.com/kernel/common android-4.9 1c57ba4f543b 37079712 .config console log report syz C ci-android-49-kasan-gce
2017/12/25 07:20 https://android.googlesource.com/kernel/common android-4.9 250637879165 73aba437 .config console log report syz C ci-android-49-kasan-gce
2017/12/24 14:57 https://android.googlesource.com/kernel/common android-4.9 250637879165 73aba437 .config console log report syz C ci-android-49-kasan-gce-386
2017/12/18 15:25 https://android.googlesource.com/kernel/common android-4.9 9542d2a0126e 1c4160ef .config console log report syz C ci-android-49-kasan-gce
2017/12/17 17:52 https://android.googlesource.com/kernel/common android-4.9 3f1d77ca5f8f d5beb42a .config console log report syz C ci-android-49-kasan-gce
2017/12/17 16:39 https://android.googlesource.com/kernel/common android-4.9 3f1d77ca5f8f d5beb42a .config console log report syz C ci-android-49-kasan-gce-386
2019/03/26 03:24 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 55684ce1 .config console log report syz C ci-android-49-kasan-gce-386
2018/09/24 03:54 https://android.googlesource.com/kernel/common android-4.9 1c57ba4f543b 28d9ac76 .config console log report syz C ci-android-49-kasan-gce-386
2018/09/23 02:53 https://android.googlesource.com/kernel/common android-4.9 1c57ba4f543b 37079712 .config console log report syz C ci-android-49-kasan-gce-386
2018/12/11 20:24 https://android.googlesource.com/kernel/common android-4.9 605e2ec6d679 7795ae03 .config console log report syz ci-android-49-kasan-gce-root
2018/09/22 22:26 https://android.googlesource.com/kernel/common android-4.9 1c57ba4f543b 37079712 .config console log report syz ci-android-49-kasan-gce
2019/12/04 06:00 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 ae13a849 .config console log report ci-android-49-kasan-gce
2019/12/04 04:37 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 ae13a849 .config console log report ci-android-49-kasan-gce
2019/12/04 00:18 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 ae13a849 .config console log report ci-android-49-kasan-gce
2019/12/03 22:11 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 ae13a849 .config console log report ci-android-49-kasan-gce
2019/12/03 20:50 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 ae13a849 .config console log report ci-android-49-kasan-gce
2019/12/03 15:58 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 ab342da3 .config console log report ci-android-49-kasan-gce
2019/12/03 11:18 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 ab342da3 .config console log report ci-android-49-kasan-gce
2019/12/03 08:47 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 ab342da3 .config console log report ci-android-49-kasan-gce
2019/12/03 02:13 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 ab342da3 .config console log report ci-android-49-kasan-gce
2019/12/02 19:08 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 f879db37 .config console log report ci-android-49-kasan-gce
2019/12/02 18:05 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 f879db37 .config console log report ci-android-49-kasan-gce
2019/12/02 13:59 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 f879db37 .config console log report ci-android-49-kasan-gce
2019/12/02 13:12 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 f879db37 .config console log report ci-android-49-kasan-gce
2019/12/02 11:29 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 f879db37 .config console log report ci-android-49-kasan-gce
2019/12/02 07:50 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 f879db37 .config console log report ci-android-49-kasan-gce
2019/12/01 22:26 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 a76bf83f .config console log report ci-android-49-kasan-gce
2019/12/01 16:29 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 a76bf83f .config console log report ci-android-49-kasan-gce
2019/12/01 14:50 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 a76bf83f .config console log report ci-android-49-kasan-gce
2019/12/01 10:34 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 a76bf83f .config console log report ci-android-49-kasan-gce
2019/11/30 19:07 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 3a75be00 .config console log report ci-android-49-kasan-gce
2019/11/30 14:48 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 3a75be00 .config console log report ci-android-49-kasan-gce
2019/11/30 13:30 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 3a75be00 .config console log report ci-android-49-kasan-gce
2019/11/30 12:21 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 3a75be00 .config console log report ci-android-49-kasan-gce
2019/11/30 11:04 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 3a75be00 .config console log report ci-android-49-kasan-gce
2019/11/30 07:23 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 3a75be00 .config console log report ci-android-49-kasan-gce
2019/11/29 20:56 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 d29b9e84 .config console log report ci-android-49-kasan-gce
2019/11/29 16:52 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 d29b9e84 .config console log report ci-android-49-kasan-gce
2019/11/29 14:52 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 d29b9e84 .config console log report ci-android-49-kasan-gce
2019/11/29 08:51 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 76357d6f .config console log report ci-android-49-kasan-gce
2019/11/29 02:55 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 76357d6f .config console log report ci-android-49-kasan-gce
2019/11/28 22:44 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 46869e3e .config console log report ci-android-49-kasan-gce
2019/08/03 16:17 https://android.googlesource.com/kernel/common android-4.9 c9370c26c20c 6affd8e8 .config console log report ci-android-49-kasan-gce-root
2019/12/03 07:04 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 ab342da3 .config console log report ci-android-49-kasan-gce-386
2019/12/02 10:19 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 f879db37 .config console log report ci-android-49-kasan-gce-386
2019/12/01 17:54 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 a76bf83f .config console log report ci-android-49-kasan-gce-386
2019/12/01 09:27 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 a76bf83f .config console log report ci-android-49-kasan-gce-386
2019/12/01 06:22 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 a76bf83f .config console log report ci-android-49-kasan-gce-386
2019/12/01 03:25 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 a76bf83f .config console log report ci-android-49-kasan-gce-386
2019/11/30 23:43 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 a76bf83f .config console log report ci-android-49-kasan-gce-386
2019/11/30 17:14 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 3a75be00 .config console log report ci-android-49-kasan-gce-386
2019/11/30 15:49 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 3a75be00 .config console log report ci-android-49-kasan-gce-386
2019/11/29 19:01 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 d29b9e84 .config console log report ci-android-49-kasan-gce-386
2019/11/29 16:54 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 d29b9e84 .config console log report ci-android-49-kasan-gce-386
2019/11/29 09:57 https://android.googlesource.com/kernel/common android-4.9 8fe428403e30 76357d6f .config console log report ci-android-49-kasan-gce-386
* Struck through repros no longer work on HEAD.