================================================================== BUG: KASAN: use-after-free in do_last fs/namei.c:3406 [inline] BUG: KASAN: use-after-free in path_openat+0x1ccd/0x34b0 fs/namei.c:3683 Read of size 4 at addr ffff8881dae8701c by task syz-executor.2/32550 CPU: 0 PID: 32550 Comm: syz-executor.2 Not tainted 5.4.274-syzkaller-04911-g6f97bd951d82 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x600 mm/kasan/report.c:384 __kasan_report+0xf3/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 do_last fs/namei.c:3406 [inline] path_openat+0x1ccd/0x34b0 fs/namei.c:3683 do_filp_open+0x20b/0x450 fs/namei.c:3713 do_sys_open+0x39c/0x810 fs/open.c:1123 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x456e69 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 b4 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2de46150d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 000000000055c038 RCX: 0000000000456e69 RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000000000003 RBP: 00000000004b0cab R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004b02b7 R13: 000000000000006e R14: 000000000055c038 R15: 00007ffe73261928 Allocated by task 32550: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x171/0x210 mm/kasan/common.c:529 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:690 [inline] alloc_inode+0x43/0x70 fs/incfs/vfs.c:1569 alloc_inode fs/inode.c:231 [inline] iget5_locked+0x9c/0x260 fs/inode.c:1189 fetch_regular_inode+0x256/0x320 fs/incfs/vfs.c:377 incfs_mount_fs+0x5c3/0xa00 fs/incfs/vfs.c:1864 legacy_get_tree+0xdf/0x170 fs/fs_context.c:648 vfs_get_tree+0x85/0x260 fs/super.c:1556 do_new_mount+0x292/0x570 fs/namespace.c:2843 do_mount+0x688/0xe10 fs/namespace.c:3163 ksys_mount+0xc2/0xf0 fs/namespace.c:3372 __do_sys_mount fs/namespace.c:3386 [inline] __se_sys_mount fs/namespace.c:3383 [inline] __x64_sys_mount+0xb1/0xc0 fs/namespace.c:3383 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Freed by task 32534: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:345 [inline] __kasan_slab_free+0x1b5/0x270 mm/kasan/common.c:487 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook mm/slub.c:1494 [inline] slab_free mm/slub.c:3080 [inline] kfree+0x123/0x370 mm/slub.c:4071 destroy_inode fs/inode.c:281 [inline] evict+0x59d/0x6a0 fs/inode.c:592 dispose_list fs/inode.c:610 [inline] evict_inodes+0x5e1/0x660 fs/inode.c:660 generic_shutdown_super+0x94/0x2a0 fs/super.c:454 kill_anon_super+0x37/0x60 fs/super.c:1117 incfs_kill_sb+0x4c/0x200 fs/incfs/vfs.c:1936 deactivate_locked_super+0xa8/0x110 fs/super.c:335 deactivate_super+0x1e2/0x2a0 fs/super.c:366 cleanup_mnt+0x44e/0x500 fs/namespace.c:1102 task_work_run+0x140/0x170 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x190/0x1a0 arch/x86/entry/common.c:163 prepare_exit_to_usermode+0x199/0x200 arch/x86/entry/common.c:194 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 The buggy address belongs to the object at ffff8881dae87000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 28 bytes inside of 1024-byte region [ffff8881dae87000, ffff8881dae87400) The buggy address belongs to the page: page:ffffea00076ba000 refcount:1 mapcount:0 mapping:ffff8881f5c02280 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 ffffea0007a7e800 0000000700000002 ffff8881f5c02280 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x18f/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4893 alloc_slab_page+0x39/0x3c0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x97/0x440 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x2fe/0x490 mm/slub.c:2667 __slab_alloc+0x62/0xa0 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] __kmalloc+0x19b/0x2e0 mm/slub.c:3909 kmalloc_array include/linux/slab.h:618 [inline] kcalloc include/linux/slab.h:629 [inline] veth_alloc_queues drivers/net/veth.c:957 [inline] veth_dev_init+0x1a9/0x340 drivers/net/veth.c:984 register_netdevice+0x1c0/0x12a0 net/core/dev.c:9120 veth_newlink+0x667/0xb50 drivers/net/veth.c:1302 __rtnl_newlink net/core/rtnetlink.c:3255 [inline] rtnl_newlink+0x1567/0x2060 net/core/rtnetlink.c:3314 rtnetlink_rcv_msg+0x983/0xc70 net/core/rtnetlink.c:5290 netlink_rcv_skb+0x1d5/0x420 net/netlink/af_netlink.c:2481 netlink_unicast_kernel net/netlink/af_netlink.c:1321 [inline] netlink_unicast+0x936/0xb20 net/netlink/af_netlink.c:1347 netlink_sendmsg+0xa18/0xcf0 net/netlink/af_netlink.c:1915 page_owner free stack trace missing Memory state around the buggy address: ffff8881dae86f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881dae86f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881dae87000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881dae87080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881dae87100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================