================================================================== BUG: KASAN: slab-use-after-free in xsk_bind+0x1582/0x16c0 net/xdp/xsk.c:1761 Read of size 4 at addr ffff888025c0498c by task syz.0.689/8512 CPU: 1 UID: 0 PID: 8512 Comm: syz.0.689 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595 xsk_bind+0x1582/0x16c0 net/xdp/xsk.c:1761 __sys_bind_socket net/socket.c:1945 [inline] __sys_bind_socket net/socket.c:1937 [inline] __sys_bind+0x1a9/0x260 net/socket.c:1976 __do_sys_bind net/socket.c:1981 [inline] __se_sys_bind net/socket.c:1979 [inline] __x64_sys_bind+0x72/0xb0 net/socket.c:1979 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f3642f9e0d9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3643f31028 EFLAGS: 00000246 ORIG_RAX: 0000000000000031 RAX: ffffffffffffffda RBX: 00007f3643225fa0 RCX: 00007f3642f9e0d9 RDX: 0000000000000010 RSI: 00002000000003c0 RDI: 0000000000000004 RBP: 00007f3643035024 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f3643226038 R14: 00007f3643225fa0 R15: 00007ffd883234f8 Allocated by task 5605: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5334 [inline] __kvmalloc_node_noprof+0x34f/0x970 mm/slub.c:6905 xt_alloc_table_info+0x44/0xa0 net/netfilter/x_tables.c:1286 do_replace net/ipv4/netfilter/ip_tables.c:1124 [inline] do_ipt_set_ctl+0x611/0xcf0 net/ipv4/netfilter/ip_tables.c:1634 nf_setsockopt+0x8d/0xf0 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0xcb/0xf0 net/ipv4/ip_sockglue.c:1424 tcp_setsockopt+0xa7/0x100 net/ipv4/tcp.c:4179 do_sock_setsockopt+0xf3/0x1d0 net/socket.c:2393 __sys_setsockopt+0x195/0x220 net/socket.c:2418 __do_sys_setsockopt net/socket.c:2424 [inline] __se_sys_setsockopt net/socket.c:2421 [inline] __x64_sys_setsockopt+0xbd/0x160 net/socket.c:2421 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5605: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2677 [inline] slab_free mm/slub.c:6377 [inline] kfree+0x22b/0x6c0 mm/slub.c:6692 __do_replace+0x71f/0x980 net/ipv4/netfilter/ip_tables.c:1082 do_replace net/ipv4/netfilter/ip_tables.c:1139 [inline] do_ipt_set_ctl+0xa53/0xcf0 net/ipv4/netfilter/ip_tables.c:1634 nf_setsockopt+0x8d/0xf0 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0xcb/0xf0 net/ipv4/ip_sockglue.c:1424 tcp_setsockopt+0xa7/0x100 net/ipv4/tcp.c:4179 do_sock_setsockopt+0xf3/0x1d0 net/socket.c:2393 __sys_setsockopt+0x195/0x220 net/socket.c:2418 __do_sys_setsockopt net/socket.c:2424 [inline] __se_sys_setsockopt net/socket.c:2421 [inline] __x64_sys_setsockopt+0xbd/0x160 net/socket.c:2421 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888025c04800 which belongs to the cache kmalloc-cg-1k of size 1024 The buggy address is located 396 bytes inside of freed 1024-byte region [ffff888025c04800, ffff888025c04c00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x25c00 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888032f1c801 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801c02d280 dead000000000100 dead000000000122 raw: 0000000000000000 0000000800100010 00000000f5000000 ffff888032f1c801 head: 00fff00000000040 ffff88801c02d280 dead000000000100 dead000000000122 head: 0000000000000000 0000000800100010 00000000f5000000 ffff888032f1c801 head: 00fff00000000003 fffffffffffffe01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 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), pid 5599, tgid 5599 (syz-executor), ts 82025724336, free_ts 48144509805 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1859 prep_new_page mm/page_alloc.c:1867 [inline] get_page_from_freelist+0xf48/0x3530 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x299/0x2dc0 mm/page_alloc.c:5304 alloc_slab_page mm/slub.c:3266 [inline] allocate_slab mm/slub.c:3380 [inline] new_slab+0xa2/0x640 mm/slub.c:3426 refill_objects+0xe3/0x410 mm/slub.c:7310 refill_sheaf mm/slub.c:2804 [inline] __pcs_replace_empty_main+0x376/0x680 mm/slub.c:4675 alloc_from_pcs mm/slub.c:4773 [inline] slab_alloc_node mm/slub.c:4905 [inline] __kmalloc_cache_noprof+0x479/0x6c0 mm/slub.c:5485 _kmalloc_noprof include/linux/slab.h:988 [inline] _kzalloc_noprof include/linux/slab.h:1309 [inline] nsim_queue_alloc+0x3c/0x140 drivers/net/netdevsim/netdev.c:715 nsim_queue_init drivers/net/netdevsim/netdev.c:1012 [inline] nsim_init_netdevsim drivers/net/netdevsim/netdev.c:1059 [inline] nsim_create+0xb13/0x1420 drivers/net/netdevsim/netdev.c:1152 __nsim_dev_port_add+0x3ba/0x8f0 drivers/net/netdevsim/dev.c:1509 nsim_dev_port_add_all drivers/net/netdevsim/dev.c:1570 [inline] nsim_drv_probe+0xdbd/0x13a0 drivers/net/netdevsim/dev.c:1731 call_driver_probe drivers/base/dd.c:628 [inline] really_probe+0x241/0xa60 drivers/base/dd.c:706 __driver_probe_device+0x20e/0x450 drivers/base/dd.c:868 driver_probe_device+0x4a/0x140 drivers/base/dd.c:898 __device_attach_driver+0x1df/0x320 drivers/base/dd.c:1026 bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500 page last free pid 5389 tgid 5389 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1406 [inline] __free_frozen_pages+0x79f/0x1090 mm/page_alloc.c:2950 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4584 [inline] slab_alloc_node mm/slub.c:4917 [inline] __do_kmalloc_node mm/slub.c:5333 [inline] __kmalloc_node_track_caller_noprof+0x2cd/0x830 mm/slub.c:5471 __kmemdup_nul mm/util.c:64 [inline] kstrdup+0x51/0xe0 mm/util.c:84 bprm_change_interp+0x82/0xf0 fs/exec.c:1566 load_script+0x4c9/0x780 fs/binfmt_script.c:125 search_binary_handler fs/exec.c:1756 [inline] exec_binprm fs/exec.c:1788 [inline] bprm_execve fs/exec.c:1844 [inline] bprm_execve+0x8cd/0x1940 fs/exec.c:1820 do_execveat_common.isra.0+0x4a5/0x580 fs/exec.c:1942 __do_sys_execve fs/exec.c:2015 [inline] __se_sys_execve fs/exec.c:2009 [inline] __x64_sys_execve+0x93/0xd0 fs/exec.c:2009 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888025c04880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888025c04900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888025c04980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888025c04a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888025c04a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================