[syzbot] BUG: unable to handle kernel NULL pointer dereference in io_do_iopoll

78 views
Skip to first unread message

syzbot

unread,
May 17, 2022, 2:13:23 PM5/17/22
to asml.s...@gmail.com, ax...@kernel.dk, io-u...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 42226c989789 Linux 5.18-rc7
git tree: upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=125b807ef00000
kernel config: https://syzkaller.appspot.com/x/.config?x=902c5209311d387c
dashboard link: https://syzkaller.appspot.com/bug?extid=1a0a53300ce782f8b3ad
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=149eb59ef00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17cc57c6f00000

The issue was bisected to:

commit 3f1d52abf098c85b177b8c6f5b310e8347d1bc42
Author: Jens Axboe <ax...@kernel.dk>
Date: Tue Mar 29 16:43:56 2022 +0000

io_uring: defer msg-ring file validity check until command issue

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1504cbaef00000
final oops: https://syzkaller.appspot.com/x/report.txt?x=1704cbaef00000
console output: https://syzkaller.appspot.com/x/log.txt?x=1304cbaef00000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+1a0a53...@syzkaller.appspotmail.com
Fixes: 3f1d52abf098 ("io_uring: defer msg-ring file validity check until command issue")

BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor instruction fetch in kernel mode
#PF: error_code(0x0010) - not-present page
PGD 0 P4D 0
Oops: 0010 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 3596 Comm: syz-executor359 Not tainted 5.18.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:0x0
Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.
RSP: 0018:ffffc9000325fb68 EFLAGS: 00010246
RAX: ffffffff89dad220 RBX: dffffc0000000000 RCX: 0000000000000000
RDX: 0000000000000003 RSI: ffffc9000325fbe0 RDI: ffff8880213388c0
RBP: ffff888021338901 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffff81ec11a0 R11: 0000000000000000 R12: 0000000000000003
R13: ffffc9000325fbe0 R14: ffff8880213388c0 R15: ffff888021338938
FS: 0000000000000000(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 000000000ba8e000 CR4: 0000000000350ef0
Call Trace:
<TASK>
io_do_iopoll+0x262/0x1080 fs/io_uring.c:2776
io_iopoll_try_reap_events+0xba/0x158 fs/io_uring.c:2829
io_ring_ctx_wait_and_kill+0x1d9/0x327 fs/io_uring.c:10167
io_uring_release+0x42/0x46 fs/io_uring.c:10184
__fput+0x277/0x9d0 fs/file_table.c:317
task_work_run+0xdd/0x1a0 kernel/task_work.c:164
exit_task_work include/linux/task_work.h:37 [inline]
do_exit+0xaff/0x2a00 kernel/exit.c:795
do_group_exit+0xd2/0x2f0 kernel/exit.c:925
__do_sys_exit_group kernel/exit.c:936 [inline]
__se_sys_exit_group kernel/exit.c:934 [inline]
__x64_sys_exit_group+0x3a/0x50 kernel/exit.c:934
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f115bc1bf19
Code: Unable to access opcode bytes at RIP 0x7f115bc1beef.
RSP: 002b:00007ffde3b5abf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007f115bc90290 RCX: 00007f115bc1bf19
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffffffffffc0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f115bc90290
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001
</TASK>
Modules linked in:
CR2: 0000000000000000
---[ end trace 0000000000000000 ]---
RIP: 0010:0x0
Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.
RSP: 0018:ffffc9000325fb68 EFLAGS: 00010246
RAX: ffffffff89dad220 RBX: dffffc0000000000 RCX: 0000000000000000
RDX: 0000000000000003 RSI: ffffc9000325fbe0 RDI: ffff8880213388c0
RBP: ffff888021338901 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffff81ec11a0 R11: 0000000000000000 R12: 0000000000000003
R13: ffffc9000325fbe0 R14: ffff8880213388c0 R15: ffff888021338938
FS: 0000000000000000(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 000000000ba8e000 CR4: 0000000000350ef0


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

Jens Axboe

unread,
May 17, 2022, 2:34:04 PM5/17/22
to syzbot, asml.s...@gmail.com, io-u...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On 5/17/22 12:13 PM, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 42226c989789 Linux 5.18-rc7
> git tree: upstream
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=125b807ef00000
> kernel config: https://syzkaller.appspot.com/x/.config?x=902c5209311d387c
> dashboard link: https://syzkaller.appspot.com/bug?extid=1a0a53300ce782f8b3ad
> compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=149eb59ef00000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17cc57c6f00000
>
> The issue was bisected to:
>
> commit 3f1d52abf098c85b177b8c6f5b310e8347d1bc42
> Author: Jens Axboe <ax...@kernel.dk>
> Date: Tue Mar 29 16:43:56 2022 +0000
>
> io_uring: defer msg-ring file validity check until command issue

#syz test git://git.kernel.dk/linux-block io_uring-5.18

--
Jens Axboe

syzbot

unread,
May 17, 2022, 2:44:11 PM5/17/22
to asml.s...@gmail.com, ax...@kernel.dk, io-u...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
BUG: unable to handle kernel NULL pointer dereference in io_do_iopoll

BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor instruction fetch in kernel mode
#PF: error_code(0x0010) - not-present page
PGD 0 P4D 0
Oops: 0010 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 4077 Comm: syz-executor.0 Not tainted 5.18.0-rc2-syzkaller-00022-ga67f2fc1f9b5 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:0x0
Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.
RSP: 0018:ffffc900056478d8 EFLAGS: 00010246
RAX: ffffffff89dad020 RBX: dffffc0000000000 RCX: 0000000000000000
RDX: 0000000000000003 RSI: ffffc90005647950 RDI: ffff88807f0668c0
RBP: ffff88807f066901 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffff81ec0c20 R11: 0000000000000000 R12: 0000000000000003
R13: ffffc90005647950 R14: ffff88807f0668c0 R15: ffff88807f066938
FS: 0000000000000000(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 000000000ba8e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
io_do_iopoll+0x262/0x1080 fs/io_uring.c:2776
io_iopoll_try_reap_events+0xba/0x158 fs/io_uring.c:2829
io_ring_ctx_wait_and_kill+0x1d9/0x327 fs/io_uring.c:10170
io_uring_release+0x42/0x46 fs/io_uring.c:10187
__fput+0x277/0x9d0 fs/file_table.c:317
task_work_run+0xdd/0x1a0 kernel/task_work.c:164
exit_task_work include/linux/task_work.h:37 [inline]
do_exit+0xaff/0x2a00 kernel/exit.c:795
do_group_exit+0xd2/0x2f0 kernel/exit.c:925
get_signal+0x22df/0x24c0 kernel/signal.c:2864
arch_do_signal_or_restart+0x82/0x20f0 arch/x86/kernel/signal.c:867
exit_to_user_mode_loop kernel/entry/common.c:166 [inline]
exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:201
__syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline]
syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:294
do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fe34b8890e9
Code: Unable to access opcode bytes at RIP 0x7fe34b8890bf.
RSP: 002b:00007fe34c997218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: 0000000000000001 RBX: 00007fe34b99bf68 RCX: 00007fe34b8890e9
RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007fe34b99bf6c
RBP: 00007fe34b99bf60 R08: 00007fff26bf1080 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000246 R12: 00007fe34b99bf6c
R13: 00007fff26becbef R14: 00007fe34c997300 R15: 0000000000022000
</TASK>
Modules linked in:
CR2: 0000000000000000
---[ end trace 0000000000000000 ]---
RIP: 0010:0x0
Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.
RSP: 0018:ffffc900056478d8 EFLAGS: 00010246
RAX: ffffffff89dad020 RBX: dffffc0000000000 RCX: 0000000000000000
RDX: 0000000000000003 RSI: ffffc90005647950 RDI: ffff88807f0668c0
RBP: ffff88807f066901 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffff81ec0c20 R11: 0000000000000000 R12: 0000000000000003
R13: ffffc90005647950 R14: ffff88807f0668c0 R15: ffff88807f066938
FS: 0000000000000000(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 000000000ba8e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


Tested on:

commit: a67f2fc1 io_uring: don't attempt to IOPOLL for MSG_RIN..
git tree: git://git.kernel.dk/linux-block io_uring-5.18
console output: https://syzkaller.appspot.com/x/log.txt?x=13167865f00000
kernel config: https://syzkaller.appspot.com/x/.config?x=e408a5da421f07d4
dashboard link: https://syzkaller.appspot.com/bug?extid=1a0a53300ce782f8b3ad
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2

Note: no patches were applied.

Jens Axboe

unread,
May 17, 2022, 2:46:43 PM5/17/22
to syzbot, asml.s...@gmail.com, io-u...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On 5/17/22 12:44 PM, syzbot wrote:
> Hello,
>
> syzbot has tested the proposed patch but the reproducer is still triggering an issue:
> BUG: unable to handle kernel NULL pointer dereference in io_do_iopoll

Gah, backport ended up putting the hunk in the wrong spot, not very useful.

syzbot

unread,
May 17, 2022, 3:02:10 PM5/17/22
to asml.s...@gmail.com, ax...@kernel.dk, io-u...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+1a0a53...@syzkaller.appspotmail.com

Tested on:

commit: aa184e86 io_uring: don't attempt to IOPOLL for MSG_RIN..
git tree: git://git.kernel.dk/linux-block io_uring-5.18
kernel config: https://syzkaller.appspot.com/x/.config?x=e408a5da421f07d4
dashboard link: https://syzkaller.appspot.com/bug?extid=1a0a53300ce782f8b3ad
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2

Note: no patches were applied.
Note: testing is done by a robot and is best-effort only.
Reply all
Reply to author
Forward
0 new messages