================================================================== BUG: KASAN: slab-out-of-bounds in copy_array+0x96/0x100 kernel/bpf/verifier.c:1072 Write of size 64 at addr ffff88807e1f1b00 by task syz-executor.2/14404 CPU: 0 PID: 14404 Comm: syz-executor.2 Not tainted 6.1.0-syzkaller-14011-gd75858ef108c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:306 [inline] print_report+0x15e/0x45d mm/kasan/report.c:417 kasan_report+0xbf/0x1f0 mm/kasan/report.c:517 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x141/0x190 mm/kasan/generic.c:189 memcpy+0x3d/0x60 mm/kasan/shadow.c:66 copy_array+0x96/0x100 kernel/bpf/verifier.c:1072 copy_verifier_state+0xa9/0xc60 kernel/bpf/verifier.c:1250 pop_stack+0x8c/0x2f0 kernel/bpf/verifier.c:1314 do_check kernel/bpf/verifier.c:14042 [inline] do_check_common+0x5663/0xbca0 kernel/bpf/verifier.c:16300 do_check_main kernel/bpf/verifier.c:16363 [inline] bpf_check+0x7348/0xacc0 kernel/bpf/verifier.c:16947 bpf_prog_load+0x1543/0x2230 kernel/bpf/syscall.c:2619 __sys_bpf+0x1435/0x5000 kernel/bpf/syscall.c:4979 __do_sys_bpf kernel/bpf/syscall.c:5083 [inline] __se_sys_bpf kernel/bpf/syscall.c:5081 [inline] __x64_sys_bpf+0x79/0xc0 kernel/bpf/syscall.c:5081 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f52d2e8c0c9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f52d19fe168 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f52d2fabf80 RCX: 00007f52d2e8c0c9 RDX: 0000000000000048 RSI: 00000000200054c0 RDI: 0000000000000005 RBP: 00007f52d2ee7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe8b6b399f R14: 00007f52d19fe300 R15: 0000000000022000 Allocated by task 14404: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] ____kasan_kmalloc mm/kasan/common.c:330 [inline] __kasan_krealloc+0x145/0x180 mm/kasan/common.c:439 kasan_krealloc include/linux/kasan.h:231 [inline] __do_krealloc mm/slab_common.c:1361 [inline] krealloc+0xa8/0x100 mm/slab_common.c:1398 push_jmp_history+0x13e/0x330 kernel/bpf/verifier.c:2596 is_state_visited kernel/bpf/verifier.c:13563 [inline] do_check kernel/bpf/verifier.c:13763 [inline] do_check_common+0x50e5/0xbca0 kernel/bpf/verifier.c:16300 do_check_main kernel/bpf/verifier.c:16363 [inline] bpf_check+0x7348/0xacc0 kernel/bpf/verifier.c:16947 bpf_prog_load+0x1543/0x2230 kernel/bpf/syscall.c:2619 __sys_bpf+0x1435/0x5000 kernel/bpf/syscall.c:4979 __do_sys_bpf kernel/bpf/syscall.c:5083 [inline] __se_sys_bpf kernel/bpf/syscall.c:5081 [inline] __x64_sys_bpf+0x79/0xc0 kernel/bpf/syscall.c:5081 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:488 kvfree_call_rcu+0x78/0x8f0 kernel/rcu/tree.c:3376 ip6addrlbl_net_exit+0xb6/0x180 net/ipv6/addrlabel.c:347 ops_exit_list+0xb0/0x170 net/core/net_namespace.c:169 cleanup_net+0x4ee/0xb10 net/core/net_namespace.c:606 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Second to last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:488 kvfree_call_rcu+0x78/0x8f0 kernel/rcu/tree.c:3376 sctp_inet6addr_event+0x429/0x910 net/sctp/ipv6.c:115 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 atomic_notifier_call_chain+0x74/0x180 kernel/notifier.c:225 addrconf_ifdown.isra.0+0xcb5/0x1920 net/ipv6/addrconf.c:3875 addrconf_notify+0x109/0x1c80 net/ipv6/addrconf.c:3673 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1944 call_netdevice_notifiers_extack net/core/dev.c:1982 [inline] call_netdevice_notifiers net/core/dev.c:1996 [inline] dev_close_many+0x309/0x630 net/core/dev.c:1530 unregister_netdevice_many_notify+0x416/0x19e0 net/core/dev.c:10813 unregister_netdevice_many net/core/dev.c:10895 [inline] default_device_exit_batch+0x451/0x590 net/core/dev.c:11348 ops_exit_list+0x125/0x170 net/core/net_namespace.c:174 cleanup_net+0x4ee/0xb10 net/core/net_namespace.c:606 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff88807e1f1b00 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff88807e1f1b00, ffff88807e1f1b40) The buggy address belongs to the physical page: page:ffffea0001f87c40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7e1f1 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffff888012441640 dead000000000100 dead000000000122 raw: 0000000000000000 0000000080200020 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 0x112c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 4433, tgid 4433 (udevd), ts 149793720119, free_ts 149779497853 prep_new_page mm/page_alloc.c:2531 [inline] get_page_from_freelist+0x119c/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5549 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2285 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x25f/0x350 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3193 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3292 __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] __kmem_cache_alloc_node+0x1a4/0x430 mm/slub.c:3491 __do_kmalloc_node mm/slab_common.c:967 [inline] __kmalloc+0x4a/0xd0 mm/slab_common.c:981 kmalloc include/linux/slab.h:584 [inline] kzalloc include/linux/slab.h:720 [inline] tomoyo_encode2.part.0+0xe9/0x3a0 security/tomoyo/realpath.c:45 tomoyo_encode2 security/tomoyo/realpath.c:31 [inline] tomoyo_encode+0x2c/0x50 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x185/0x600 security/tomoyo/realpath.c:283 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x297/0x3a0 security/tomoyo/file.c:771 tomoyo_file_open security/tomoyo/tomoyo.c:332 [inline] tomoyo_file_open+0xa1/0xc0 security/tomoyo/tomoyo.c:327 security_file_open+0x49/0xb0 security/security.c:1718 do_dentry_open+0x575/0x13f0 fs/open.c:869 do_open fs/namei.c:3557 [inline] path_openat+0x1bbc/0x2a50 fs/namei.c:3714 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1446 [inline] free_pcp_prepare+0x65c/0xc00 mm/page_alloc.c:1496 free_unref_page_prepare mm/page_alloc.c:3369 [inline] free_unref_page+0x1d/0x490 mm/page_alloc.c:3464 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2637 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x192/0x220 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x66/0x90 mm/kasan/common.c:302 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:761 [inline] slab_alloc_node mm/slub.c:3452 [inline] __kmem_cache_alloc_node+0x1ea/0x430 mm/slub.c:3491 kmalloc_trace+0x26/0x60 mm/slab_common.c:1062 kmalloc include/linux/slab.h:580 [inline] kzalloc include/linux/slab.h:720 [inline] nsim_fib6_rt_create drivers/net/netdevsim/fib.c:547 [inline] nsim_fib6_rt_insert drivers/net/netdevsim/fib.c:752 [inline] nsim_fib6_event drivers/net/netdevsim/fib.c:856 [inline] nsim_fib_event drivers/net/netdevsim/fib.c:889 [inline] nsim_fib_event_work+0x121c/0x24a0 drivers/net/netdevsim/fib.c:1492 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffff88807e1f1a00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88807e1f1a80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88807e1f1b00: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88807e1f1b80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88807e1f1c00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================