================================================================== BUG: KASAN: use-after-free in selinux_inode_permission+0x59d/0x6a0 security/selinux/hooks.c:3134 Read of size 4 at addr ffff8881f45d0024 by task syz-executor.0/5656 CPU: 1 PID: 5656 Comm: syz-executor.0 Not tainted 5.4.284-syzkaller-04988-g137306201ec6 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/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 selinux_inode_permission+0x59d/0x6a0 security/selinux/hooks.c:3134 security_inode_permission+0x9d/0xf0 security/security.c:1223 may_lookup fs/namei.c:1773 [inline] link_path_walk+0x1d1/0x1040 fs/namei.c:2159 path_openat+0x1a3/0x34b0 fs/namei.c:3682 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:00007f1c298f10d8 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: 00007ffd9714da28 Allocated by task 5656: 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:1224 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 5644: 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+0x80c/0x960 fs/inode.c:627 dispose_list fs/inode.c:645 [inline] evict_inodes+0x5e1/0x660 fs/inode.c:695 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 ffff8881f45d0000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 36 bytes inside of 1024-byte region [ffff8881f45d0000, ffff8881f45d0400) The buggy address belongs to the page: page:ffffea0007d17400 refcount:1 mapcount:0 mapping:ffff8881f5c02280 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 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_track_caller+0x16d/0x2b0 mm/slub.c:4449 __kmalloc_reserve net/core/skbuff.c:142 [inline] __alloc_skb+0xb4/0x4d0 net/core/skbuff.c:210 alloc_skb include/linux/skbuff.h:1080 [inline] alloc_uevent_skb+0x74/0x220 lib/kobject_uevent.c:290 uevent_net_broadcast_tagged lib/kobject_uevent.c:351 [inline] kobject_uevent_net_broadcast+0x176/0x560 lib/kobject_uevent.c:412 kobject_uevent_env+0x54d/0x710 lib/kobject_uevent.c:608 device_add+0x797/0xbb0 drivers/base/core.c:2895 netdev_register_kobject+0x176/0x310 net/core/net-sysfs.c:1854 register_netdevice+0xbc5/0x12a0 net/core/dev.c:9190 __ip_tunnel_create+0x2b0/0x370 net/ipv4/ip_tunnel.c:267 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] __free_pages_ok+0x847/0x950 mm/page_alloc.c:1438 free_the_page mm/page_alloc.c:4955 [inline] __free_pages+0x91/0x140 mm/page_alloc.c:4961 __free_slab+0x221/0x2e0 mm/slub.c:1774 free_slab mm/slub.c:1789 [inline] discard_slab mm/slub.c:1795 [inline] unfreeze_partials+0x14e/0x180 mm/slub.c:2288 put_cpu_partial+0x44/0x180 mm/slub.c:2324 __slab_free+0x297/0x360 mm/slub.c:2971 qlist_free_all+0x43/0xb0 mm/kasan/quarantine.c:167 quarantine_reduce+0x1d9/0x210 mm/kasan/quarantine.c:260 __kasan_kmalloc+0x41/0x210 mm/kasan/common.c:507 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0xd9/0x250 mm/slub.c:2842 create_nsproxy kernel/nsproxy.c:49 [inline] create_new_namespaces+0x31/0x570 kernel/nsproxy.c:67 unshare_nsproxy_namespaces+0x119/0x170 kernel/nsproxy.c:202 ksys_unshare+0x544/0x990 kernel/fork.c:2908 __do_sys_unshare kernel/fork.c:2976 [inline] __se_sys_unshare kernel/fork.c:2974 [inline] __x64_sys_unshare+0x34/0x40 kernel/fork.c:2974 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Memory state around the buggy address: ffff8881f45cff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881f45cff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881f45d0000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881f45d0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881f45d0100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================