================================================================== BUG: KASAN: slab-use-after-free in smk_access+0xae/0x4e0 security/smack/smack_access.c:147 Read of size 8 at addr ffff888029a20340 by task syz.2.660/8988 CPU: 1 UID: 60929 PID: 8988 Comm: syz.2.660 Not tainted 6.11.0-syzkaller-04557-g2f27fce67173 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 smk_access+0xae/0x4e0 security/smack/smack_access.c:147 smack_watch_key+0x2f4/0x3a0 security/smack/smack_lsm.c:4656 security_watch_key+0x86/0x250 security/security.c:4448 keyctl_watch_key+0x2b7/0x480 security/keys/keyctl.c:1813 __do_sys_keyctl security/keys/keyctl.c:2021 [inline] __se_sys_keyctl+0x106/0xa50 security/keys/keyctl.c:1874 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f4cf1b7def9 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f4cf2960038 EFLAGS: 00000246 ORIG_RAX: 00000000000000fa RAX: ffffffffffffffda RBX: 00007f4cf1d35f80 RCX: 00007f4cf1b7def9 RDX: 0000000000000005 RSI: 000000000aee58ae RDI: 0000000000000020 RBP: 00007f4cf1bf0b76 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f4cf1d35f80 R15: 00007ffed9987b18 Allocated by task 7609: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:4159 [inline] __kmalloc_node_track_caller_noprof+0x225/0x440 mm/slub.c:4178 kmemdup_noprof+0x2a/0x60 mm/util.c:133 dccp_feat_clone_sp_val net/dccp/feat.c:371 [inline] __feat_register_sp+0x3c3/0x640 net/dccp/feat.c:737 dccp_feat_init+0xefd/0x1390 net/dccp/feat.c:1498 dccp_v6_init_sock+0x1f/0xb0 net/dccp/ipv6.c:1026 inet6_create+0xd7a/0x1100 net/ipv6/af_inet6.c:261 __sock_create+0x490/0x920 net/socket.c:1577 inet_ctl_sock_create+0xc2/0x250 net/ipv4/af_inet.c:1649 ops_init+0x31e/0x590 net/core/net_namespace.c:139 setup_net+0x287/0x9e0 net/core/net_namespace.c:356 copy_net_ns+0x33f/0x570 net/core/net_namespace.c:494 create_new_namespaces+0x425/0x7b0 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x124/0x180 kernel/nsproxy.c:228 ksys_unshare+0x619/0xc10 kernel/fork.c:3309 __do_sys_unshare kernel/fork.c:3380 [inline] __se_sys_unshare kernel/fork.c:3378 [inline] __x64_sys_unshare+0x38/0x40 kernel/fork.c:3378 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 11: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2250 [inline] slab_free mm/slub.c:4474 [inline] kfree+0x149/0x360 mm/slub.c:4595 dccp_feat_val_destructor net/dccp/feat.c:385 [inline] dccp_feat_entry_destructor net/dccp/feat.c:414 [inline] dccp_feat_list_purge+0x148/0x1f0 net/dccp/feat.c:546 inet_csk_destroy_sock+0x15b/0x380 net/ipv4/inet_connection_sock.c:1292 dccp_close+0xd16/0x1070 net/dccp/proto.c:1078 inet_release+0x17d/0x200 net/ipv4/af_inet.c:437 __sock_release net/socket.c:659 [inline] sock_release+0x82/0x150 net/socket.c:687 ops_exit_list net/core/net_namespace.c:173 [inline] cleanup_net+0x802/0xcc0 net/core/net_namespace.c:626 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x870/0xd30 kernel/workqueue.c:3393 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff888029a20340 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes inside of freed 8-byte region [ffff888029a20340, ffff888029a20348) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x29a20 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000000 ffff88801a841500 dead000000000100 dead000000000122 raw: 0000000000000000 0000000080800080 00000001fdffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 1, tgid 1 (swapper/0), ts 8186370233, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1500 prep_new_page mm/page_alloc.c:1508 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3446 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4702 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2319 allocate_slab+0x5a/0x2f0 mm/slub.c:2482 new_slab mm/slub.c:2535 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3721 __slab_alloc+0x58/0xa0 mm/slub.c:3811 __slab_alloc_node mm/slub.c:3864 [inline] slab_alloc_node mm/slub.c:4026 [inline] __kmalloc_cache_noprof+0x1d5/0x2c0 mm/slub.c:4185 kmalloc_noprof include/linux/slab.h:690 [inline] usb_control_msg+0xbb/0x4c0 drivers/usb/core/message.c:144 hub_power_on+0x1de/0x460 hub_activate+0x3cd/0x1c80 drivers/usb/core/hub.c:1135 hub_configure drivers/usb/core/hub.c:1742 [inline] hub_probe+0x274f/0x3640 drivers/usb/core/hub.c:1965 usb_probe_interface+0x645/0xbb0 drivers/usb/core/driver.c:399 really_probe+0x2b8/0xad0 drivers/base/dd.c:657 __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:799 driver_probe_device+0x50/0x430 drivers/base/dd.c:829 page_owner free stack trace missing Memory state around the buggy address: ffff888029a20200: fa fc fc fc 01 fc fc fc fa fc fc fc fa fc fc fc ffff888029a20280: 00 fc fc fc fa fc fc fc fa fc fc fc fa fc fc fc >ffff888029a20300: 05 fc fc fc 00 fc fc fc fa fc fc fc 06 fc fc fc ^ ffff888029a20380: 06 fc fc fc 06 fc fc fc fa fc fc fc fa fc fc fc ffff888029a20400: 00 fc fc fc 00 fc fc fc fa fc fc fc fa fc fc fc ==================================================================