================================================================== BUG: KASAN: use-after-free in io_uring_show_cred+0x26e/0x4f0 fs/io_uring.c:8921 Read of size 8 at addr ffff888029d7fb20 by task syz-executor.2/19226 CPU: 1 PID: 19226 Comm: syz-executor.2 Not tainted 5.10.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x137/0x1be lib/dump_stack.c:118 print_address_description+0x6c/0x660 mm/kasan/report.c:385 __kasan_report mm/kasan/report.c:545 [inline] kasan_report+0x136/0x1e0 mm/kasan/report.c:562 io_uring_show_cred+0x26e/0x4f0 fs/io_uring.c:8921 idr_for_each+0x16b/0x260 lib/idr.c:208 __io_uring_show_fdinfo fs/io_uring.c:8974 [inline] io_uring_show_fdinfo+0x63f/0x990 fs/io_uring.c:8996 seq_show+0x559/0x610 fs/proc/fd.c:65 seq_read+0x41a/0xcd0 fs/seq_file.c:208 do_loop_readv_writev fs/read_write.c:761 [inline] do_iter_read+0x48e/0x660 fs/read_write.c:803 vfs_readv fs/read_write.c:921 [inline] do_preadv+0x17b/0x290 fs/read_write.c:1013 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45deb9 Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f9c591fec78 EFLAGS: 00000246 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 0000000000025e40 RCX: 000000000045deb9 RDX: 0000000000000333 RSI: 00000000200017c0 RDI: 0000000000000005 RBP: 000000000118c018 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bfd4 R13: 00007ffd121648cf R14: 00007f9c591ff9c0 R15: 000000000118bfd4 Allocated by task 8470: kasan_save_stack mm/kasan/common.c:48 [inline] kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc+0x111/0x140 mm/kasan/common.c:461 __kmalloc+0x170/0x290 mm/slub.c:3970 kmalloc include/linux/slab.h:557 [inline] kzalloc include/linux/slab.h:664 [inline] tomoyo_encode2+0x25a/0x560 security/tomoyo/realpath.c:45 tomoyo_encode security/tomoyo/realpath.c:80 [inline] tomoyo_realpath_from_path+0x5c6/0x620 security/tomoyo/realpath.c:288 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x191/0x570 security/tomoyo/file.c:822 security_inode_getattr+0xc0/0x140 security/security.c:1279 vfs_getattr fs/stat.c:121 [inline] vfs_statx+0xe8/0x320 fs/stat.c:189 vfs_fstatat fs/stat.c:207 [inline] vfs_lstat include/linux/fs.h:3109 [inline] __do_sys_newlstat fs/stat.c:362 [inline] __se_sys_newlstat fs/stat.c:356 [inline] __x64_sys_newlstat+0x81/0xd0 fs/stat.c:356 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff888029d7fb00 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 32 bytes inside of 96-byte region [ffff888029d7fb00, ffff888029d7fb60) The buggy address belongs to the page: page:00000000e41c9eed refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x29d7f flags: 0xfff00000000200(slab) raw: 00fff00000000200 ffffea0000a52440 0000000800000008 ffff888010441780 raw: 0000000000000000 0000000080200020 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888029d7fa00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff888029d7fa80: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc >ffff888029d7fb00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff888029d7fb80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff888029d7fc00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ==================================================================