================================================================== BUG: KASAN: slab-out-of-bounds in vsscanf+0x2666/0x2ef0 lib/vsprintf.c:3321 Read of size 1 at addr ffff888097990d18 by task syz-executor.0/6164 CPU: 1 PID: 6164 Comm: syz-executor.0 Not tainted 5.8.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+0x1f0/0x31e lib/dump_stack.c:118 print_address_description+0x66/0x5a0 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report+0x132/0x1d0 mm/kasan/report.c:530 vsscanf+0x2666/0x2ef0 lib/vsprintf.c:3321 sscanf+0x6c/0x90 lib/vsprintf.c:3527 smk_set_cipso+0x374/0x6c0 security/smack/smackfs.c:908 __vfs_write+0x9c/0x6e0 fs/read_write.c:495 vfs_write+0x274/0x580 fs/read_write.c:559 ksys_write+0x11b/0x220 fs/read_write.c:612 do_syscall_64+0x73/0xe0 arch/x86/entry/common.c:359 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45cb19 Code: Bad RIP value. RSP: 002b:00007f0bb8b81c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000050e840 RCX: 000000000045cb19 RDX: 0000000000000017 RSI: 0000000020000140 RDI: 0000000000000003 RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000d49 R14: 00000000004cfa53 R15: 00007f0bb8b826d4 Allocated by task 6164: save_stack mm/kasan/common.c:48 [inline] set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc+0x103/0x140 mm/kasan/common.c:494 __do_kmalloc mm/slab.c:3656 [inline] __kmalloc_track_caller+0x249/0x320 mm/slab.c:3671 memdup_user_nul+0x26/0xf0 mm/util.c:259 smk_set_cipso+0xff/0x6c0 security/smack/smackfs.c:859 __vfs_write+0x9c/0x6e0 fs/read_write.c:495 vfs_write+0x274/0x580 fs/read_write.c:559 ksys_write+0x11b/0x220 fs/read_write.c:612 do_syscall_64+0x73/0xe0 arch/x86/entry/common.c:359 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 3883: save_stack mm/kasan/common.c:48 [inline] set_track mm/kasan/common.c:56 [inline] kasan_set_free_info mm/kasan/common.c:316 [inline] __kasan_slab_free+0x114/0x170 mm/kasan/common.c:455 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x220 mm/slab.c:3757 tomoyo_path_perm+0x59b/0x740 security/tomoyo/file.c:842 security_inode_getattr+0xc0/0x140 security/security.c:1278 vfs_getattr fs/stat.c:121 [inline] vfs_statx+0x118/0x380 fs/stat.c:206 vfs_lstat include/linux/fs.h:3301 [inline] __do_sys_newlstat fs/stat.c:374 [inline] __se_sys_newlstat fs/stat.c:368 [inline] __x64_sys_newlstat+0x81/0xd0 fs/stat.c:368 do_syscall_64+0x73/0xe0 arch/x86/entry/common.c:359 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff888097990d00 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 24 bytes inside of 32-byte region [ffff888097990d00, ffff888097990d20) The buggy address belongs to the page: page:ffffea00025e6400 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888097990fc1 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00023ff508 ffffea000277c308 ffff8880aa4001c0 raw: ffff888097990fc1 ffff888097990000 0000000100000039 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888097990c00: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff888097990c80: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc >ffff888097990d00: 00 00 00 fc fc fc fc fc fb fb fb fb fc fc fc fc ^ ffff888097990d80: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff888097990e00: 00 00 01 fc fc fc fc fc fb fb fb fb fc fc fc fc ==================================================================