================================================================== BUG: KASAN: slab-out-of-bounds in dev_map_enqueue+0x40/0x340 kernel/bpf/devmap.c:529 Read of size 8 at addr ffff88812ea8c700 by task syz.3.14281/24376 CPU: 0 PID: 24376 Comm: syz.3.14281 Not tainted 6.1.90-syzkaller-00122-g7fa70ede91bb #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:427 kasan_report+0x13c/0x170 mm/kasan/report.c:531 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:351 dev_map_enqueue+0x40/0x340 kernel/bpf/devmap.c:529 __xdp_do_redirect_frame net/core/filter.c:4268 [inline] xdp_do_redirect_frame+0x285/0x750 net/core/filter.c:4330 xdp_test_run_batch net/bpf/test_run.c:314 [inline] bpf_test_run_xdp_live+0xc30/0x1f70 net/bpf/test_run.c:362 bpf_prog_test_run_xdp+0x7d1/0x1130 net/bpf/test_run.c:1387 bpf_prog_test_run+0x3b0/0x630 kernel/bpf/syscall.c:3650 __sys_bpf+0x59f/0x7f0 kernel/bpf/syscall.c:5005 __do_sys_bpf kernel/bpf/syscall.c:5091 [inline] __se_sys_bpf kernel/bpf/syscall.c:5089 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5089 x64_sys_call+0x87f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:322 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7eff82f77299 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:00007eff83d8a048 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007eff83105f80 RCX: 00007eff82f77299 RDX: 0000000000000050 RSI: 0000000020000240 RDI: 000000000000000a RBP: 00007eff82fe48e6 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007eff83105f80 R15: 00007ffcbdddd998 Allocated by task 22739: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505 __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:333 kasan_slab_alloc include/linux/kasan.h:202 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:768 slab_alloc_node mm/slub.c:3421 [inline] slab_alloc mm/slub.c:3429 [inline] __kmem_cache_alloc_lru mm/slub.c:3436 [inline] kmem_cache_alloc+0x175/0x2c0 mm/slub.c:3445 vma_lock_alloc kernel/fork.c:468 [inline] vm_area_dup+0x65/0x290 kernel/fork.c:521 dup_mmap kernel/fork.c:725 [inline] dup_mm kernel/fork.c:1641 [inline] copy_mm+0xcec/0x1b70 kernel/fork.c:1690 copy_process+0x12b6/0x3530 kernel/fork.c:2370 kernel_clone+0x229/0x890 kernel/fork.c:2786 __do_sys_clone kernel/fork.c:2929 [inline] __se_sys_clone kernel/fork.c:2913 [inline] __x64_sys_clone+0x231/0x280 kernel/fork.c:2913 x64_sys_call+0x1b0/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:57 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Freed by task 24131: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0x131/0x180 mm/kasan/common.c:241 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:249 kasan_slab_free include/linux/kasan.h:178 [inline] slab_free_hook mm/slub.c:1745 [inline] slab_free_freelist_hook mm/slub.c:1771 [inline] slab_free mm/slub.c:3684 [inline] kmem_cache_free+0x291/0x510 mm/slub.c:3706 vma_lock_free kernel/fork.c:480 [inline] __vm_area_free+0x74/0x130 kernel/fork.c:534 remove_vma mm/mmap.c:149 [inline] exit_mmap+0x547/0x940 mm/mmap.c:3358 __mmput+0x95/0x310 kernel/fork.c:1298 mmput+0x56/0x170 kernel/fork.c:1321 exit_mm kernel/exit.c:566 [inline] do_exit+0xb29/0x2b80 kernel/exit.c:862 do_group_exit+0x21a/0x2d0 kernel/exit.c:1025 get_signal+0x169d/0x1820 kernel/signal.c:2880 arch_do_signal_or_restart+0xb0/0x16f0 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x74/0xa0 kernel/entry/common.c:174 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline] syscall_exit_to_user_mode+0x26/0x130 kernel/entry/common.c:303 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:87 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff88812ea8c6c0 which belongs to the cache vma_lock of size 64 The buggy address is located 0 bytes to the right of 64-byte region [ffff88812ea8c6c0, ffff88812ea8c700) The buggy address belongs to the physical page: page:ffffea0004baa300 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88812ea8c720 pfn:0x12ea8c flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 ffffea00045d23c8 ffffea00046c4688 ffff8881002b1200 raw: ffff88812ea8c720 00000000002a001e 00000001ffffffff 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 24297, tgid 24297 (syz-executor), ts 2427447330291, free_ts 2427386643727 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:2590 prep_new_page+0x1b/0x110 mm/page_alloc.c:2597 get_page_from_freelist+0x27ea/0x2870 mm/page_alloc.c:4425 __alloc_pages+0x3a1/0x780 mm/page_alloc.c:5714 alloc_slab_page+0x6c/0xf0 allocate_slab mm/slub.c:1962 [inline] new_slab+0x90/0x3e0 mm/slub.c:2015 ___slab_alloc+0x6f9/0xb80 mm/slub.c:3203 __slab_alloc+0x5d/0xa0 mm/slub.c:3302 slab_alloc_node mm/slub.c:3387 [inline] slab_alloc mm/slub.c:3429 [inline] __kmem_cache_alloc_lru mm/slub.c:3436 [inline] kmem_cache_alloc+0x1b9/0x2c0 mm/slub.c:3445 vma_lock_alloc kernel/fork.c:468 [inline] vm_area_dup+0x65/0x290 kernel/fork.c:521 dup_mmap kernel/fork.c:725 [inline] dup_mm kernel/fork.c:1641 [inline] copy_mm+0xcec/0x1b70 kernel/fork.c:1690 copy_process+0x12b6/0x3530 kernel/fork.c:2370 kernel_clone+0x229/0x890 kernel/fork.c:2786 __do_sys_clone kernel/fork.c:2929 [inline] __se_sys_clone kernel/fork.c:2913 [inline] __x64_sys_clone+0x231/0x280 kernel/fork.c:2913 x64_sys_call+0x1b0/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:57 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1498 [inline] free_pcp_prepare mm/page_alloc.c:1572 [inline] free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3498 free_unref_page_list+0xf1/0x7b0 mm/page_alloc.c:3646 release_pages+0xf7f/0xfe0 mm/swap.c:1063 free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:315 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline] tlb_flush_mmu_free mm/mmu_gather.c:254 [inline] tlb_flush_mmu mm/mmu_gather.c:261 [inline] tlb_finish_mmu+0x1e0/0x3f0 mm/mmu_gather.c:361 exit_mmap+0x421/0x940 mm/mmap.c:3348 __mmput+0x95/0x310 kernel/fork.c:1298 mmput+0x56/0x170 kernel/fork.c:1321 exit_mm kernel/exit.c:566 [inline] do_exit+0xb29/0x2b80 kernel/exit.c:862 __do_sys_exit kernel/exit.c:992 [inline] __se_sys_exit kernel/exit.c:990 [inline] __ia32_sys_exit+0x0/0x40 kernel/exit.c:990 x64_sys_call+0x1cc/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:61 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff88812ea8c600: fa fb fb fb fb fb fb fb fc fc fc fc fa fb fb fb ffff88812ea8c680: fb fb fb fb fc fc fc fc fa fb fb fb fb fb fb fb >ffff88812ea8c700: fc fc fc fc fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88812ea8c780: fb fb fb fb fb fb fb fb fc fc fc fc fa fb fb fb ffff88812ea8c800: fb fb fb fb fc fc fc fc fb fb fb fb fb fb fb fb ================================================================== general protection fault, probably for non-canonical address 0xe08f9c1e00000b34: 0000 [#1] PREEMPT SMP KASAN KASAN: maybe wild-memory-access in range [0x047d00f0000059a0-0x047d00f0000059a7] CPU: 0 PID: 24376 Comm: syz.3.14281 Tainted: G B 6.1.90-syzkaller-00122-g7fa70ede91bb #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 RIP: 0010:__xdp_enqueue kernel/bpf/devmap.c:478 [inline] RIP: 0010:dev_map_enqueue+0x72/0x340 kernel/bpf/devmap.c:531 Code: 89 d8 48 c1 e8 03 42 80 3c 20 00 74 08 48 89 df e8 d3 37 25 00 48 8b 03 48 89 45 c8 4d 8d ae d0 00 00 00 4c 89 e8 48 c1 e8 03 <42> 80 3c 20 00 74 08 4c 89 ef e8 af 37 25 00 bb 20 02 00 00 49 03 RSP: 0018:ffffc9000244f608 EFLAGS: 00010202 RAX: 008fa01e00000b34 RBX: ffff88812ea8c720 RCX: ffffffff8197885d RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88812ea8c720 RBP: ffffc9000244f648 R08: ffffffff814495f3 R09: fffffbfff0f2d6fd R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000 R13: 047d00f0000059a3 R14: 047d00f0000058d3 R15: ffff888114906070 FS: 00007eff83d8a6c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000000127019000 CR4: 00000000003506b0 Call Trace: __xdp_do_redirect_frame net/core/filter.c:4268 [inline] xdp_do_redirect_frame+0x285/0x750 net/core/filter.c:4330 xdp_test_run_batch net/bpf/test_run.c:314 [inline] bpf_test_run_xdp_live+0xc30/0x1f70 net/bpf/test_run.c:362 bpf_prog_test_run_xdp+0x7d1/0x1130 net/bpf/test_run.c:1387 bpf_prog_test_run+0x3b0/0x630 kernel/bpf/syscall.c:3650 __sys_bpf+0x59f/0x7f0 kernel/bpf/syscall.c:5005 __do_sys_bpf kernel/bpf/syscall.c:5091 [inline] __se_sys_bpf kernel/bpf/syscall.c:5089 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5089 x64_sys_call+0x87f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:322 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7eff82f77299 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:00007eff83d8a048 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007eff83105f80 RCX: 00007eff82f77299 RDX: 0000000000000050 RSI: 0000000020000240 RDI: 000000000000000a RBP: 00007eff82fe48e6 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007eff83105f80 R15: 00007ffcbdddd998 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:__xdp_enqueue kernel/bpf/devmap.c:478 [inline] RIP: 0010:dev_map_enqueue+0x72/0x340 kernel/bpf/devmap.c:531 Code: 89 d8 48 c1 e8 03 42 80 3c 20 00 74 08 48 89 df e8 d3 37 25 00 48 8b 03 48 89 45 c8 4d 8d ae d0 00 00 00 4c 89 e8 48 c1 e8 03 <42> 80 3c 20 00 74 08 4c 89 ef e8 af 37 25 00 bb 20 02 00 00 49 03 RSP: 0018:ffffc9000244f608 EFLAGS: 00010202 RAX: 008fa01e00000b34 RBX: ffff88812ea8c720 RCX: ffffffff8197885d RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88812ea8c720 RBP: ffffc9000244f648 R08: ffffffff814495f3 R09: fffffbfff0f2d6fd R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000 R13: 047d00f0000059a3 R14: 047d00f0000058d3 R15: ffff888114906070 FS: 00007eff83d8a6c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000000127019000 CR4: 00000000003506b0 ---------------- Code disassembly (best guess): 0: 89 d8 mov %ebx,%eax 2: 48 c1 e8 03 shr $0x3,%rax 6: 42 80 3c 20 00 cmpb $0x0,(%rax,%r12,1) b: 74 08 je 0x15 d: 48 89 df mov %rbx,%rdi 10: e8 d3 37 25 00 call 0x2537e8 15: 48 8b 03 mov (%rbx),%rax 18: 48 89 45 c8 mov %rax,-0x38(%rbp) 1c: 4d 8d ae d0 00 00 00 lea 0xd0(%r14),%r13 23: 4c 89 e8 mov %r13,%rax 26: 48 c1 e8 03 shr $0x3,%rax * 2a: 42 80 3c 20 00 cmpb $0x0,(%rax,%r12,1) <-- trapping instruction 2f: 74 08 je 0x39 31: 4c 89 ef mov %r13,%rdi 34: e8 af 37 25 00 call 0x2537e8 39: bb 20 02 00 00 mov $0x220,%ebx 3e: 49 rex.WB 3f: 03 .byte 0x3