WARNING: lock held when returning to user space in mnt_want_write_file

3 views
Skip to first unread message

syzbot

unread,
Oct 15, 2022, 2:49:38 PM10/15/22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 9d5c0b3a8e1a Linux 4.14.295
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=124a22d6880000
kernel config: https://syzkaller.appspot.com/x/.config?x=746c079015a92425
dashboard link: https://syzkaller.appspot.com/bug?extid=495a63a784549ca60cf1
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ed6fcf5895a2/disk-9d5c0b3a.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/341aa3534116/vmlinux-9d5c0b3a.xz

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

F2FS-fs (loop1): invalid crc value
F2FS-fs (loop1): Found nat_bits in checkpoint
F2FS-fs (loop1): Mounted with checkpoint version = 3651456e
================================================
WARNING: lock held when returning to user space!
4.14.295-syzkaller #0 Not tainted
------------------------------------------------
syz-executor.1/10060 is leaving the kernel with locks still held!
1 lock held by syz-executor.1/10060:
#0: (sb_writers#13){.+.+}, at: [<ffffffff818e09ad>] sb_start_write include/linux/fs.h:1551 [inline]
#0: (sb_writers#13){.+.+}, at: [<ffffffff818e09ad>] mnt_want_write_file+0xfd/0x3b0 fs/namespace.c:497
------------[ cut here ]------------
WARNING: CPU: 1 PID: 7993 at fs/namespace.c:1178 cleanup_mnt+0x222/0x2c0 fs/namespace.c:1178
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 7993 Comm: syz-executor.1 Not tainted 4.14.295-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x1b2/0x281 lib/dump_stack.c:58
panic+0x1f9/0x42d kernel/panic.c:183
__warn.cold+0x20/0x44 kernel/panic.c:547
report_bug+0x208/0x250 lib/bug.c:183
fixup_bug arch/x86/kernel/traps.c:177 [inline]
fixup_bug arch/x86/kernel/traps.c:172 [inline]
do_error_trap+0x195/0x2d0 arch/x86/kernel/traps.c:295
invalid_op+0x1b/0x40 arch/x86/entry/entry_64.S:964
RIP: 0010:cleanup_mnt+0x222/0x2c0 fs/namespace.c:1178
RSP: 0018:ffff888093defe18 EFLAGS: 00010297
RAX: ffff8880ac39c3c0 RBX: dffffc0000000000 RCX: 0000000000000002
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffffff8a0928e0
RBP: 0000000000000008 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: ffff8880ac39c3c0 R12: ffff8880b3435c00
R13: 0000000000000001 R14: 0000000000000007 R15: fffffbfff1412556
task_work_run+0x11f/0x190 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:191 [inline]
exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164
prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x7f5f3bcbfa17
RSP: 002b:00007fff77b44928 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f5f3bcbfa17
RDX: 00007fff77b449fa RSI: 000000000000000a RDI: 00007fff77b449f0
RBP: 00007fff77b449f0 R08: 00000000ffffffff R09: 00007fff77b447c0
R10: 000055555616e903 R11: 0000000000000246 R12: 00007f5f3bd185f6
R13: 00007fff77b45ab0 R14: 000055555616e810 R15: 00007fff77b45af0
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
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,
Oct 30, 2022, 12:20:39 AM10/30/22
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 41f36d7859a7 Linux 4.14.296
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14fbd716880000
kernel config: https://syzkaller.appspot.com/x/.config?x=20cc5ea0fe276fa6
dashboard link: https://syzkaller.appspot.com/bug?extid=495a63a784549ca60cf1
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=127b36ca880000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=121fc5ce880000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/941b591cedec/disk-41f36d78.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/2eea2720f8fc/vmlinux-41f36d78.xz
kernel image: https://storage.googleapis.com/syzbot-assets/7c3ce0be6b9a/bzImage-41f36d78.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/cae300df9477/mount_0.gz

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

F2FS-fs (loop0): Invalid blocksize (65536), supports only 4KB
F2FS-fs (loop0): Can't find valid F2FS filesystem in 1th superblock
F2FS-fs (loop0): invalid crc value
F2FS-fs (loop0): Mounted with checkpoint version = 3e17dab0
================================================
WARNING: lock held when returning to user space!
4.14.296-syzkaller #0 Not tainted
------------------------------------------------
syz-executor198/7982 is leaving the kernel with locks still held!
1 lock held by syz-executor198/7982:
#0: (sb_writers#10){.+.+}, at: [<ffffffff818e0d3d>] sb_start_write include/linux/fs.h:1551 [inline]
#0: (sb_writers#10){.+.+}, at: [<ffffffff818e0d3d>] mnt_want_write_file+0xfd/0x3b0 fs/namespace.c:497
------------[ cut here ]------------
WARNING: CPU: 0 PID: 7982 at fs/namespace.c:1178 cleanup_mnt+0x222/0x2c0 fs/namespace.c:1178
Kernel panic - not syncing: panic_on_warn set ...

CPU: 0 PID: 7982 Comm: syz-executor198 Not tainted 4.14.296-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x1b2/0x281 lib/dump_stack.c:58
panic+0x1f9/0x42d kernel/panic.c:183
__warn.cold+0x20/0x44 kernel/panic.c:547
report_bug+0x208/0x250 lib/bug.c:183
fixup_bug arch/x86/kernel/traps.c:177 [inline]
fixup_bug arch/x86/kernel/traps.c:172 [inline]
do_error_trap+0x195/0x2d0 arch/x86/kernel/traps.c:295
invalid_op+0x1b/0x40 arch/x86/entry/entry_64.S:964
RIP: 0010:cleanup_mnt+0x222/0x2c0 fs/namespace.c:1178
RSP: 0018:ffff8880b4b17d08 EFLAGS: 00010297
RAX: ffff8880b335a380 RBX: dffffc0000000000 RCX: 0000000000000002
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffffff8a0932e0
RBP: 0000000000000008 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: ffff8880b335a380 R12: ffff8880b3a2ea00
R13: 0000000000000001 R14: 0000000000000007 R15: fffffbfff1412696
task_work_run+0x11f/0x190 kernel/task_work.c:113
exit_task_work include/linux/task_work.h:22 [inline]
do_exit+0xa44/0x2850 kernel/exit.c:868
do_group_exit+0x100/0x2e0 kernel/exit.c:965
SYSC_exit_group kernel/exit.c:976 [inline]
SyS_exit_group+0x19/0x20 kernel/exit.c:974
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x7f3d90052c89
RSP: 002b:00007fff68583ad8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007f3d900c9330 RCX: 00007f3d90052c89
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000001
RBP: 0000000000000001 R08: ffffffffffffffc0 R09: 00007f3d900c3e40
R10: 00007f3d900c3e40 R11: 0000000000000246 R12: 00007f3d900c9330
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001
Reply all
Reply to author
Forward
0 new messages