================================================================== BUG: KASAN: use-after-free in eth_header_parse_protocol+0xad/0xd0 net/ethernet/eth.c:282 Read of size 2 at addr ffff8881e6d7100b by task syz-executor.2/28234 CPU: 0 PID: 28234 Comm: syz-executor.2 Not tainted 5.4.111-syzkaller-00141-gce6a5172613f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x24e lib/dump_stack.c:118 print_address_description+0x9b/0x650 mm/kasan/report.c:384 __kasan_report+0x182/0x260 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:641 eth_header_parse_protocol+0xad/0xd0 net/ethernet/eth.c:282 dev_parse_header_protocol include/linux/netdevice.h:3016 [inline] virtio_net_hdr_to_skb+0x6de/0xd70 include/linux/virtio_net.h:83 packet_snd net/packet/af_packet.c:2976 [inline] packet_sendmsg+0x483a/0x6780 net/packet/af_packet.c:3013 sock_sendmsg_nosec net/socket.c:638 [inline] sock_sendmsg net/socket.c:658 [inline] sock_write_iter+0x330/0x450 net/socket.c:990 call_write_iter include/linux/fs.h:1971 [inline] new_sync_write fs/read_write.c:483 [inline] __vfs_write+0x5ec/0x780 fs/read_write.c:496 vfs_write+0x212/0x4e0 fs/read_write.c:558 ksys_write+0x186/0x2b0 fs/read_write.c:611 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 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:00007f5c0a451188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 0000000000466459 RDX: 0000000000000122 RSI: 0000000020000400 RDI: 0000000000000004 RBP: 00000000004bf9fb R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60 R13: 00007ffd038b9d7f R14: 00007f5c0a451300 R15: 0000000000022000 Allocated by task 1019: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x137/0x1e0 mm/kasan/common.c:517 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2821 [inline] slab_alloc mm/slub.c:2829 [inline] kmem_cache_alloc+0x115/0x290 mm/slub.c:2834 dst_alloc+0x137/0x4e0 net/core/dst.c:93 rt_dst_alloc net/ipv4/route.c:1631 [inline] __mkroute_output+0x9e4/0x1430 net/ipv4/route.c:2409 ip_route_output_key_hash net/ipv4/route.c:2465 [inline] __ip_route_output_key include/net/route.h:126 [inline] ip_route_output_flow+0x13d/0x320 net/ipv4/route.c:2726 ip_route_output_key include/net/route.h:136 [inline] ip_tunnel_xmit+0xa00/0x20e0 net/ipv4/ip_tunnel.c:747 __gre_xmit net/ipv4/ip_gre.c:444 [inline] ipgre_xmit+0x6db/0x9e0 net/ipv4/ip_gre.c:626 __netdev_start_xmit include/linux/netdevice.h:4506 [inline] netdev_start_xmit include/linux/netdevice.h:4520 [inline] xmit_one+0xfa/0x470 net/core/dev.c:3203 dev_hard_start_xmit net/core/dev.c:3219 [inline] __dev_queue_xmit+0x1341/0x26b0 net/core/dev.c:3778 __bpf_tx_skb net/core/filter.c:2063 [inline] __bpf_redirect_no_mac net/core/filter.c:2088 [inline] __bpf_redirect+0x728/0xd00 net/core/filter.c:2111 ____bpf_clone_redirect net/core/filter.c:2142 [inline] bpf_clone_redirect+0x243/0x350 net/core/filter.c:2114 0xffffffffa01284f4 bpf_call_func include/linux/filter.h:608 [inline] bpf_test_run+0x288/0x680 net/bpf/test_run.c:44 bpf_prog_test_run_skb+0x84d/0x1130 net/bpf/test_run.c:310 bpf_prog_test_run kernel/bpf/syscall.c:2123 [inline] __do_sys_bpf+0x2d28/0xbe70 kernel/bpf/syscall.c:2906 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 9: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:333 [inline] __kasan_slab_free+0x18a/0x240 mm/kasan/common.c:475 slab_free_hook mm/slub.c:1454 [inline] slab_free_freelist_hook+0x7b/0x150 mm/slub.c:1492 slab_free mm/slub.c:3072 [inline] kmem_cache_free+0xb8/0x5f0 mm/slub.c:3088 dst_destroy+0x261/0x370 net/core/dst.c:129 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch+0x4c0/0xa10 kernel/rcu/tree.c:2166 rcu_core+0x697/0xf40 kernel/rcu/tree.c:2386 __do_softirq+0x23e/0x615 kernel/softirq.c:292 The buggy address belongs to the object at ffff8881e6d71000 which belongs to the cache ip_dst_cache of size 176 The buggy address is located 11 bytes inside of 176-byte region [ffff8881e6d71000, ffff8881e6d710b0) The buggy address belongs to the page: page:ffffea00079b5c40 refcount:1 mapcount:0 mapping:ffff8881f4e8b180 index:0xffff8881e6d71e00 flags: 0x8000000000000200(slab) raw: 8000000000000200 ffffea00078cf488 ffffea00079e8ac8 ffff8881f4e8b180 raw: ffff8881e6d71e00 0000000000100000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881e6d70f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881e6d70f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881e6d71000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881e6d71080: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc ffff8881e6d71100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================