[syzbot] KASAN: null-ptr-deref Write in io_file_get_normal

27 views
Skip to first unread message

syzbot

unread,
Mar 31, 2022, 12:52:22 PM3/31/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: fdcbcd1348f4 Add linux-next specific files for 20220331
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=1146e5fd700000
kernel config: https://syzkaller.appspot.com/x/.config?x=366ab475940a4177
dashboard link: https://syzkaller.appspot.com/bug?extid=c4b9303500a21750b250
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=1434c99b700000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1623e2f7700000

The issue was bisected to:

commit c686f7a5cbe2eff3c9b41f225fb7cf9e163cde5c
Author: Jens Axboe <ax...@kernel.dk>
Date: Tue Mar 29 16:59:20 2022 +0000

io_uring: defer splice/tee file validity check until command issue

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=12b0199b700000
final oops: https://syzkaller.appspot.com/x/report.txt?x=11b0199b700000
console output: https://syzkaller.appspot.com/x/log.txt?x=16b0199b700000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+c4b930...@syzkaller.appspotmail.com
Fixes: c686f7a5cbe2 ("io_uring: defer splice/tee file validity check until command issue")

==================================================================
BUG: KASAN: null-ptr-deref in instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
BUG: KASAN: null-ptr-deref in atomic_inc include/linux/atomic/atomic-instrumented.h:190 [inline]
BUG: KASAN: null-ptr-deref in io_req_track_inflight fs/io_uring.c:1648 [inline]
BUG: KASAN: null-ptr-deref in io_file_get_normal+0x33e/0x380 fs/io_uring.c:7518
Write of size 4 at addr 0000000000000118 by task iou-wrk-3588/3589

CPU: 1 PID: 3589 Comm: iou-wrk-3588 Not tainted 5.17.0-next-20220331-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
print_report mm/kasan/report.c:432 [inline]
kasan_report.cold+0x61/0x1c6 mm/kasan/report.c:491
check_region_inline mm/kasan/generic.c:183 [inline]
kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189
instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
atomic_inc include/linux/atomic/atomic-instrumented.h:190 [inline]
io_req_track_inflight fs/io_uring.c:1648 [inline]
io_file_get_normal+0x33e/0x380 fs/io_uring.c:7518
io_file_get fs/io_uring.c:7528 [inline]
io_tee fs/io_uring.c:4401 [inline]
io_issue_sqe+0x45f5/0x8f40 fs/io_uring.c:7354
io_wq_submit_work+0x2b6/0x770 fs/io_uring.c:7444
io_worker_handle_work+0xb1c/0x1ab0 fs/io-wq.c:597
io_wqe_worker+0x637/0xdb0 fs/io-wq.c:644
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
</TASK>
==================================================================
Kernel panic - not syncing: panic_on_warn set ...
CPU: 0 PID: 3589 Comm: iou-wrk-3588 Not tainted 5.17.0-next-20220331-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
panic+0x2d7/0x636 kernel/panic.c:274
end_report.part.0+0x3f/0x7c mm/kasan/report.c:168
end_report include/trace/events/error_report.h:69 [inline]
kasan_report.cold+0x93/0x1c6 mm/kasan/report.c:493
check_region_inline mm/kasan/generic.c:183 [inline]
kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189
instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
atomic_inc include/linux/atomic/atomic-instrumented.h:190 [inline]
io_req_track_inflight fs/io_uring.c:1648 [inline]
io_file_get_normal+0x33e/0x380 fs/io_uring.c:7518
io_file_get fs/io_uring.c:7528 [inline]
io_tee fs/io_uring.c:4401 [inline]
io_issue_sqe+0x45f5/0x8f40 fs/io_uring.c:7354
io_wq_submit_work+0x2b6/0x770 fs/io_uring.c:7444
io_worker_handle_work+0xb1c/0x1ab0 fs/io-wq.c:597
io_wqe_worker+0x637/0xdb0 fs/io-wq.c:644
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
</TASK>
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.
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,
Mar 31, 2022, 2:51:18 PM3/31/22
to syzbot, asml.s...@gmail.com, io-u...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
#syz test: git://git.kernel.dk/linux-block for-next

--
Jens Axboe

syzbot

unread,
Mar 31, 2022, 3:06:15 PM3/31/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+c4b930...@syzkaller.appspotmail.com

Tested on:

commit: 9570a845 Merge branch 'for-5.18/io_uring' into for-next
git tree: git://git.kernel.dk/linux-block for-next
kernel config: https://syzkaller.appspot.com/x/.config?x=6a82c1abd4cbb9ee
dashboard link: https://syzkaller.appspot.com/bug?extid=c4b9303500a21750b250
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