================================================================== BUG: KASAN: slab-out-of-bounds in is_ctx_reg kernel/bpf/verifier.c:6185 [inline] BUG: KASAN: slab-out-of-bounds in atomic_ptr_type_ok+0x3d7/0x550 kernel/bpf/verifier.c:6223 Read of size 4 at addr ffff88805ad61690 by task syz.0.295/6985 CPU: 0 UID: 0 PID: 6985 Comm: syz.0.295 Not tainted 6.14.0-rc3-syzkaller-gf28214603dc6 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0x16e/0x5b0 mm/kasan/report.c:521 kasan_report+0x143/0x180 mm/kasan/report.c:634 is_ctx_reg kernel/bpf/verifier.c:6185 [inline] atomic_ptr_type_ok+0x3d7/0x550 kernel/bpf/verifier.c:6223 check_atomic_store kernel/bpf/verifier.c:7804 [inline] check_atomic kernel/bpf/verifier.c:7841 [inline] do_check+0x89dd/0xedd0 kernel/bpf/verifier.c:19334 do_check_common+0x1678/0x2080 kernel/bpf/verifier.c:22600 do_check_main kernel/bpf/verifier.c:22691 [inline] bpf_check+0x165c8/0x1cca0 kernel/bpf/verifier.c:23821 bpf_prog_load+0x1664/0x20e0 kernel/bpf/syscall.c:2967 __sys_bpf+0x4ea/0x820 kernel/bpf/syscall.c:5811 __do_sys_bpf kernel/bpf/syscall.c:5918 [inline] __se_sys_bpf kernel/bpf/syscall.c:5916 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5916 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:0x7fe9b518d169 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:00007fe9b5f33038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007fe9b53a5fa0 RCX: 00007fe9b518d169 RDX: 0000000000000094 RSI: 00004000000009c0 RDI: 0000000000000005 RBP: 00007fe9b520e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007fe9b53a5fa0 R15: 00007ffe7aa4d838 Allocated by task 6985: 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:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x243/0x390 mm/slub.c:4325 kmalloc_noprof include/linux/slab.h:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] do_check_common+0x1ec/0x2080 kernel/bpf/verifier.c:22499 do_check_main kernel/bpf/verifier.c:22691 [inline] bpf_check+0x165c8/0x1cca0 kernel/bpf/verifier.c:23821 bpf_prog_load+0x1664/0x20e0 kernel/bpf/syscall.c:2967 __sys_bpf+0x4ea/0x820 kernel/bpf/syscall.c:5811 __do_sys_bpf kernel/bpf/syscall.c:5918 [inline] __se_sys_bpf kernel/bpf/syscall.c:5916 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5916 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 The buggy address belongs to the object at ffff88805ad61000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 312 bytes to the right of allocated 1368-byte region [ffff88805ad61000, ffff88805ad61558) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5ad60 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b042000 ffffea00016fe200 dead000000000002 raw: 0000000000000000 0000000080080008 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b042000 ffffea00016fe200 dead000000000002 head: 0000000000000000 0000000080080008 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea00016b5801 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 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), pid 5837, tgid 5837 (syz-executor), ts 74727724287, free_ts 17286093720 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1585 prep_new_page mm/page_alloc.c:1593 [inline] get_page_from_freelist+0x3a8c/0x3c20 mm/page_alloc.c:3538 __alloc_frozen_pages_noprof+0x264/0x580 mm/page_alloc.c:4805 alloc_pages_mpol+0x311/0x660 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab+0x8f/0x3a0 mm/slub.c:2587 new_slab mm/slub.c:2640 [inline] ___slab_alloc+0xc27/0x14a0 mm/slub.c:3826 __slab_alloc+0x58/0xa0 mm/slub.c:3916 __slab_alloc_node mm/slub.c:3991 [inline] slab_alloc_node mm/slub.c:4152 [inline] __kmalloc_cache_noprof+0x27b/0x390 mm/slub.c:4320 kmalloc_noprof include/linux/slab.h:901 [inline] rtnl_newlink+0x147/0x1d30 net/core/rtnetlink.c:3922 rtnetlink_rcv_msg+0x791/0xcf0 net/core/rtnetlink.c:6912 netlink_rcv_skb+0x206/0x480 net/netlink/af_netlink.c:2543 netlink_unicast_kernel net/netlink/af_netlink.c:1322 [inline] netlink_unicast+0x7f6/0x990 net/netlink/af_netlink.c:1348 netlink_sendmsg+0x8de/0xcb0 net/netlink/af_netlink.c:1892 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:733 __sys_sendto+0x363/0x4c0 net/socket.c:2187 __do_sys_sendto net/socket.c:2194 [inline] __se_sys_sendto net/socket.c:2190 [inline] __x64_sys_sendto+0xde/0x100 net/socket.c:2190 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1130 [inline] __free_frozen_pages+0xd7f/0x1020 mm/page_alloc.c:2707 __free_pages mm/page_alloc.c:4916 [inline] free_contig_range+0x14e/0x430 mm/page_alloc.c:6760 destroy_args+0x94/0x4b0 mm/debug_vm_pgtable.c:1017 debug_vm_pgtable+0x551/0x590 mm/debug_vm_pgtable.c:1397 do_one_initcall+0x248/0x930 init/main.c:1257 do_initcall_level+0x157/0x210 init/main.c:1319 do_initcalls+0x71/0xd0 init/main.c:1335 kernel_init_freeable+0x435/0x5d0 init/main.c:1568 kernel_init+0x1d/0x2b0 init/main.c:1457 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff88805ad61580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805ad61600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88805ad61680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88805ad61700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805ad61780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================