================================================================== BUG: KASAN: stack-out-of-bounds in bpf_net_ctx_get_all_used_flush_lists include/linux/filter.h:837 [inline] BUG: KASAN: stack-out-of-bounds in xdp_do_check_flushed+0x41c/0x4e0 net/core/filter.c:4305 Read of size 4 at addr ffffc9000367fa50 by task syz.1.1730/11842 CPU: 0 UID: 0 PID: 11842 Comm: syz.1.1730 Not tainted 6.10.0-syzkaller-12881-g6342649c33d2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 bpf_net_ctx_get_all_used_flush_lists include/linux/filter.h:837 [inline] xdp_do_check_flushed+0x41c/0x4e0 net/core/filter.c:4305 __napi_poll.constprop.0+0xd1/0x550 net/core/dev.c:6774 napi_poll net/core/dev.c:6840 [inline] net_rx_action+0xa92/0x1010 net/core/dev.c:6962 handle_softirqs+0x216/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 common_interrupt+0xb0/0xd0 arch/x86/kernel/irq.c:278 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693 RIP: 0010:__sanitizer_cov_trace_pc+0x3f/0x60 kernel/kcov.c:213 Code: 01 ff 00 48 8b 34 24 74 0f f6 c4 01 74 35 8b 82 1c 16 00 00 85 c0 74 2b 8b 82 f8 15 00 00 83 f8 02 75 20 48 8b 8a 00 16 00 00 <8b> 92 fc 15 00 00 48 8b 01 48 83 c0 01 48 39 d0 73 07 48 89 01 48 RSP: 0018:ffffc9000367ee98 EFLAGS: 00000246 RAX: 0000000000000002 RBX: ffffffff9083d188 RCX: ffffc900094c9000 RDX: ffff88807b68bc00 RSI: ffffffff813cd3c3 RDI: 0000000000000006 RBP: ffffffff9083d188 R08: 0000000000000006 R09: ffffffff89284037 R10: ffffffff89283cc2 R11: 0000000000000000 R12: ffffffff89284037 R13: ffffffff89283cc2 R14: dffffc0000000000 R15: ffffffff9083d188 __orc_find+0x63/0x130 arch/x86/kernel/unwind_orc.c:104 orc_find arch/x86/kernel/unwind_orc.c:227 [inline] unwind_next_frame+0x335/0x23a0 arch/x86/kernel/unwind_orc.c:494 arch_stack_walk+0x100/0x170 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x95/0xd0 kernel/stacktrace.c:122 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kmalloc_noprof include/linux/slab.h:681 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] nf_tables_newflowtable+0x617/0x2260 net/netfilter/nf_tables_api.c:8670 nfnetlink_rcv_batch+0x1a19/0x24e0 net/netfilter/nfnetlink.c:522 nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:644 [inline] nfnetlink_rcv+0x3c3/0x430 net/netfilter/nfnetlink.c:662 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline] netlink_unicast+0x544/0x830 net/netlink/af_netlink.c:1357 netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1901 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] ____sys_sendmsg+0xab5/0xc90 net/socket.c:2597 ___sys_sendmsg+0x135/0x1e0 net/socket.c:2651 __sys_sendmsg+0x117/0x1f0 net/socket.c:2680 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fc5c2377299 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:00007fc5c305f048 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fc5c2505f80 RCX: 00007fc5c2377299 RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00007fc5c23e48e6 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fc5c2505f80 R15: 00007fffd33323e8 The buggy address belongs to stack of task syz.1.1730/11842 and is located at offset 16 in frame: netlink_sendmsg+0x0/0xd70 net/netlink/af_netlink.c:1329 This frame has 1 object: [32, 64) 'scm' The buggy address belongs to the virtual mapping at [ffffc90003678000, ffffc90003681000) created by: kernel_clone+0xfd/0x980 kernel/fork.c:2781 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801fd423e0 pfn:0x1fd42 memcg:ffff8880293c1782 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000 raw: ffff88801fd423e0 0000000000000000 00000001ffffffff ffff8880293c1782 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 9638, tgid 9638 (syz-executor), ts 684780635053, free_ts 682854754295 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3442 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4700 alloc_pages_mpol_noprof+0x275/0x610 mm/mempolicy.c:2263 vm_area_alloc_pages mm/vmalloc.c:3584 [inline] __vmalloc_area_node mm/vmalloc.c:3660 [inline] __vmalloc_node_range_noprof+0xa6a/0x1520 mm/vmalloc.c:3841 alloc_thread_stack_node kernel/fork.c:313 [inline] dup_task_struct kernel/fork.c:1113 [inline] copy_process+0x2f3b/0x8de0 kernel/fork.c:2204 kernel_clone+0xfd/0x980 kernel/fork.c:2781 __do_sys_clone+0xba/0x100 kernel/fork.c:2924 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 11690 tgid 11690 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_folios+0x9e9/0x1390 mm/page_alloc.c:2660 folios_put_refs+0x560/0x760 mm/swap.c:1039 free_pages_and_swap_cache+0x45f/0x510 mm/swap_state.c:335 __tlb_batch_free_encoded_pages+0xf9/0x290 mm/mmu_gather.c:136 tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:366 [inline] tlb_flush_mmu mm/mmu_gather.c:373 [inline] tlb_finish_mmu+0x168/0x7b0 mm/mmu_gather.c:465 exit_mmap+0x3d1/0xb20 mm/mmap.c:3425 __mmput+0x12a/0x480 kernel/fork.c:1345 mmput+0x62/0x70 kernel/fork.c:1367 exit_mm kernel/exit.c:571 [inline] do_exit+0x9bf/0x2bb0 kernel/exit.c:869 do_group_exit+0xd3/0x2a0 kernel/exit.c:1031 __do_sys_exit_group kernel/exit.c:1042 [inline] __se_sys_exit_group kernel/exit.c:1040 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1040 x64_sys_call+0x14a9/0x16a0 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffffc9000367f900: 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 ffffc9000367f980: f1 00 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 >ffffc9000367fa00: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 ^ ffffc9000367fa80: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000367fb00: 00 00 00 f1 f1 f1 f1 f1 f1 00 00 00 00 04 f3 f3 ================================================================== vkms_vblank_simulate: vblank timer overrun ---------------- Code disassembly (best guess): 0: 01 ff add %edi,%edi 2: 00 48 8b add %cl,-0x75(%rax) 5: 34 24 xor $0x24,%al 7: 74 0f je 0x18 9: f6 c4 01 test $0x1,%ah c: 74 35 je 0x43 e: 8b 82 1c 16 00 00 mov 0x161c(%rdx),%eax 14: 85 c0 test %eax,%eax 16: 74 2b je 0x43 18: 8b 82 f8 15 00 00 mov 0x15f8(%rdx),%eax 1e: 83 f8 02 cmp $0x2,%eax 21: 75 20 jne 0x43 23: 48 8b 8a 00 16 00 00 mov 0x1600(%rdx),%rcx * 2a: 8b 92 fc 15 00 00 mov 0x15fc(%rdx),%edx <-- trapping instruction 30: 48 8b 01 mov (%rcx),%rax 33: 48 83 c0 01 add $0x1,%rax 37: 48 39 d0 cmp %rdx,%rax 3a: 73 07 jae 0x43 3c: 48 89 01 mov %rax,(%rcx) 3f: 48 rex.W