[v6.1] possible deadlock in pipe_write

0 views
Skip to first unread message

syzbot

unread,
Apr 3, 2023, 1:51:52 PM4/3/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3b29299e5f60 Linux 6.1.22
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1153e87dc80000
kernel config: https://syzkaller.appspot.com/x/.config?x=bbb9a1f6f7f5a1d9
dashboard link: https://syzkaller.appspot.com/bug?extid=00ef6e8711d8fe2c15bd
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/2affbd06cbfd/disk-3b29299e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/8b22d1baf827/vmlinux-3b29299e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/d5e3891c88bf/Image-3b29299e.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+00ef6e...@syzkaller.appspotmail.com

============================================
WARNING: possible recursive locking detected
6.1.22-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.5/17640 is trying to acquire lock:
ffff00016ab5ac68 (&pipe->mutex/1){+.+.}-{3:3}, at: __pipe_lock fs/pipe.c:103 [inline]
ffff00016ab5ac68 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_write+0x114/0x1990 fs/pipe.c:431

but task is already holding lock:
ffff00016f298468 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock_nested fs/pipe.c:82 [inline]
ffff00016f298468 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock fs/pipe.c:90 [inline]
ffff00016f298468 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_wait_readable+0x320/0x468 fs/pipe.c:1049

other info that might help us debug this:
Possible unsafe locking scenario:

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

*** DEADLOCK ***

May be due to missing lock nesting notation

1 lock held by syz-executor.5/17640:
#0: ffff00016f298468 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock_nested fs/pipe.c:82 [inline]
#0: ffff00016f298468 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock fs/pipe.c:90 [inline]
#0: ffff00016f298468 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_wait_readable+0x320/0x468 fs/pipe.c:1049

stack backtrace:
CPU: 0 PID: 17640 Comm: syz-executor.5 Not tainted 6.1.22-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
dump_stack+0x1c/0x5c lib/dump_stack.c:113
__lock_acquire+0x6310/0x764c kernel/locking/lockdep.c:5056
lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
__mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
__pipe_lock fs/pipe.c:103 [inline]
pipe_write+0x114/0x1990 fs/pipe.c:431
do_iter_write+0x534/0x964 fs/read_write.c:861
vfs_iter_write+0x88/0xac fs/read_write.c:902
iter_file_splice_write+0x618/0xc48 fs/splice.c:686
do_splice_from fs/splice.c:764 [inline]
do_splice+0xfd0/0x1898 fs/splice.c:1074
__do_splice fs/splice.c:1139 [inline]
__do_sys_splice fs/splice.c:1346 [inline]
__se_sys_splice fs/splice.c:1328 [inline]
__arm64_sys_splice+0x50c/0x7fc fs/splice.c:1328
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Jun 8, 2023, 10:28:50 PM6/8/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 76ba310227d2 Linux 6.1.32
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14ae8ef1280000
kernel config: https://syzkaller.appspot.com/x/.config?x=3d054c5c4a3e2d63
dashboard link: https://syzkaller.appspot.com/bug?extid=00ef6e8711d8fe2c15bd
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17783793280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14238f59280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e0c868320bc7/disk-76ba3102.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/f7fcc207e1e7/vmlinux-76ba3102.xz
kernel image: https://storage.googleapis.com/syzbot-assets/5ddc172b4acf/Image-76ba3102.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+00ef6e...@syzkaller.appspotmail.com

============================================
WARNING: possible recursive locking detected
6.1.32-syzkaller #0 Not tainted
--------------------------------------------
syz-executor163/4223 is trying to acquire lock:
ffff0000cf68e468 (&pipe->mutex/1){+.+.}-{3:3}, at: __pipe_lock fs/pipe.c:103 [inline]
ffff0000cf68e468 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_write+0x114/0x1990 fs/pipe.c:431

but task is already holding lock:
ffff0000cf68e868 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock_nested fs/pipe.c:82 [inline]
ffff0000cf68e868 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock fs/pipe.c:90 [inline]
ffff0000cf68e868 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_wait_readable+0x320/0x468 fs/pipe.c:1049

other info that might help us debug this:
Possible unsafe locking scenario:

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

*** DEADLOCK ***

May be due to missing lock nesting notation

1 lock held by syz-executor163/4223:
#0: ffff0000cf68e868 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock_nested fs/pipe.c:82 [inline]
#0: ffff0000cf68e868 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock fs/pipe.c:90 [inline]
#0: ffff0000cf68e868 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_wait_readable+0x320/0x468 fs/pipe.c:1049

stack backtrace:
CPU: 1 PID: 4223 Comm: syz-executor163 Not tainted 6.1.32-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
dump_stack+0x1c/0x58 lib/dump_stack.c:113
__lock_acquire+0x6310/0x764c kernel/locking/lockdep.c:5056
lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
__mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:603
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
__pipe_lock fs/pipe.c:103 [inline]
pipe_write+0x114/0x1990 fs/pipe.c:431
do_iter_write+0x534/0x964 fs/read_write.c:861
vfs_iter_write+0x88/0xac fs/read_write.c:902
iter_file_splice_write+0x618/0xc48 fs/splice.c:686
do_splice_from fs/splice.c:764 [inline]
do_splice+0xfd0/0x1898 fs/splice.c:1074
__do_splice fs/splice.c:1139 [inline]
__do_sys_splice fs/splice.c:1346 [inline]
__se_sys_splice fs/splice.c:1328 [inline]
__arm64_sys_splice+0x50c/0x7fc fs/splice.c:1328
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
Reply all
Reply to author
Forward
0 new messages