================================================================== BUG: KASAN: slab-out-of-bounds in instrument_copy_to_user include/linux/instrumented.h:118 [inline] BUG: KASAN: slab-out-of-bounds in _copy_to_user+0xe1/0x130 lib/usercopy.c:32 Read of size 42 at addr ffff88803ef33800 by task syz-executor.0/23259 CPU: 0 PID: 23259 Comm: syz-executor.0 Not tainted 5.15.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1dc/0x2d8 lib/dump_stack.c:106 print_address_description+0x66/0x3e0 mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:442 [inline] kasan_report+0x19a/0x1f0 mm/kasan/report.c:459 kasan_check_range+0x2b5/0x2f0 mm/kasan/generic.c:189 instrument_copy_to_user include/linux/instrumented.h:118 [inline] _copy_to_user+0xe1/0x130 lib/usercopy.c:32 copy_to_user include/linux/uaccess.h:200 [inline] __htab_map_lookup_and_delete_batch+0x1a63/0x2160 kernel/bpf/hashtab.c:1768 bpf_map_do_batch+0x396/0x490 __sys_bpf+0xde4/0x12c70 __do_sys_bpf kernel/bpf/syscall.c:4694 [inline] __se_sys_bpf kernel/bpf/syscall.c:4692 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4692 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f09244eba39 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0921a1f188 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f09245ff0e0 RCX: 00007f09244eba39 RDX: 0000000000000038 RSI: 0000000020000040 RDI: 0000000000000019 RBP: 00007f0924545e8f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdf77a2bbf R14: 00007f0921a1f300 R15: 0000000000022000 Allocated by task 23259: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc_node+0x288/0x400 mm/slub.c:4448 kmalloc_node include/linux/slab.h:614 [inline] kvmalloc_node+0x81/0x110 mm/util.c:587 kvmalloc include/linux/mm.h:805 [inline] kvmalloc_array include/linux/mm.h:823 [inline] __htab_map_lookup_and_delete_batch+0x43b/0x2160 kernel/bpf/hashtab.c:1647 bpf_map_do_batch+0x396/0x490 __sys_bpf+0xde4/0x12c70 __do_sys_bpf kernel/bpf/syscall.c:4694 [inline] __se_sys_bpf kernel/bpf/syscall.c:4692 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4692 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xf1/0x130 mm/kasan/generic.c:348 kvfree_call_rcu+0x11b/0x880 kernel/rcu/tree.c:3552 sctp_bind_addr_clean net/sctp/bind_addr.c:125 [inline] sctp_bind_addr_free+0x14b/0x1a0 net/sctp/bind_addr.c:134 sctp_association_free+0x284/0x7b0 net/sctp/associola.c:359 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:940 [inline] sctp_cmd_interpreter+0x4091/0x5810 net/sctp/sm_sideeffect.c:1324 sctp_side_effects+0x6c/0x1f0 net/sctp/sm_sideeffect.c:1195 sctp_do_sm+0x22c/0x540 net/sctp/sm_sideeffect.c:1166 sctp_assoc_bh_rcv+0x42a/0x680 net/sctp/associola.c:1054 sctp_backlog_rcv+0x16e/0x4c0 net/sctp/input.c:344 sk_backlog_rcv include/net/sock.h:1027 [inline] __release_sock+0x1d8/0x4c0 net/core/sock.c:2686 release_sock+0x5d/0x1c0 net/core/sock.c:3218 sctp_wait_for_connect+0x3c6/0x6b0 net/sctp/socket.c:9306 __sctp_connect+0x10c1/0x1370 net/sctp/socket.c:1244 __sctp_setsockopt_connectx net/sctp/socket.c:1333 [inline] sctp_setsockopt_connectx net/sctp/socket.c:1360 [inline] sctp_setsockopt+0x4229/0xf6b0 net/sctp/socket.c:4611 __sys_setsockopt+0x552/0x980 net/socket.c:2176 __do_sys_setsockopt net/socket.c:2187 [inline] __se_sys_setsockopt net/socket.c:2184 [inline] __x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2184 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Second to last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xf1/0x130 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:2987 [inline] call_rcu+0x1c4/0xa80 kernel/rcu/tree.c:3067 mpls_dev_notify+0x58c/0x7d0 net/mpls/af_mpls.c:1623 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:1996 [inline] call_netdevice_notifiers_extack net/core/dev.c:2008 [inline] call_netdevice_notifiers net/core/dev.c:2022 [inline] unregister_netdevice_many+0xfae/0x19e0 net/core/dev.c:11050 vti6_exit_batch_net+0x402/0x450 net/ipv6/ip6_vti.c:1188 ops_exit_list net/core/net_namespace.c:171 [inline] cleanup_net+0x7ec/0xc50 net/core/net_namespace.c:591 process_one_work+0x853/0x1140 kernel/workqueue.c:2297 worker_thread+0xac1/0x1320 kernel/workqueue.c:2444 kthread+0x453/0x480 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 The buggy address belongs to the object at ffff88803ef33800 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff88803ef33800, ffff88803ef33840) The buggy address belongs to the page: page:ffffea0000fbccc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88803ef33300 pfn:0x3ef33 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001d84040 0000000400000004 ffff888011041640 raw: ffff88803ef33300 000000008020001b 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 6716, ts 157726754950, free_ts 157725436697 prep_new_page mm/page_alloc.c:2424 [inline] get_page_from_freelist+0x779/0xa30 mm/page_alloc.c:4153 __alloc_pages+0x255/0x580 mm/page_alloc.c:5375 alloc_slab_page mm/slub.c:1770 [inline] allocate_slab+0xcc/0x4d0 mm/slub.c:1907 new_slab mm/slub.c:1970 [inline] ___slab_alloc+0x41e/0xc40 mm/slub.c:3001 __slab_alloc mm/slub.c:3088 [inline] slab_alloc_node mm/slub.c:3179 [inline] slab_alloc mm/slub.c:3221 [inline] __kmalloc+0x2e9/0x370 mm/slub.c:4396 kmalloc include/linux/slab.h:596 [inline] kzalloc+0x1d/0x30 include/linux/slab.h:721 kobject_get_path+0xb1/0x1e0 lib/kobject.c:179 kobject_uevent_env+0x298/0x1700 lib/kobject_uevent.c:529 rx_queue_add_kobject net/core/net-sysfs.c:1020 [inline] net_rx_queue_update_kobjects+0x21f/0x4c0 net/core/net-sysfs.c:1060 register_queue_kobjects net/core/net-sysfs.c:1711 [inline] netdev_register_kobject+0x222/0x310 net/core/net-sysfs.c:1959 register_netdevice+0x12a1/0x1c30 net/core/dev.c:10306 veth_newlink+0x8f2/0xf80 drivers/net/veth.c:1726 __rtnl_newlink net/core/rtnetlink.c:3458 [inline] rtnl_newlink+0x14b3/0x1d10 net/core/rtnetlink.c:3506 rtnetlink_rcv_msg+0x934/0xe60 net/core/rtnetlink.c:5572 netlink_rcv_skb+0x200/0x470 net/netlink/af_netlink.c:2510 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x814/0x9f0 net/netlink/af_netlink.c:1345 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0xc29/0xd20 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3315 [inline] free_unref_page+0x7d/0x580 mm/page_alloc.c:3394 __vunmap+0x926/0xa70 mm/vmalloc.c:2621 free_work+0x66/0x90 mm/vmalloc.c:95 process_one_work+0x853/0x1140 kernel/workqueue.c:2297 worker_thread+0xac1/0x1320 kernel/workqueue.c:2444 kthread+0x453/0x480 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 Memory state around the buggy address: ffff88803ef33700: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ffff88803ef33780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88803ef33800: 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc fc ^ ffff88803ef33880: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88803ef33900: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ==================================================================