[v5.15] possible deadlock in pipe_write

1 view
Skip to first unread message

syzbot

unread,
May 29, 2023, 11:04:07 PM5/29/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 1fe619a7d252 Linux 5.15.113
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=12412bbd280000
kernel config: https://syzkaller.appspot.com/x/.config?x=8f10ee30ae29b021
dashboard link: https://syzkaller.appspot.com/bug?extid=f90104cef4fc1b3b3194
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/1b707a1e1816/disk-1fe619a7.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/19cc598a8bbe/vmlinux-1fe619a7.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a6cf7269bae5/Image-1fe619a7.gz.xz

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

============================================
WARNING: possible recursive locking detected
5.15.113-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.3/23646 is trying to acquire lock:
ffff0000d17ca868 (&pipe->mutex/1){+.+.}-{3:3}, at: __pipe_lock fs/pipe.c:102 [inline]
ffff0000d17ca868 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_write+0x10c/0x1a4c fs/pipe.c:430

but task is already holding lock:
ffff0000d17cb068 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock_nested fs/pipe.c:81 [inline]
ffff0000d17cb068 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock fs/pipe.c:89 [inline]
ffff0000d17cb068 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_wait_readable+0x324/0x46c fs/pipe.c:1048

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.3/23646:
#0: ffff0000d17cb068 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock_nested fs/pipe.c:81 [inline]
#0: ffff0000d17cb068 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock fs/pipe.c:89 [inline]
#0: ffff0000d17cb068 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_wait_readable+0x324/0x46c fs/pipe.c:1048

stack backtrace:
CPU: 0 PID: 23646 Comm: syz-executor.3 Not tainted 5.15.113-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023
Call trace:
dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__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+0x62b4/0x7620 kernel/locking/lockdep.c:5011
lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
__mutex_lock_common+0x194/0x2154 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0xa4/0xf8 kernel/locking/mutex.c:743
__pipe_lock fs/pipe.c:102 [inline]
pipe_write+0x10c/0x1a4c fs/pipe.c:430
do_iter_readv_writev+0x420/0x5f8
do_iter_write+0x1b8/0x664 fs/read_write.c:855
vfs_iter_write+0x88/0xac fs/read_write.c:896
iter_file_splice_write+0x618/0xc48 fs/splice.c:689
do_splice_from fs/splice.c:767 [inline]
do_splice+0x11b4/0x1a0c fs/splice.c:1079
__do_splice fs/splice.c:1144 [inline]
__do_sys_splice fs/splice.c:1350 [inline]
__se_sys_splice fs/splice.c:1332 [inline]
__arm64_sys_splice+0x564/0x8b0 fs/splice.c:1332
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584


---
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.

If the bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to change bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the bug is a duplicate of another bug, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
May 29, 2023, 11:40:53 PM5/29/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 1fe619a7d252 Linux 5.15.113
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=113caf25280000
kernel config: https://syzkaller.appspot.com/x/.config?x=8f10ee30ae29b021
dashboard link: https://syzkaller.appspot.com/bug?extid=f90104cef4fc1b3b3194
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=156bbc01280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=178f1c01280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/1b707a1e1816/disk-1fe619a7.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/19cc598a8bbe/vmlinux-1fe619a7.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a6cf7269bae5/Image-1fe619a7.gz.xz

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

============================================
WARNING: possible recursive locking detected
5.15.113-syzkaller #0 Not tainted
--------------------------------------------
syz-executor195/3962 is trying to acquire lock:
ffff0000d60fb068 (&pipe->mutex/1){+.+.}-{3:3}, at: __pipe_lock fs/pipe.c:102 [inline]
ffff0000d60fb068 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_write+0x10c/0x1a4c fs/pipe.c:430

but task is already holding lock:
ffff0000d60fac68 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock_nested fs/pipe.c:81 [inline]
ffff0000d60fac68 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock fs/pipe.c:89 [inline]
ffff0000d60fac68 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_wait_readable+0x324/0x46c fs/pipe.c:1048

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-executor195/3962:
#0: ffff0000d60fac68 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock_nested fs/pipe.c:81 [inline]
#0: ffff0000d60fac68 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_lock fs/pipe.c:89 [inline]
#0: ffff0000d60fac68 (&pipe->mutex/1){+.+.}-{3:3}, at: pipe_wait_readable+0x324/0x46c fs/pipe.c:1048

stack backtrace:
CPU: 0 PID: 3962 Comm: syz-executor195 Not tainted 5.15.113-syzkaller #0
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.

syzbot

unread,
Mar 12, 2024, 7:02:05 PMMar 12
to syzkaller...@googlegroups.com
syzbot suspects this issue could be fixed by backporting the following commit:

commit 055ca83559912f2cfd91c9441427bac4caf3c74e
git tree: upstream
Author: Jann Horn <ja...@google.com>
Date: Fri Nov 24 15:08:22 2023 +0000

fs/pipe: Fix lockdep false-positive in watchqueue pipe_write()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=162f32fa180000
kernel config: https://syzkaller.appspot.com/x/.config?x=3292eb21c4b0adb2
dashboard link: https://syzkaller.appspot.com/bug?extid=f90104cef4fc1b3b3194
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=166f6387e80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15d8a8a0180000


Please keep in mind that other backports might be required as well.

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

syzbot

unread,
Apr 10, 2024, 10:35:05 AM (14 days ago) Apr 10
to syzkaller...@googlegroups.com
The commit that was suspected to fix the issue was backported to the fuzzed
kernel trees.

commit de48795233cc07eb0be885688ff469fcb18de330
Author: <ja...@google.com>
Date: Fri Nov 24 15:08:22 2023 +0000

fs/pipe: Fix lockdep false-positive in watchqueue pipe_write()

If you believe this is correct, please reply with
#syz fix: fs/pipe: Fix lockdep false-positive in watchqueue pipe_write()

The commit was initially detected here:
Reply all
Reply to author
Forward
0 new messages