================================================================== BUG: KASAN: use-after-free in eth_header_parse_protocol+0xdc/0xe0 net/ethernet/eth.c:283 Read of size 2 at addr ffff888012bf000b by task syz-executor.0/19077 CPU: 1 PID: 19077 Comm: syz-executor.0 Not tainted 5.12.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x141/0x1d7 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232 __kasan_report mm/kasan/report.c:399 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416 eth_header_parse_protocol+0xdc/0xe0 net/ethernet/eth.c:283 dev_parse_header_protocol include/linux/netdevice.h:3264 [inline] virtio_net_hdr_to_skb.constprop.0+0x99d/0xcd0 include/linux/virtio_net.h:83 packet_snd net/packet/af_packet.c:2994 [inline] packet_sendmsg+0x233c/0x5300 net/packet/af_packet.c:3031 sock_sendmsg_nosec net/socket.c:654 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:674 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2350 ___sys_sendmsg+0xf3/0x170 net/socket.c:2404 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2433 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x466459 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:00007f8c9ce76188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 0000000000466459 RDX: 0000000000000000 RSI: 0000000020000440 RDI: 0000000000000004 RBP: 00000000004bf9fb R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60 R13: 00007ffc31cfad3f R14: 00007f8c9ce76300 R15: 0000000000022000 Allocated by task 14032: 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:427 [inline] ____kasan_kmalloc mm/kasan/common.c:506 [inline] ____kasan_kmalloc mm/kasan/common.c:465 [inline] __kasan_kmalloc+0x99/0xc0 mm/kasan/common.c:515 kmalloc include/linux/slab.h:554 [inline] batadv_forw_packet_alloc+0xe0/0x4d0 net/batman-adv/send.c:525 batadv_add_bcast_packet_to_list+0x77/0x3e0 net/batman-adv/send.c:774 batadv_interface_tx+0x11c0/0x1660 net/batman-adv/soft-interface.c:349 __netdev_start_xmit include/linux/netdevice.h:4937 [inline] netdev_start_xmit include/linux/netdevice.h:4951 [inline] xmit_one net/core/dev.c:3654 [inline] dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3670 __dev_queue_xmit+0x209c/0x2e30 net/core/dev.c:4245 __bpf_tx_skb net/core/filter.c:2113 [inline] __bpf_redirect_no_mac net/core/filter.c:2138 [inline] __bpf_redirect+0x548/0xc80 net/core/filter.c:2161 ____bpf_clone_redirect net/core/filter.c:2445 [inline] bpf_clone_redirect+0x2ae/0x420 net/core/filter.c:2417 bpf_prog_682b67a395ac5c66+0x172/0x630 bpf_dispatcher_nop_func include/linux/bpf.h:681 [inline] bpf_test_run+0x45f/0xaa0 net/bpf/test_run.c:117 bpf_prog_test_run_skb+0xabc/0x1c70 net/bpf/test_run.c:656 bpf_prog_test_run kernel/bpf/syscall.c:3138 [inline] __do_sys_bpf+0x218b/0x4f40 kernel/bpf/syscall.c:4417 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae Last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:345 insert_work+0x48/0x370 kernel/workqueue.c:1331 __queue_work+0x5c1/0xf00 kernel/workqueue.c:1497 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1431 expire_timers kernel/time/timer.c:1471 [inline] __run_timers.part.0+0x4a6/0xa50 kernel/time/timer.c:1745 __run_timers kernel/time/timer.c:1726 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1758 __do_softirq+0x29b/0x9f6 kernel/softirq.c:345 Second to last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:345 insert_work+0x48/0x370 kernel/workqueue.c:1331 __queue_work+0x5c1/0xf00 kernel/workqueue.c:1497 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1431 expire_timers kernel/time/timer.c:1471 [inline] __run_timers.part.0+0x4a6/0xa50 kernel/time/timer.c:1745 __run_timers kernel/time/timer.c:1726 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1758 __do_softirq+0x29b/0x9f6 kernel/softirq.c:345 The buggy address belongs to the object at ffff888012bf0000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 11 bytes inside of 512-byte region [ffff888012bf0000, ffff888012bf0200) The buggy address belongs to the page: page:ffffea00004afc00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888012bf0c00 pfn:0x12bf0 head:ffffea00004afc00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head) raw: 00fff00000010200 ffffea000083f208 ffffea0000492308 ffff888010841c80 raw: ffff888012bf0c00 0000000000100004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888012beff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888012beff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888012bf0000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888012bf0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888012bf0100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================