================================================================== BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:344 [inline] BUG: KASAN: slab-out-of-bounds in map_lookup_elem+0x4dc/0xbd0 kernel/bpf/syscall.c:584 Read of size 4 at addr ffff8801d04baef0 by task syz-executor0/12618 CPU: 1 PID: 12618 Comm: syz-executor0 Not tainted 4.15.0-rc7+ #171 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report+0x25b/0x340 mm/kasan/report.c:409 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x137/0x190 mm/kasan/kasan.c:267 memcpy+0x23/0x50 mm/kasan/kasan.c:302 memcpy include/linux/string.h:344 [inline] map_lookup_elem+0x4dc/0xbd0 kernel/bpf/syscall.c:584 SYSC_bpf kernel/bpf/syscall.c:1711 [inline] SyS_bpf+0x922/0x4400 kernel/bpf/syscall.c:1685 do_syscall_32_irqs_on arch/x86/entry/common.c:327 [inline] do_fast_syscall_32+0x3ee/0xf9d arch/x86/entry/common.c:389 entry_SYSENTER_compat+0x54/0x63 arch/x86/entry/entry_64_compat.S:129 RIP: 0023:0xf7fc1c79 RSP: 002b:00000000f77bd08c EFLAGS: 00000296 ORIG_RAX: 0000000000000165 RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000208e6000 RDX: 0000000000000018 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 5876: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x136/0x750 mm/slab.c:3610 kmalloc include/linux/slab.h:499 [inline] kzalloc include/linux/slab.h:688 [inline] device_private_init+0x98/0x230 drivers/base/core.c:1705 device_add+0x8dc/0x1650 drivers/base/core.c:1750 netdev_register_kobject+0x183/0x360 net/core/net-sysfs.c:1604 register_netdevice+0xb2b/0x1010 net/core/dev.c:7710 ieee80211_if_add+0x106b/0x19f0 net/mac80211/iface.c:1883 ieee80211_register_hw+0x27da/0x3100 net/mac80211/main.c:1102 mac80211_hwsim_new_radio+0x1b2e/0x2b90 drivers/net/wireless/mac80211_hwsim.c:2700 hwsim_new_radio_nl+0x5b7/0x7c0 drivers/net/wireless/mac80211_hwsim.c:3152 genl_family_rcv_msg+0x7b7/0xfb0 net/netlink/genetlink.c:599 genl_rcv_msg+0xb2/0x140 net/netlink/genetlink.c:624 netlink_rcv_skb+0x224/0x470 net/netlink/af_netlink.c:2408 genl_rcv+0x28/0x40 net/netlink/genetlink.c:635 netlink_unicast_kernel net/netlink/af_netlink.c:1275 [inline] netlink_unicast+0x4ee/0x700 net/netlink/af_netlink.c:1301 netlink_sendmsg+0xa4a/0xe60 net/netlink/af_netlink.c:1864 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg+0xca/0x110 net/socket.c:648 ___sys_sendmsg+0x767/0x8b0 net/socket.c:2028 __sys_sendmsg+0xe5/0x210 net/socket.c:2062 C_SYSC_sendmsg net/compat.c:739 [inline] compat_SyS_sendmsg+0x2a/0x40 net/compat.c:737 do_syscall_32_irqs_on arch/x86/entry/common.c:327 [inline] do_fast_syscall_32+0x3ee/0xf9d arch/x86/entry/common.c:389 entry_SYSENTER_compat+0x54/0x63 arch/x86/entry/entry_64_compat.S:129 Freed by task 24: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3488 [inline] kfree+0xd6/0x260 mm/slab.c:3803 free_fib_info_rcu+0x364/0x430 net/ipv4/fib_semantics.c:225 __rcu_reclaim kernel/rcu/rcu.h:195 [inline] rcu_do_batch kernel/rcu/tree.c:2758 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:3012 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2979 [inline] rcu_process_callbacks+0xd6c/0x17f0 kernel/rcu/tree.c:2996 __do_softirq+0x2d7/0xb85 kernel/softirq.c:285 The buggy address belongs to the object at ffff8801d04bae00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 240 bytes inside of 256-byte region [ffff8801d04bae00, ffff8801d04baf00) The buggy address belongs to the page: page:ffffea0007412e80 count:1 mapcount:0 mapping:ffff8801d04ba040 index:0xffff8801d04ba400 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801d04ba040 ffff8801d04ba400 000000010000000b raw: ffffea00074517e0 ffffea0007374220 ffff8801dac007c0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d04bad80: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801d04bae00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8801d04bae80: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ^ ffff8801d04baf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801d04baf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================