================================================================== BUG: KASAN: use-after-free in squashfs_get_id+0x1ae/0x1d0 fs/squashfs/id.c:38 Read of size 8 at addr ffff888026eba910 by task syz-executor.3/18648 CPU: 3 PID: 18648 Comm: syz-executor.3 Not tainted 5.9.0-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x198/0x1fd lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x497 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 squashfs_get_id+0x1ae/0x1d0 fs/squashfs/id.c:38 squashfs_new_inode fs/squashfs/inode.c:55 [inline] squashfs_read_inode+0x1d3/0x1940 fs/squashfs/inode.c:120 squashfs_fill_super+0x1079/0x1ecf fs/squashfs/super.c:310 get_tree_bdev+0x421/0x740 fs/super.c:1342 vfs_get_tree+0x89/0x2f0 fs/super.c:1547 do_new_mount fs/namespace.c:2875 [inline] path_mount+0x1387/0x20a0 fs/namespace.c:3203 do_mount+0xf3/0x110 fs/namespace.c:3216 __do_compat_sys_mount fs/compat.c:122 [inline] __se_compat_sys_mount fs/compat.c:89 [inline] __ia32_compat_sys_mount+0x193/0x710 fs/compat.c:89 do_syscall_32_irqs_on arch/x86/entry/common.c:78 [inline] __do_fast_syscall_32+0x60/0x90 arch/x86/entry/common.c:137 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:160 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c RIP: 0023:0xf7fe5549 Code: 03 74 c0 01 10 05 03 74 b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 002b:00000000f55def00 EFLAGS: 00000292 ORIG_RAX: 0000000000000015 RAX: ffffffffffffffda RBX: 00000000f55def70 RCX: 0000000020000100 RDX: 0000000020000000 RSI: 0000000000000000 RDI: 00000000f55defb0 RBP: 00000000f55defb0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 11756: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:461 __do_kmalloc mm/slab.c:3659 [inline] __kmalloc+0x1b0/0x360 mm/slab.c:3668 kmalloc include/linux/slab.h:559 [inline] kzalloc include/linux/slab.h:666 [inline] tomoyo_encode2.part.0+0xe9/0x3a0 security/tomoyo/realpath.c:45 tomoyo_encode2 security/tomoyo/realpath.c:31 [inline] tomoyo_encode+0x28/0x50 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x186/0x620 security/tomoyo/realpath.c:288 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path2_perm+0x316/0x6b0 security/tomoyo/file.c:923 tomoyo_path_rename+0xd2/0x130 security/tomoyo/tomoyo.c:279 security_path_rename+0x1b5/0x2e0 security/security.c:1135 do_renameat2+0x481/0xbf0 fs/namei.c:4452 __do_sys_rename fs/namei.c:4502 [inline] __se_sys_rename fs/namei.c:4500 [inline] __x64_sys_rename+0x5d/0x80 fs/namei.c:4500 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 11756: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0xd8/0x120 mm/kasan/common.c:422 __cache_free mm/slab.c:3422 [inline] kfree+0x10e/0x2b0 mm/slab.c:3760 tomoyo_path2_perm+0x294/0x6b0 security/tomoyo/file.c:947 tomoyo_path_rename+0xd2/0x130 security/tomoyo/tomoyo.c:279 security_path_rename+0x1b5/0x2e0 security/security.c:1135 do_renameat2+0x481/0xbf0 fs/namei.c:4452 __do_sys_rename fs/namei.c:4502 [inline] __se_sys_rename fs/namei.c:4500 [inline] __x64_sys_rename+0x5d/0x80 fs/namei.c:4500 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 ffff888026eba900 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 16 bytes inside of 32-byte region [ffff888026eba900, ffff888026eba920) The buggy address belongs to the page: page:00000000aa8ea2da refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888026ebafc1 pfn:0x26eba flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea0000a34a88 ffffea0000694c48 ffff88802c840100 raw: ffff888026ebafc1 ffff888026eba000 000000010000003f ffff88801d74f801 page dumped because: kasan: bad access detected page->mem_cgroup:ffff88801d74f801 Memory state around the buggy address: ffff888026eba800: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc ffff888026eba880: fa fb fb fb fc fc fc fc 00 fc fc fc fc fc fc fc >ffff888026eba900: fa fb fb fb fc fc fc fc 00 00 fc fc fc fc fc fc ^ ffff888026eba980: fb fb fb fb fc fc fc fc 00 00 00 00 fc fc fc fc ffff888026ebaa00: 00 00 fc fc fc fc fc fc fa fb fb fb fc fc fc fc ==================================================================