================================================================== BUG: KASAN: slab-out-of-bounds in memcpy include/linux/fortify-string.h:191 [inline] BUG: KASAN: slab-out-of-bounds in null_skcipher_crypt+0xa8/0x120 crypto/crypto_null.c:85 Write of size 4096 at addr ffff88802a100000 by task syz-executor.1/10189 CPU: 1 PID: 10189 Comm: syz-executor.1 Not tainted 5.14.0-rc6-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+0xcd/0x134 lib/dump_stack.c:105 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:436 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 memcpy+0x39/0x60 mm/kasan/shadow.c:66 memcpy include/linux/fortify-string.h:191 [inline] null_skcipher_crypt+0xa8/0x120 crypto/crypto_null.c:85 crypto_skcipher_encrypt+0xaa/0xf0 crypto/skcipher.c:630 crypto_authenc_encrypt+0x3b4/0x510 crypto/authenc.c:222 crypto_aead_encrypt+0xaa/0xf0 crypto/aead.c:94 esp6_output_tail+0x777/0x1a90 net/ipv6/esp6.c:659 esp6_output+0x4af/0x8a0 net/ipv6/esp6.c:735 xfrm_output_one net/xfrm/xfrm_output.c:552 [inline] xfrm_output_resume+0x2997/0x5ae0 net/xfrm/xfrm_output.c:587 xfrm_output2 net/xfrm/xfrm_output.c:614 [inline] xfrm_output+0x2e7/0xff0 net/xfrm/xfrm_output.c:744 __xfrm6_output+0x4c3/0x1260 net/ipv6/xfrm6_output.c:87 NF_HOOK_COND include/linux/netfilter.h:296 [inline] xfrm6_output+0x117/0x550 net/ipv6/xfrm6_output.c:92 dst_output include/net/dst.h:448 [inline] ip6_local_out+0xaf/0x1a0 net/ipv6/output_core.c:161 ip6_send_skb+0xb7/0x340 net/ipv6/ip6_output.c:1935 ip6_push_pending_frames+0xdd/0x100 net/ipv6/ip6_output.c:1955 rawv6_push_pending_frames net/ipv6/raw.c:613 [inline] rawv6_sendmsg+0x2a87/0x3990 net/ipv6/raw.c:956 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:821 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:723 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2392 ___sys_sendmsg+0xf3/0x170 net/socket.c:2446 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2475 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x4665e9 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:00007fd21dd3a188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665e9 RDX: 0000000000000000 RSI: 0000000020000500 RDI: 0000000000000004 RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 00007ffceffd7b4f R14: 00007fd21dd3a300 R15: 0000000000022000 Allocated by task 8837: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa4/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:596 [inline] kzalloc include/linux/slab.h:721 [inline] __register_sysctl_table+0x112/0x1090 fs/proc/proc_sysctl.c:1318 __devinet_sysctl_register+0x156/0x280 net/ipv4/devinet.c:2572 devinet_sysctl_register net/ipv4/devinet.c:2612 [inline] devinet_sysctl_register+0x160/0x230 net/ipv4/devinet.c:2602 inetdev_init+0x25d/0x550 net/ipv4/devinet.c:276 inetdev_event+0xa87/0x15d0 net/ipv4/devinet.c:1530 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2123 call_netdevice_notifiers_extack net/core/dev.c:2135 [inline] call_netdevice_notifiers net/core/dev.c:2149 [inline] register_netdevice+0x106b/0x1500 net/core/dev.c:10380 cfg80211_register_netdevice+0x153/0x320 net/wireless/core.c:1353 ieee80211_if_add+0x1163/0x1b20 net/mac80211/iface.c:2008 ieee80211_register_hw+0x353f/0x3ef0 net/mac80211/main.c:1317 mac80211_hwsim_new_radio+0x20ce/0x4990 drivers/net/wireless/mac80211_hwsim.c:3358 hwsim_new_radio_nl+0x9bc/0x1080 drivers/net/wireless/mac80211_hwsim.c:3924 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:739 genl_family_rcv_msg net/netlink/genetlink.c:783 [inline] genl_rcv_msg+0x328/0x580 net/netlink/genetlink.c:800 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504 genl_rcv+0x24/0x40 net/netlink/genetlink.c:811 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1340 netlink_sendmsg+0x86d/0xdb0 net/netlink/af_netlink.c:1929 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:723 __sys_sendto+0x21c/0x320 net/socket.c:2019 __do_sys_sendto net/socket.c:2031 [inline] __se_sys_sendto net/socket.c:2027 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2027 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88802a100000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 0 bytes inside of 2048-byte region [ffff88802a100000, ffff88802a100800) The buggy address belongs to the page: page:ffffea0000a84000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2a100 head:ffffea0000a84000 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888010842000 raw: 0000000000000000 0000000000080008 00000001ffffffff 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 8837, ts 93922242646, free_ts 93466984531 prep_new_page mm/page_alloc.c:2436 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4168 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5390 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2244 alloc_slab_page mm/slub.c:1691 [inline] allocate_slab+0x32e/0x4b0 mm/slub.c:1831 new_slab mm/slub.c:1894 [inline] new_slab_objects mm/slub.c:2640 [inline] ___slab_alloc+0x4ba/0x820 mm/slub.c:2803 __slab_alloc.constprop.0+0xa7/0xf0 mm/slub.c:2843 slab_alloc_node mm/slub.c:2925 [inline] slab_alloc mm/slub.c:2967 [inline] __kmalloc+0x312/0x330 mm/slub.c:4111 kmalloc include/linux/slab.h:596 [inline] kzalloc include/linux/slab.h:721 [inline] __register_sysctl_table+0x112/0x1090 fs/proc/proc_sysctl.c:1318 __devinet_sysctl_register+0x156/0x280 net/ipv4/devinet.c:2572 devinet_sysctl_register net/ipv4/devinet.c:2612 [inline] devinet_sysctl_register+0x160/0x230 net/ipv4/devinet.c:2602 inetdev_init+0x25d/0x550 net/ipv4/devinet.c:276 inetdev_event+0xa87/0x15d0 net/ipv4/devinet.c:1530 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2123 call_netdevice_notifiers_extack net/core/dev.c:2135 [inline] call_netdevice_notifiers net/core/dev.c:2149 [inline] register_netdevice+0x106b/0x1500 net/core/dev.c:10380 cfg80211_register_netdevice+0x153/0x320 net/wireless/core.c:1353 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1346 [inline] free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1397 free_unref_page_prepare mm/page_alloc.c:3332 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3411 unfreeze_partials+0x17c/0x1d0 mm/slub.c:2421 put_cpu_partial+0x13d/0x230 mm/slub.c:2457 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x5a/0xc0 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x95/0xb0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:2959 [inline] slab_alloc mm/slub.c:2967 [inline] kmem_cache_alloc_trace+0x26d/0x3c0 mm/slub.c:2984 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] nsim_fib4_rt_create drivers/net/netdevsim/fib.c:277 [inline] nsim_fib4_rt_insert drivers/net/netdevsim/fib.c:423 [inline] nsim_fib4_event drivers/net/netdevsim/fib.c:461 [inline] nsim_fib_event drivers/net/netdevsim/fib.c:881 [inline] nsim_fib_event_work+0x70c/0x2490 drivers/net/netdevsim/fib.c:1477 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 process_scheduled_works kernel/workqueue.c:2338 [inline] worker_thread+0x85c/0x11f0 kernel/workqueue.c:2424 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88802a100300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802a100380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88802a100400: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ^ ffff88802a100480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802a100500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================