KASAN: slab-out-of-bounds Read in fuse_inode_eq

12 views
Skip to first unread message

syzbot

unread,
Aug 30, 2021, 5:44:20 AM8/30/21
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 77dd11439b86 Merge tag 'drm-fixes-2021-08-27' of git://ano..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=108fb425300000
kernel config: https://syzkaller.appspot.com/x/.config?x=2fd902af77ff1e56
dashboard link: https://syzkaller.appspot.com/bug?extid=253c77522241e1826d72
compiler: Debian clang version 11.0.1-2, GNU ld (GNU Binutils for Debian) 2.35.1
CC: [linux-...@vger.kernel.org linux-...@vger.kernel.org mik...@szeredi.hu]

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+253c77...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: slab-out-of-bounds in get_node_id fs/fuse/fuse_i.h:860 [inline]
BUG: KASAN: slab-out-of-bounds in fuse_inode_eq+0x50/0x70 fs/fuse/inode.c:301
Read of size 8 at addr ffff888081243a40 by task syz-executor.3/27168

CPU: 0 PID: 27168 Comm: syz-executor.3 Not tainted 5.14.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1ae/0x29f lib/dump_stack.c:105
print_address_description+0x66/0x3b0 mm/kasan/report.c:233
__kasan_report mm/kasan/report.c:419 [inline]
kasan_report+0x163/0x210 mm/kasan/report.c:436
get_node_id fs/fuse/fuse_i.h:860 [inline]
fuse_inode_eq+0x50/0x70 fs/fuse/inode.c:301
find_inode+0x19c/0x4b0 fs/inode.c:831
ilookup5_nowait fs/inode.c:1341 [inline]
ilookup5+0x9d/0x1f0 fs/inode.c:1370
iget5_locked+0x30/0x3d0 fs/inode.c:1151
fuse_iget+0x1c3/0x800 fs/fuse/inode.c:342
create_new_entry+0x547/0x7c0 fs/fuse/dir.c:647
fuse_mknod fs/fuse/dir.c:694 [inline]
fuse_atomic_open+0xe95/0x16f0 fs/fuse/dir.c:604
atomic_open fs/namei.c:3090 [inline]
lookup_open fs/namei.c:3199 [inline]
open_last_lookups fs/namei.c:3298 [inline]
path_openat+0x104d/0x36b0 fs/namei.c:3504
do_filp_open+0x253/0x4d0 fs/namei.c:3534
do_sys_openat2+0x124/0x460 fs/open.c:1204
do_sys_open fs/open.c:1220 [inline]
__do_sys_openat fs/open.c:1236 [inline]
__se_sys_openat fs/open.c:1231 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1231
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x4665f9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f17515d1188 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 000000000056c038 RCX: 00000000004665f9
RDX: 0000000000000040 RSI: 0000000020002000 RDI: ffffffffffffff9c
RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056c038
R13: 00007ffc2ad7f2bf R14: 00007f17515d1300 R15: 0000000000022000

Allocated by task 8670:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
__kasan_slab_alloc+0xa3/0xd0 mm/kasan/common.c:467
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook mm/slab.h:519 [inline]
slab_alloc_node mm/slub.c:2959 [inline]
slab_alloc mm/slub.c:2967 [inline]
kmem_cache_alloc+0x1d1/0x340 mm/slub.c:2972
nilfs_alloc_inode+0x19/0xd0 fs/nilfs2/super.c:154
alloc_inode fs/inode.c:233 [inline]
iget5_locked+0x9e/0x3d0 fs/inode.c:1154
nilfs_iget_locked+0x109/0x160 fs/nilfs2/inode.c:570
nilfs_ifile_read+0x2e/0x170 fs/nilfs2/ifile.c:187
nilfs_attach_checkpoint+0x229/0x4a0 fs/nilfs2/super.c:540
nilfs_fill_super fs/nilfs2/super.c:1063 [inline]
nilfs_mount+0xc50/0x1050 fs/nilfs2/super.c:1316
legacy_get_tree+0xea/0x180 fs/fs_context.c:610
vfs_get_tree+0x86/0x270 fs/super.c:1498
do_new_mount fs/namespace.c:2923 [inline]
path_mount+0x1981/0x2c10 fs/namespace.c:3253
do_mount fs/namespace.c:3266 [inline]
__do_sys_mount fs/namespace.c:3474 [inline]
__se_sys_mount+0x2f9/0x3b0 fs/namespace.c:3451
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae

Last potentially related work creation:
kasan_save_stack+0x27/0x50 mm/kasan/common.c:38
kasan_record_aux_stack+0xf1/0x130 mm/kasan/generic.c:348
__call_rcu kernel/rcu/tree.c:3029 [inline]
call_rcu+0x1a0/0xa20 kernel/rcu/tree.c:3109
nilfs_put_root+0xbd/0x110 fs/nilfs2/the_nilfs.c:803
nilfs_segctor_destroy fs/nilfs2/segment.c:2744 [inline]
nilfs_detach_log_writer+0x89c/0xbb0 fs/nilfs2/segment.c:2807
nilfs_put_super+0x4b/0x150 fs/nilfs2/super.c:467
generic_shutdown_super+0x12e/0x2b0 fs/super.c:465
kill_block_super+0x79/0xd0 fs/super.c:1395
deactivate_locked_super+0xa7/0xf0 fs/super.c:335
cleanup_mnt+0x462/0x510 fs/namespace.c:1136
task_work_run+0x146/0x1c0 kernel/task_work.c:164
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop kernel/entry/common.c:175 [inline]
exit_to_user_mode_prepare+0x201/0x220 kernel/entry/common.c:209
__syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:302
do_syscall_64+0x4c/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x44/0xae

Second to last potentially related work creation:
kasan_save_stack+0x27/0x50 mm/kasan/common.c:38
kasan_record_aux_stack+0xf1/0x130 mm/kasan/generic.c:348
__call_rcu kernel/rcu/tree.c:3029 [inline]
call_rcu+0x1a0/0xa20 kernel/rcu/tree.c:3109
nilfs_put_root+0xbd/0x110 fs/nilfs2/the_nilfs.c:803
nilfs_segctor_destroy fs/nilfs2/segment.c:2744 [inline]
nilfs_detach_log_writer+0x89c/0xbb0 fs/nilfs2/segment.c:2807
nilfs_put_super+0x4b/0x150 fs/nilfs2/super.c:467
generic_shutdown_super+0x12e/0x2b0 fs/super.c:465
kill_block_super+0x79/0xd0 fs/super.c:1395
deactivate_locked_super+0xa7/0xf0 fs/super.c:335
cleanup_mnt+0x462/0x510 fs/namespace.c:1136
task_work_run+0x146/0x1c0 kernel/task_work.c:164
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop kernel/entry/common.c:175 [inline]
exit_to_user_mode_prepare+0x201/0x220 kernel/entry/common.c:209
__syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:302
do_syscall_64+0x4c/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x44/0xae

The buggy address belongs to the object at ffff888081243368
which belongs to the cache nilfs2_inode_cache of size 1752
The buggy address is located 0 bytes to the right of
1752-byte region [ffff888081243368, ffff888081243a40)
The buggy address belongs to the page:
page:ffffea0002049000 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880812466d0 pfn:0x81240
head:ffffea0002049000 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0002263a00 0000000300000003 ffff88801c2dda00
raw: ffff8880812466d0 0000000080110001 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Reclaimable, gfp_mask 0xd2050(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_RECLAIMABLE), pid 22032, ts 473074821492, free_ts 403485095639
prep_new_page mm/page_alloc.c:2436 [inline]
get_page_from_freelist+0x779/0xa30 mm/page_alloc.c:4168
__alloc_pages+0x26c/0x5f0 mm/page_alloc.c:5390
alloc_slab_page mm/slub.c:1691 [inline]
allocate_slab+0xf1/0x540 mm/slub.c:1831
new_slab mm/slub.c:1894 [inline]
new_slab_objects mm/slub.c:2640 [inline]
___slab_alloc+0x1cf/0x350 mm/slub.c:2803
__slab_alloc mm/slub.c:2843 [inline]
slab_alloc_node mm/slub.c:2925 [inline]
slab_alloc mm/slub.c:2967 [inline]
kmem_cache_alloc+0x299/0x340 mm/slub.c:2972
nilfs_alloc_inode+0x19/0xd0 fs/nilfs2/super.c:154
alloc_inode fs/inode.c:233 [inline]
iget5_locked+0x9e/0x3d0 fs/inode.c:1154
nilfs_iget_locked+0x109/0x160 fs/nilfs2/inode.c:570
nilfs_dat_read+0xb9/0x270 fs/nilfs2/dat.c:483
nilfs_load_super_root fs/nilfs2/the_nilfs.c:120 [inline]
load_nilfs+0x3ca/0x12e0 fs/nilfs2/the_nilfs.c:269
nilfs_fill_super fs/nilfs2/super.c:1058 [inline]
nilfs_mount+0xa02/0x1050 fs/nilfs2/super.c:1316
legacy_get_tree+0xea/0x180 fs/fs_context.c:610
vfs_get_tree+0x86/0x270 fs/super.c:1498
do_new_mount fs/namespace.c:2923 [inline]
path_mount+0x1981/0x2c10 fs/namespace.c:3253
do_mount fs/namespace.c:3266 [inline]
__do_sys_mount fs/namespace.c:3474 [inline]
__se_sys_mount+0x2f9/0x3b0 fs/namespace.c:3451
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1346 [inline]
free_pcp_prepare+0xc29/0xd20 mm/page_alloc.c:1397
free_unref_page_prepare mm/page_alloc.c:3332 [inline]
free_unref_page+0x7e/0x550 mm/page_alloc.c:3411
free_slab mm/slub.c:1934 [inline]
discard_slab mm/slub.c:1940 [inline]
unfreeze_partials+0x18c/0x1e0 mm/slub.c:2421
put_cpu_partial+0xd2/0x210 mm/slub.c:2457
__slab_free+0x3a8/0x6b0 mm/slub.c:3107
do_slab_free mm/slub.c:3201 [inline]
___cache_free+0xfc/0x120 mm/slub.c:3220
qlist_free_all mm/kasan/quarantine.c:165 [inline]
kasan_quarantine_reduce+0x151/0x1c0 mm/kasan/quarantine.c:272
__kasan_slab_alloc+0x2f/0xd0 mm/kasan/common.c:444
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook mm/slab.h:519 [inline]
slab_alloc_node mm/slub.c:2959 [inline]
slab_alloc mm/slub.c:2967 [inline]
kmem_cache_alloc+0x1d1/0x340 mm/slub.c:2972
getname_flags+0xba/0x640 fs/namei.c:138
getname fs/namei.c:209 [inline]
user_path_create fs/namei.c:3660 [inline]
do_mkdirat+0x91/0x3e0 fs/namei.c:3838
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae

Memory state around the buggy address:
ffff888081243900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888081243980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888081243a00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
^
ffff888081243a80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
ffff888081243b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
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,
Dec 28, 2021, 2:13:16 AM12/28/21
to syzkaller-upst...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages