================================================================== BUG: KASAN: slab-out-of-bounds in copy_array+0x8a/0xe8 kernel/bpf/verifier.c:1072 Write of size 88 at addr ff60000023cf7800 by task syz-executor.0/4443 CPU: 0 PID: 4443 Comm: syz-executor.0 Tainted: G W 6.2.0-rc1-syzkaller #0 Hardware name: riscv-virtio,qemu (DT) Call Trace: [] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:121 [] show_stack+0x34/0x40 arch/riscv/kernel/stacktrace.c:127 [] __dump_stack lib/dump_stack.c:88 [inline] [] dump_stack_lvl+0xe0/0x14c lib/dump_stack.c:106 [] print_address_description mm/kasan/report.c:306 [inline] [] print_report+0x1e4/0x4c0 mm/kasan/report.c:417 [] kasan_report+0xb8/0xe6 mm/kasan/report.c:517 [] check_region_inline mm/kasan/generic.c:173 [inline] [] kasan_check_range+0x32/0x148 mm/kasan/generic.c:189 [] memcpy+0x32/0x64 mm/kasan/shadow.c:66 [] copy_array+0x8a/0xe8 kernel/bpf/verifier.c:1072 [] copy_verifier_state+0x6c/0x462 kernel/bpf/verifier.c:1250 [] pop_stack kernel/bpf/verifier.c:1314 [inline] [] do_check kernel/bpf/verifier.c:14031 [inline] [] do_check_common+0x397a/0x6608 kernel/bpf/verifier.c:16289 [] do_check_main kernel/bpf/verifier.c:16352 [inline] [] bpf_check+0x45b2/0x5a5a kernel/bpf/verifier.c:16936 [] bpf_prog_load+0xc90/0x12b0 kernel/bpf/syscall.c:2619 [] __sys_bpf+0x622/0x31d2 kernel/bpf/syscall.c:4979 [] __do_sys_bpf kernel/bpf/syscall.c:5083 [inline] [] sys_bpf+0x28/0x36 kernel/bpf/syscall.c:5081 [] ret_from_syscall+0x0/0x2 Allocated by task 4443: stack_trace_save+0xa6/0xd8 kernel/stacktrace.c:122 kasan_save_stack+0x2c/0x5a mm/kasan/common.c:45 kasan_set_track+0x1a/0x26 mm/kasan/common.c:52 kasan_save_alloc_info+0x1a/0x24 mm/kasan/generic.c:507 ____kasan_kmalloc mm/kasan/common.c:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_krealloc+0xfa/0x11a mm/kasan/common.c:439 kasan_krealloc include/linux/kasan.h:231 [inline] __do_krealloc mm/slab_common.c:1361 [inline] krealloc+0x82/0xae mm/slab_common.c:1398 push_jmp_history+0xd2/0x140 kernel/bpf/verifier.c:2592 is_state_visited kernel/bpf/verifier.c:13552 [inline] do_check kernel/bpf/verifier.c:13752 [inline] do_check_common+0x47be/0x6608 kernel/bpf/verifier.c:16289 do_check_main kernel/bpf/verifier.c:16352 [inline] bpf_check+0x45b2/0x5a5a kernel/bpf/verifier.c:16936 bpf_prog_load+0xc90/0x12b0 kernel/bpf/syscall.c:2619 __sys_bpf+0x622/0x31d2 kernel/bpf/syscall.c:4979 __do_sys_bpf kernel/bpf/syscall.c:5083 [inline] sys_bpf+0x28/0x36 kernel/bpf/syscall.c:5081 ret_from_syscall+0x0/0x2 Last potentially related work creation: stack_trace_save+0xa6/0xd8 kernel/stacktrace.c:122 kasan_save_stack+0x2c/0x5a mm/kasan/common.c:45 __kasan_record_aux_stack+0xc0/0xe4 mm/kasan/generic.c:488 kasan_record_aux_stack_noalloc+0xe/0x16 mm/kasan/generic.c:498 __call_rcu_common.constprop.0+0x80/0x558 kernel/rcu/tree.c:2755 call_rcu+0xc/0x14 kernel/rcu/tree.c:2868 tnode_free+0x92/0xee net/ipv4/fib_trie.c:496 replace+0xc0/0x320 net/ipv4/fib_trie.c:522 inflate net/ipv4/fib_trie.c:624 [inline] resize+0xbca/0x18ca net/ipv4/fib_trie.c:869 trie_rebalance net/ipv4/fib_trie.c:1106 [inline] fib_insert_node net/ipv4/fib_trie.c:1150 [inline] fib_insert_alias+0x63c/0x750 net/ipv4/fib_trie.c:1164 fib_table_insert+0x3ba/0xeec net/ipv4/fib_trie.c:1378 fib_magic+0x3f4/0x438 net/ipv4/fib_frontend.c:1101 fib_add_ifaddr+0xd2/0x308 net/ipv4/fib_frontend.c:1123 fib_inetaddr_event+0x102/0x1aa net/ipv4/fib_frontend.c:1437 notifier_call_chain+0xb8/0x188 kernel/notifier.c:87 blocking_notifier_call_chain kernel/notifier.c:382 [inline] blocking_notifier_call_chain+0x50/0x78 kernel/notifier.c:370 __inet_insert_ifa+0x6ca/0x7c2 net/ipv4/devinet.c:555 inet_rtm_newaddr+0x3cc/0x62a net/ipv4/devinet.c:961 rtnetlink_rcv_msg+0x35e/0xa58 net/core/rtnetlink.c:6141 netlink_rcv_skb+0x100/0x2ce net/netlink/af_netlink.c:2564 rtnetlink_rcv+0x26/0x30 net/core/rtnetlink.c:6159 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline] netlink_unicast+0x40e/0x5fe net/netlink/af_netlink.c:1356 netlink_sendmsg+0x4d6/0x9a8 net/netlink/af_netlink.c:1932 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xa0/0xc4 net/socket.c:734 __sys_sendto+0x210/0x30e net/socket.c:2117 __do_sys_sendto net/socket.c:2129 [inline] sys_sendto+0x3e/0x52 net/socket.c:2125 ret_from_syscall+0x0/0x2 The buggy address belongs to the object at ff60000023cf7800 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 0 bytes inside of 128-byte region [ff60000023cf7800, ff60000023cf7880) The buggy address belongs to the physical page: page:ff1c0000028fbdc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xa3ef7 flags: 0xffe000000000200(slab|node=0|zone=0|lastcpupid=0x7ff) raw: 0ffe000000000200 ff600000082018c0 0000000000000100 0000000000000122 raw: 0000000000000000 0000000080100010 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 0x112a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 3407, tgid 3407 (syz-executor.1), ts 818189407900, free_ts 0 __set_page_owner+0x32/0x182 mm/page_owner.c:190 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0xf8/0x11a mm/page_alloc.c:2524 prep_new_page mm/page_alloc.c:2531 [inline] get_page_from_freelist+0xc0e/0x1118 mm/page_alloc.c:4283 __alloc_pages+0x1b0/0x165a mm/page_alloc.c:5549 alloc_pages+0x132/0x25e mm/mempolicy.c:2286 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab mm/slub.c:1998 [inline] new_slab+0x270/0x382 mm/slub.c:2051 ___slab_alloc+0x57e/0xaa6 mm/slub.c:3193 __slab_alloc.constprop.0+0x5a/0x98 mm/slub.c:3292 __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] __kmem_cache_alloc_node+0xf2/0x2e4 mm/slub.c:3491 kmalloc_trace+0x24/0x56 mm/slab_common.c:1062 kmalloc include/linux/slab.h:580 [inline] __hw_addr_create net/core/dev_addr_lists.c:60 [inline] __hw_addr_add_ex+0x176/0x3f0 net/core/dev_addr_lists.c:118 __hw_addr_add net/core/dev_addr_lists.c:135 [inline] dev_addr_init+0xea/0x16a net/core/dev_addr_lists.c:558 alloc_netdev_mqs+0x1c0/0x824 net/core/dev.c:10603 rtnl_create_link+0x556/0x59e net/core/rtnetlink.c:3283 vxcan_newlink+0x1d2/0x55a drivers/net/can/vxcan.c:219 rtnl_newlink_create net/core/rtnetlink.c:3407 [inline] __rtnl_newlink+0xbd8/0xfb4 net/core/rtnetlink.c:3624 page_owner free stack trace missing Memory state around the buggy address: ff60000023cf7700: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ff60000023cf7780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ff60000023cf7800: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ^ ff60000023cf7880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ff60000023cf7900: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ================================================================== warn_alloc: 3 callbacks suppressed syz-executor.0: vmalloc error: size 4096, vm_struct allocation failed, mode:0xcc0(GFP_KERNEL), nodemask=(null),cpuset=syz0,mems_allowed=0 CPU: 0 PID: 4443 Comm: syz-executor.0 Tainted: G B W 6.2.0-rc1-syzkaller #0 Hardware name: riscv-virtio,qemu (DT) Call Trace: [] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:121 [] show_stack+0x34/0x40 arch/riscv/kernel/stacktrace.c:127 [] __dump_stack lib/dump_stack.c:88 [inline] [] dump_stack_lvl+0xe0/0x14c lib/dump_stack.c:106 [] dump_stack+0x1c/0x24 lib/dump_stack.c:113 [] warn_alloc+0x168/0x22c mm/page_alloc.c:4356 [] __vmalloc_node_range+0xb6c/0xdb4 mm/vmalloc.c:3192 [] bpf_jit_alloc_exec+0x46/0x52 arch/riscv/net/bpf_jit_core.c:190 [] bpf_jit_binary_alloc+0x96/0x13c kernel/bpf/core.c:1025 [] bpf_int_jit_compile+0x886/0xaa6 arch/riscv/net/bpf_jit_core.c:112 [] bpf_prog_select_runtime+0x1a2/0x22e kernel/bpf/core.c:2190 [] bpf_prog_load+0xcb4/0x12b0 kernel/bpf/syscall.c:2623 [] __sys_bpf+0x622/0x31d2 kernel/bpf/syscall.c:4979 [] __do_sys_bpf kernel/bpf/syscall.c:5083 [inline] [] sys_bpf+0x28/0x36 kernel/bpf/syscall.c:5081 [] ret_from_syscall+0x0/0x2 Mem-Info: active_anon:21033 inactive_anon:165 isolated_anon:0 active_file:7 inactive_file:7627 isolated_file:0 unevictable:768 dirty:0 writeback:0 slab_reclaimable:5476 slab_unreclaimable:24090 mapped:8632 shmem:924 pagetables:275 sec_pagetables:0 bounce:0 kernel_misc_reclaimable:0 free:236951 free_pcp:1022 free_cma:4096 Node 0 active_anon:84132kB inactive_anon:660kB active_file:28kB inactive_file:30508kB unevictable:3072kB isolated(anon):0kB isolated(file):0kB mapped:34528kB dirty:0kB writeback:0kB shmem:3696kB writeback_tmp:0kB kernel_stack:5312kB pagetables:1100kB sec_pagetables:0kB all_unreclaimable? no Node 0 DMA32 free:947804kB boost:0kB min:4656kB low:6012kB high:7368kB reserved_highatomic:0KB active_anon:84132kB inactive_anon:660kB active_file:28kB inactive_file:30508kB unevictable:3072kB writepending:0kB present:2095104kB managed:1359004kB mlocked:0kB bounce:0kB free_pcp:4088kB local_pcp:2836kB free_cma:16384kB lowmem_reserve[]: 0 0 0 Node 0 DMA32: 111*4kB (UE) 378*8kB (UME) 329*16kB (UME) 312*32kB (UME) 173*64kB (UME) 142*128kB (UM) 57*256kB (UME) 21*512kB (UME) 4*1024kB (ME) 5*2048kB (UMC) 210*4096kB (MC) = 947804kB Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB Node 0 hugepages_total=4 hugepages_free=4 hugepages_surp=0 hugepages_size=2048kB 8558 total pagecache pages 0 pages in swap cache Free swap = 0kB Total swap = 0kB 523776 pages RAM 0 pages HighMem/MovableOnly 184025 pages reserved 4096 pages cma reserved