general protection fault in nbd_disconnect_and_put

19 views
Skip to first unread message

syzbot

unread,
Feb 22, 2021, 4:05:21 AM2/22/21
to ax...@kernel.dk, jo...@toxicpanda.com, linux...@vger.kernel.org, linux-...@vger.kernel.org, n...@other.debian.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: f40ddce8 Linux 5.11
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17494c6cd00000
kernel config: https://syzkaller.appspot.com/x/.config?x=4b919ebed7b4902
dashboard link: https://syzkaller.appspot.com/bug?extid=db0c9917f71539bc4ad1
compiler: Debian clang version 11.0.1-2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12d7c8b8d00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15a2dd22d00000

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

block nbd0: NBD_DISCONNECT
general protection fault, probably for non-canonical address 0xdffffc0000000027: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000138-0x000000000000013f]
CPU: 0 PID: 8395 Comm: systemd-udevd Not tainted 5.11.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__lock_acquire+0x8a/0x5e90 kernel/locking/lockdep.c:4702
Code: ff df 8a 04 30 84 c0 0f 85 3b 26 00 00 83 3d c0 40 58 0c 00 0f 84 b1 41 00 00 83 3d cf 7b 02 0b 00 74 2b 4c 89 f8 48 c1 e8 03 <80> 3c 30 00 74 12 4c 89 ff e8 78 ce 5f 00 48 be 00 00 00 00 00 fc
RSP: 0018:ffffc90001a2f8f0 EFLAGS: 00010006
RAX: 0000000000000027 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: dffffc0000000000 RDI: 0000000000000138
RBP: ffffc90001a2faa0 R08: 0000000000000001 R09: 0000000000000000
R10: fffffbfff1b6727e R11: 0000000000000000 R12: ffff888022c3d340
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000138
FS: 00007fce26a608c0(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffd2589efe8 CR3: 0000000013a4a000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
lock_acquire+0x114/0x5e0 kernel/locking/lockdep.c:5442
flush_workqueue+0x120/0x1620 kernel/workqueue.c:2786
nbd_disconnect_and_put+0x124/0x1f0 drivers/block/nbd.c:1995
nbd_release+0xeb/0x120 drivers/block/nbd.c:1505
__blkdev_put+0x516/0x670 fs/block_dev.c:1579
blkdev_put+0x2cd/0x440 fs/block_dev.c:1632
blkdev_close+0x7a/0xa0 fs/block_dev.c:1640
__fput+0x34d/0x7a0 fs/file_table.c:280
task_work_run+0x137/0x1c0 kernel/task_work.c:140
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop kernel/entry/common.c:174 [inline]
exit_to_user_mode_prepare+0x10b/0x1e0 kernel/entry/common.c:201
__syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline]
syscall_exit_to_user_mode+0x48/0x180 kernel/entry/common.c:294
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7fce25ba6270
Code: 73 01 c3 48 8b 0d 38 7d 20 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d 59 c1 20 00 00 75 10 b8 03 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 ee fb ff ff 48 89 04 24
RSP: 002b:00007ffddcf33578 EFLAGS: 00000246
ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000007 RCX: 00007fce25ba6270
RDX: 000000000aba9500 RSI: 0000000000000000 RDI: 0000000000000007
RBP: 00007fce26a60710 R08: 000000000000004a R09: 0000000000000008
R10: 000055ed6e37e9a8 R11: 0000000000000246 R12: 0000000000000000
R13: 000055ed6e390fd0 R14: 0000000000000003 R15: 000000000000000e
Modules linked in:

---[ end trace aae642bbdfc14982 ]---
RIP: 0010:__lock_acquire+0x8a/0x5e90 kernel/locking/lockdep.c:4702
Code: ff df 8a 04 30 84 c0 0f 85 3b 26 00 00 83 3d c0 40 58 0c 00 0f 84 b1 41 00 00 83 3d cf 7b 02 0b 00 74 2b 4c 89 f8 48 c1 e8 03 <80> 3c 30 00 74 12 4c 89 ff e8 78 ce 5f 00 48 be 00 00 00 00 00 fc
RSP: 0018:ffffc90001a2f8f0 EFLAGS: 00010006
RAX: 0000000000000027 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: dffffc0000000000 RDI: 0000000000000138
RBP: ffffc90001a2faa0 R08: 0000000000000001 R09: 0000000000000000
R10: fffffbfff1b6727e R11: 0000000000000000 R12: ffff888022c3d340
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000138
FS: 00007fce26a608c0(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffd2589efe8 CR3: 0000000013a4a000 CR4: 00000000001506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
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 can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

Hillf Danton

unread,
Feb 24, 2021, 3:56:43 AM2/24/21
to syzbot, ax...@kernel.dk, jo...@toxicpanda.com, linux...@vger.kernel.org, linux-...@vger.kernel.org, Hillf Danton, syzkall...@googlegroups.com
Mon, 22 Feb 2021 01:05:19 -0800
Flush valid WQ to avoid GP.

--- x/drivers/block/nbd.c
+++ y/drivers/block/nbd.c
@@ -1972,7 +1972,9 @@ static void nbd_disconnect_and_put(struc
* config ref and try to destroy the workqueue from inside the work
* queue.
*/
- flush_workqueue(nbd->recv_workq);
+ if (nbd->recv_workq)
+ flush_workqueue(nbd->recv_workq);
+
if (test_and_clear_bit(NBD_RT_HAS_CONFIG_REF,
&nbd->config->runtime_flags))
nbd_config_put(nbd);

syzbot

unread,
Sep 22, 2021, 12:11:08 PM9/22/21
to ax...@kernel.dk, cs.t...@bpchargemaster.com, hda...@sina.com, jo...@toxicpanda.com, linux...@vger.kernel.org, linux-...@vger.kernel.org, linux-...@vger.kernel.org, ma...@anirudhrb.com, n...@other.debian.org, nsd-p...@police.gov.hk, stephen....@oracle.com, syzkall...@googlegroups.com, vi...@zeniv.linux.org.uk
syzbot suspects this issue was fixed by commit:

commit 794ebcea865bff47231de89269e9d542121ab7be
Author: Stephen Brennan <stephen....@oracle.com>
Date: Wed Sep 1 17:51:42 2021 +0000

namei: Standardize callers of filename_lookup()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1163691d300000
start commit: acd3d2859453 Merge tag 'fixes-v5.13' of git://git.kernel.o..
git tree: upstream
kernel config: https://syzkaller.appspot.com/x/.config?x=f04bb30bd3c55050
dashboard link: https://syzkaller.appspot.com/bug?extid=db0c9917f71539bc4ad1
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13f63543d00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=122c8ef1d00000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: namei: Standardize callers of filename_lookup()

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

syzbot

unread,
Oct 1, 2022, 10:45:32 PM10/1/22
to syzkall...@googlegroups.com
Auto-closing this bug as obsolete.
No recent activity, existing reproducers are no longer triggering the issue.
Reply all
Reply to author
Forward
0 new messages