KASAN: null-ptr-deref Read in __fget_light

From: syzbot
Date: Sun Feb 28 2021 - 05:01:19 EST


Hello,

syzbot found the following issue on:

HEAD commit: 3b9cdafb Merge tag 'pinctrl-v5.12-1' of git://git.kernel.o..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=114ac832d00000
kernel config: https://syzkaller.appspot.com/x/.config?x=22008533485b2c35
dashboard link: https://syzkaller.appspot.com/bug?extid=21c62f4403f8c167e6f6

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

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+21c62f4403f8c167e6f6@xxxxxxxxxxxxxxxxxxxxxxxxx

==================================================================
BUG: KASAN: null-ptr-deref in instrument_atomic_read include/linux/instrumented.h:71 [inline]
BUG: KASAN: null-ptr-deref in atomic_read include/asm-generic/atomic-instrumented.h:27 [inline]
BUG: KASAN: null-ptr-deref in __fget_light+0x4f/0x280 fs/file.c:930
Read of size 4 at addr 0000000000000000 by task io_wqe_worker-0/10248

CPU: 0 PID: 10248 Comm: io_wqe_worker-0 Not tainted 5.11.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:79 [inline]
dump_stack+0xfa/0x151 lib/dump_stack.c:120
__kasan_report mm/kasan/report.c:400 [inline]
kasan_report.cold+0x5f/0xd5 mm/kasan/report.c:413
check_memory_region_inline mm/kasan/generic.c:179 [inline]
check_memory_region+0x13d/0x180 mm/kasan/generic.c:185
instrument_atomic_read include/linux/instrumented.h:71 [inline]
atomic_read include/asm-generic/atomic-instrumented.h:27 [inline]
__fget_light+0x4f/0x280 fs/file.c:930
fdget_raw include/linux/file.h:70 [inline]
path_init+0xc24/0x1800 fs/namei.c:2275
path_lookupat+0x30/0x830 fs/namei.c:2331
filename_lookup+0x19f/0x560 fs/namei.c:2374
user_path_at include/linux/namei.h:60 [inline]
vfs_statx+0x142/0x390 fs/stat.c:185
do_statx+0xd9/0x160 fs/stat.c:580
io_statx fs/io_uring.c:4525 [inline]
io_issue_sqe+0x2c87/0x4ec0 fs/io_uring.c:6343
io_wq_submit_work+0x2a7/0x3f0 fs/io_uring.c:6418
io_worker_handle_work+0xe2f/0x1d00 fs/io-wq.c:561
io_wqe_worker+0xc2c/0x1080 fs/io-wq.c:603
kthread+0x3b1/0x4a0 kernel/kthread.c:292
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294
==================================================================


---
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 syzkaller@xxxxxxxxxxxxxxxx.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.