syzbot


possible deadlock in fifo_open

Status: public: reported C repro on 2019/04/12 00:00
Reported-by: syzbot+bb7d9c372e85f8619e2f@syzkaller.appspotmail.com
First crash: 2521d, last: 1814d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-414 possible deadlock in fifo_open C 586 2060d 2051d 0/1 public: reported C repro on 2019/04/11 00:00
upstream possible deadlock in fifo_open fs C 2097 2067d 2547d 0/28 closed as dup on 2017/12/12 21:25

Sample crash report:
======================================================
[ INFO: possible circular locking dependency detected ]
4.4.174+ #4 Not tainted
-------------------------------------------------------
syz-executor355/2082 is trying to acquire lock:
 (&pipe->mutex/1){+.+.+.}, at: [<ffffffff814b28fd>] __pipe_lock fs/pipe.c:86 [inline]
 (&pipe->mutex/1){+.+.+.}, at: [<ffffffff814b28fd>] fifo_open+0x15d/0xa00 fs/pipe.c:896

but task is already holding lock:
 (&sig->cred_guard_mutex){+.+.+.}, at: [<ffffffff814acb45>] prepare_bprm_creds+0x55/0x120 fs/exec.c:1225

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

       [<ffffffff81205f6e>] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592
       [<ffffffff8270e5a2>] __mutex_lock_common kernel/locking/mutex.c:521 [inline]
       [<ffffffff8270e5a2>] mutex_lock_interruptible_nested+0xd2/0xce0 kernel/locking/mutex.c:650
       [<ffffffff815e7f78>] proc_pid_attr_write+0x1a8/0x2a0 fs/proc/base.c:2524
       [<ffffffff81496916>] __vfs_write+0x116/0x3d0 fs/read_write.c:491
       [<ffffffff81496ce2>] __kernel_write+0x112/0x370 fs/read_write.c:513
       [<ffffffff81532e6d>] write_pipe_buf+0x15d/0x1f0 fs/splice.c:1074
       [<ffffffff81533b6e>] splice_from_pipe_feed fs/splice.c:776 [inline]
       [<ffffffff81533b6e>] __splice_from_pipe+0x37e/0x7a0 fs/splice.c:901
       [<ffffffff81536be8>] splice_from_pipe+0x108/0x170 fs/splice.c:936
       [<ffffffff81536cdc>] default_file_splice_write+0x3c/0x80 fs/splice.c:1086
       [<ffffffff81537d31>] do_splice_from fs/splice.c:1128 [inline]
       [<ffffffff81537d31>] do_splice fs/splice.c:1404 [inline]
       [<ffffffff81537d31>] SYSC_splice fs/splice.c:1707 [inline]
       [<ffffffff81537d31>] SyS_splice+0xd71/0x13a0 fs/splice.c:1690
       [<ffffffff82718ba1>] entry_SYSCALL_64_fastpath+0x1e/0x9a

       [<ffffffff81202d86>] check_prev_add kernel/locking/lockdep.c:1853 [inline]
       [<ffffffff81202d86>] check_prevs_add kernel/locking/lockdep.c:1958 [inline]
       [<ffffffff81202d86>] validate_chain kernel/locking/lockdep.c:2144 [inline]
       [<ffffffff81202d86>] __lock_acquire+0x37d6/0x4f50 kernel/locking/lockdep.c:3213
       [<ffffffff81205f6e>] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592
       [<ffffffff8270c191>] __mutex_lock_common kernel/locking/mutex.c:521 [inline]
       [<ffffffff8270c191>] mutex_lock_nested+0xc1/0xb80 kernel/locking/mutex.c:621
       [<ffffffff814b28fd>] __pipe_lock fs/pipe.c:86 [inline]
       [<ffffffff814b28fd>] fifo_open+0x15d/0xa00 fs/pipe.c:896
       [<ffffffff8149154f>] do_dentry_open+0x38f/0xbd0 fs/open.c:749
       [<ffffffff81494d3b>] vfs_open+0x10b/0x210 fs/open.c:862
       [<ffffffff814c5ddf>] do_last fs/namei.c:3269 [inline]
       [<ffffffff814c5ddf>] path_openat+0x136f/0x4470 fs/namei.c:3406
       [<ffffffff814ccab1>] do_filp_open+0x1a1/0x270 fs/namei.c:3440
       [<ffffffff814a7c8c>] do_open_execat+0x10c/0x6e0 fs/exec.c:805
       [<ffffffff814ad306>] do_execveat_common.isra.0+0x6f6/0x1e90 fs/exec.c:1577
       [<ffffffff814af422>] do_execve fs/exec.c:1683 [inline]
       [<ffffffff814af422>] SYSC_execve fs/exec.c:1764 [inline]
       [<ffffffff814af422>] SyS_execve+0x42/0x50 fs/exec.c:1759
       [<ffffffff82718ef5>] return_from_execve+0x0/0x23

other info that might help us debug this:

 Possible unsafe locking scenario:

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

 *** DEADLOCK ***

1 lock held by syz-executor355/2082:
 #0:  (&sig->cred_guard_mutex){+.+.+.}, at: [<ffffffff814acb45>] prepare_bprm_creds+0x55/0x120 fs/exec.c:1225

stack backtrace:
CPU: 1 PID: 2082 Comm: syz-executor355 Not tainted 4.4.174+ #4
 0000000000000000 1e864f5760f95112 ffff8801d5937530 ffffffff81aad1a1
 ffffffff84057a80 ffff8801d5134740 ffffffff83abd2b0 ffffffff83ab6860
 ffffffff83abd2b0 ffff8801d5937580 ffffffff813abcda ffff8801d5937660
Call Trace:
 [<ffffffff81aad1a1>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81aad1a1>] dump_stack+0xc1/0x120 lib/dump_stack.c:51
 [<ffffffff813abcda>] print_circular_bug.cold+0x2f7/0x44e kernel/locking/lockdep.c:1226
 [<ffffffff81202d86>] check_prev_add kernel/locking/lockdep.c:1853 [inline]
 [<ffffffff81202d86>] check_prevs_add kernel/locking/lockdep.c:1958 [inline]
 [<ffffffff81202d86>] validate_chain kernel/locking/lockdep.c:2144 [inline]
 [<ffffffff81202d86>] __lock_acquire+0x37d6/0x4f50 kernel/locking/lockdep.c:3213
 [<ffffffff81205f6e>] lock_acquire+0x15e/0x450 kernel/locking/lockdep.c:3592
 [<ffffffff8270c191>] __mutex_lock_common kernel/locking/mutex.c:521 [inline]
 [<ffffffff8270c191>] mutex_lock_nested+0xc1/0xb80 kernel/locking/mutex.c:621
 [<ffffffff814b28fd>] __pipe_lock fs/pipe.c:86 [inline]
 [<ffffffff814b28fd>] fifo_open+0x15d/0xa00 fs/pipe.c:896
 [<ffffffff8149154f>] do_dentry_open+0x38f/0xbd0 fs/open.c:749
 [<ffffffff81494d3b>] vfs_open+0x10b/0x210 fs/open.c:862
 [<ffffffff814c5ddf>] do_last fs/namei.c:3269 [inline]
 [<ffffffff814c5ddf>] path_openat+0x136f/0x4470 fs/namei.c:3406
 [<ffffffff814ccab1>] do_filp_open+0x1a1/0x270 fs/namei.c:3440
 [<ffffffff814a7c8c>] do_open_execat+0x10c/0x6e0 fs/exec.c:805
 [<ffffffff814ad306>] do_execveat_common.isra.0+0x6f6/0x1e90 fs/exec.c:1577
 [<ffffffff814af422>] do_execve fs/exec.c:1683 [inline]
 [<ffffffff814af422>] SYSC_execve fs/exec.c:1764 [inline]
 [<ffffffff814af422>] SyS_execve+0x42/0x50 fs/exec.c:1759
 [<ffffffff82718ef5>] stub_execve+0x5/0x5 arch/x86/entry/entry_64.S:440

Crashes (696):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/11/24 03:35 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 598ca6c8 .config console log report syz C ci-android-44-kasan-gce
2019/10/20 01:52 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 8c88c9c1 .config console log report syz C ci-android-44-kasan-gce
2019/03/23 09:26 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 3361bde5 .config console log report syz C ci-android-44-kasan-gce
2019/03/23 01:36 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 3361bde5 .config console log report syz C ci-android-44-kasan-gce
2019/03/16 16:57 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b bab43553 .config console log report syz C ci-android-44-kasan-gce
2019/03/15 08:15 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b d72db19b .config console log report syz C ci-android-44-kasan-gce
2019/03/09 22:35 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 12365b99 .config console log report syz C ci-android-44-kasan-gce
2019/03/07 19:45 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 8c085c5e .config console log report syz C ci-android-44-kasan-gce
2019/02/28 18:20 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 09aeeba4 .config console log report syz C ci-android-44-kasan-gce
2019/01/14 11:48 https://android.googlesource.com/kernel/common android-4.4 241f76b17c36 95485883 .config console log report syz C ci-android-44-kasan-gce
2019/01/11 10:22 https://android.googlesource.com/kernel/common android-4.4 a956c6a16374 80dde172 .config console log report syz C ci-android-44-kasan-gce
2019/01/08 11:49 https://android.googlesource.com/kernel/common android-4.4 d08574b6f0ae 37dd2683 .config console log report syz C ci-android-44-kasan-gce
2019/01/08 00:37 https://android.googlesource.com/kernel/common android-4.4 d08574b6f0ae 69d69aa9 .config console log report syz C ci-android-44-kasan-gce
2019/01/02 00:51 https://android.googlesource.com/kernel/common android-4.4 dfca92bab267 3d85f48c .config console log report syz C ci-android-44-kasan-gce
2019/01/01 21:17 https://android.googlesource.com/kernel/common android-4.4 dfca92bab267 3d85f48c .config console log report syz C ci-android-44-kasan-gce
2018/12/31 17:00 https://android.googlesource.com/kernel/common android-4.4 dfca92bab267 2b42fdc8 .config console log report syz C ci-android-44-kasan-gce
2018/12/30 22:26 https://android.googlesource.com/kernel/common android-4.4 dfca92bab267 9942de5f .config console log report syz C ci-android-44-kasan-gce
2018/12/21 08:28 https://android.googlesource.com/kernel/common android-4.4 34a4d7ffc21b 2b497001 .config console log report syz C ci-android-44-kasan-gce
2018/12/18 00:53 https://android.googlesource.com/kernel/common android-4.4 b95a8c048a28 def91db3 .config console log report syz C ci-android-44-kasan-gce
2018/12/15 03:17 https://android.googlesource.com/kernel/common android-4.4 b95a8c048a28 7624ddd6 .config console log report syz C ci-android-44-kasan-gce
2018/12/08 14:14 https://android.googlesource.com/kernel/common android-4.4 0d71150b2638 60562a1d .config console log report syz C ci-android-44-kasan-gce
2019/11/24 03:36 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 598ca6c8 .config console log report syz C ci-android-44-kasan-gce-386
2019/10/20 01:53 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 8c88c9c1 .config console log report syz C ci-android-44-kasan-gce-386
2019/03/23 01:36 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 3361bde5 .config console log report syz C ci-android-44-kasan-gce-386
2019/03/16 16:57 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b bab43553 .config console log report syz C ci-android-44-kasan-gce-386
2019/03/15 08:15 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b d72db19b .config console log report syz C ci-android-44-kasan-gce-386
2019/03/09 22:35 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 12365b99 .config console log report syz C ci-android-44-kasan-gce-386
2019/03/07 19:48 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 8c085c5e .config console log report syz C ci-android-44-kasan-gce-386
2019/02/28 18:18 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 09aeeba4 .config console log report syz C ci-android-44-kasan-gce-386
2019/01/14 11:48 https://android.googlesource.com/kernel/common android-4.4 241f76b17c36 95485883 .config console log report syz C ci-android-44-kasan-gce-386
2019/01/11 10:00 https://android.googlesource.com/kernel/common android-4.4 a956c6a16374 80dde172 .config console log report syz C ci-android-44-kasan-gce-386
2019/01/08 11:50 https://android.googlesource.com/kernel/common android-4.4 d08574b6f0ae 37dd2683 .config console log report syz C ci-android-44-kasan-gce-386
2019/01/08 00:38 https://android.googlesource.com/kernel/common android-4.4 d08574b6f0ae 69d69aa9 .config console log report syz C ci-android-44-kasan-gce-386
2019/01/02 00:51 https://android.googlesource.com/kernel/common android-4.4 dfca92bab267 3d85f48c .config console log report syz C ci-android-44-kasan-gce-386
2019/01/01 21:17 https://android.googlesource.com/kernel/common android-4.4 dfca92bab267 3d85f48c .config console log report syz C ci-android-44-kasan-gce-386
2018/12/31 17:00 https://android.googlesource.com/kernel/common android-4.4 dfca92bab267 2b42fdc8 .config console log report syz C ci-android-44-kasan-gce-386
2018/12/30 22:25 https://android.googlesource.com/kernel/common android-4.4 dfca92bab267 9942de5f .config console log report syz C ci-android-44-kasan-gce-386
2018/12/21 08:57 https://android.googlesource.com/kernel/common android-4.4 34a4d7ffc21b 2b497001 .config console log report syz C ci-android-44-kasan-gce-386
2018/12/18 00:52 https://android.googlesource.com/kernel/common android-4.4 b95a8c048a28 def91db3 .config console log report syz C ci-android-44-kasan-gce-386
2018/12/15 03:15 https://android.googlesource.com/kernel/common android-4.4 b95a8c048a28 7624ddd6 .config console log report syz C ci-android-44-kasan-gce-386
2018/12/08 14:12 https://android.googlesource.com/kernel/common android-4.4 0d71150b2638 60562a1d .config console log report syz C ci-android-44-kasan-gce-386
2019/12/04 05:35 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b ae13a849 .config console log report ci-android-44-kasan-gce
2019/12/04 04:27 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b ae13a849 .config console log report ci-android-44-kasan-gce
2019/12/04 01:24 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b ae13a849 .config console log report ci-android-44-kasan-gce
2019/12/03 23:30 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b ae13a849 .config console log report ci-android-44-kasan-gce
2019/12/03 22:20 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b ae13a849 .config console log report ci-android-44-kasan-gce
2019/12/03 18:31 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b ae13a849 .config console log report ci-android-44-kasan-gce
2019/12/03 14:56 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b ab342da3 .config console log report ci-android-44-kasan-gce
2019/12/03 10:11 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b ab342da3 .config console log report ci-android-44-kasan-gce
2019/12/03 07:41 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b ab342da3 .config console log report ci-android-44-kasan-gce
2019/12/03 04:21 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b ab342da3 .config console log report ci-android-44-kasan-gce
2019/12/03 00:47 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b ab342da3 .config console log report ci-android-44-kasan-gce
2019/12/02 19:58 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b f879db37 .config console log report ci-android-44-kasan-gce
2019/12/02 18:28 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b f879db37 .config console log report ci-android-44-kasan-gce
2019/12/02 15:34 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b f879db37 .config console log report ci-android-44-kasan-gce
2019/12/02 08:20 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b f879db37 .config console log report ci-android-44-kasan-gce
2019/12/01 19:38 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b a76bf83f .config console log report ci-android-44-kasan-gce
2019/12/01 12:23 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b a76bf83f .config console log report ci-android-44-kasan-gce
2019/12/01 00:05 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b a76bf83f .config console log report ci-android-44-kasan-gce
2019/11/30 22:49 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b a76bf83f .config console log report ci-android-44-kasan-gce
2019/11/30 20:50 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 3a75be00 .config console log report ci-android-44-kasan-gce
2019/11/30 19:34 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 3a75be00 .config console log report ci-android-44-kasan-gce
2019/11/30 16:53 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 3a75be00 .config console log report ci-android-44-kasan-gce
2019/11/30 16:47 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 3a75be00 .config console log report ci-android-44-kasan-gce
2019/11/30 15:45 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 3a75be00 .config console log report ci-android-44-kasan-gce
2019/11/30 12:25 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 3a75be00 .config console log report ci-android-44-kasan-gce
2019/11/30 10:48 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 3a75be00 .config console log report ci-android-44-kasan-gce
2019/11/29 20:01 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b d29b9e84 .config console log report ci-android-44-kasan-gce
2019/11/29 13:35 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b d29b9e84 .config console log report ci-android-44-kasan-gce
2019/11/29 03:49 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 76357d6f .config console log report ci-android-44-kasan-gce
2019/11/29 00:06 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 76357d6f .config console log report ci-android-44-kasan-gce
2019/11/28 21:35 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 46869e3e .config console log report ci-android-44-kasan-gce
2019/11/28 20:30 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 46869e3e .config console log report ci-android-44-kasan-gce
2019/11/28 14:35 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 46869e3e .config console log report ci-android-44-kasan-gce
2019/11/28 12:27 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 46869e3e .config console log report ci-android-44-kasan-gce
2019/11/28 08:37 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 0d63f89c .config console log report ci-android-44-kasan-gce
2019/11/28 05:59 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 0d63f89c .config console log report ci-android-44-kasan-gce
2019/11/28 02:43 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 0d63f89c .config console log report ci-android-44-kasan-gce
2019/11/27 16:38 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 0d63f89c .config console log report ci-android-44-kasan-gce
2019/11/27 12:12 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 1048481f .config console log report ci-android-44-kasan-gce
2019/11/27 09:24 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 1048481f .config console log report ci-android-44-kasan-gce
2019/11/27 00:05 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 1048481f .config console log report ci-android-44-kasan-gce
2019/12/04 02:39 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b ae13a849 .config console log report ci-android-44-kasan-gce-386
2019/12/03 13:53 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b ab342da3 .config console log report ci-android-44-kasan-gce-386
2019/12/02 11:55 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b f879db37 .config console log report ci-android-44-kasan-gce-386
2019/12/02 06:58 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b f879db37 .config console log report ci-android-44-kasan-gce-386
2019/12/02 02:42 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b f879db37 .config console log report ci-android-44-kasan-gce-386
2019/12/01 17:58 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b a76bf83f .config console log report ci-android-44-kasan-gce-386
2019/12/01 16:43 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b a76bf83f .config console log report ci-android-44-kasan-gce-386
2019/12/01 11:02 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b a76bf83f .config console log report ci-android-44-kasan-gce-386
2019/12/01 08:34 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b a76bf83f .config console log report ci-android-44-kasan-gce-386
2019/11/30 06:24 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 3a75be00 .config console log report ci-android-44-kasan-gce-386
2019/11/29 17:04 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b d29b9e84 .config console log report ci-android-44-kasan-gce-386
2019/11/28 16:15 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 46869e3e .config console log report ci-android-44-kasan-gce-386
2019/11/27 03:59 https://android.googlesource.com/kernel/common android-4.4 62872f952d6b 1048481f .config console log report ci-android-44-kasan-gce-386
* Struck through repros no longer work on HEAD.