================================================================== BUG: KASAN: use-after-free in eth_header_parse_protocol+0xdc/0xe0 net/ethernet/eth.c:282 Read of size 2 at addr ffff88801d4f640b by task syz-executor.5/10815 CPU: 1 PID: 10815 Comm: syz-executor.5 Not tainted 5.12.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:79 [inline] dump_stack+0x141/0x1d7 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2c6 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:282 dev_parse_header_protocol include/linux/netdevice.h:3179 [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+0x2325/0x52b0 net/packet/af_packet.c:3031 sock_sendmsg_nosec net/socket.c:654 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:674 sock_write_iter+0x289/0x3c0 net/socket.c:1001 call_write_iter include/linux/fs.h:1977 [inline] new_sync_write+0x426/0x650 fs/read_write.c:518 vfs_write+0x796/0xa30 fs/read_write.c:605 ksys_write+0x1ee/0x250 fs/read_write.c:658 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:00007f199fc9b188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 0000000000466459 RDX: 000000000000005a RSI: 0000000020000100 RDI: 0000000000000003 RBP: 00000000004bf9fb R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60 R13: 00007ffd9f14dbff R14: 00007f199fc9b300 R15: 0000000000022000 Allocated by task 10615: 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_slab_alloc+0x73/0x90 mm/kasan/common.c:460 kasan_slab_alloc include/linux/kasan.h:223 [inline] slab_post_alloc_hook mm/slab.h:516 [inline] slab_alloc_node mm/slab.c:3262 [inline] kmem_cache_alloc_node+0x1e6/0x540 mm/slab.c:3594 __alloc_skb+0x20b/0x340 net/core/skbuff.c:412 alloc_skb_fclone include/linux/skbuff.h:1153 [inline] sk_stream_alloc_skb+0x109/0xc30 net/ipv4/tcp.c:886 tso_fragment net/ipv4/tcp_output.c:2125 [inline] tcp_write_xmit+0x1ccf/0x6030 net/ipv4/tcp_output.c:2675 __tcp_push_pending_frames+0xaa/0x390 net/ipv4/tcp_output.c:2869 tcp_push_pending_frames include/net/tcp.h:1886 [inline] tcp_data_snd_check net/ipv4/tcp_input.c:5388 [inline] tcp_rcv_established+0x8c9/0x1eb0 net/ipv4/tcp_input.c:5883 tcp_v4_do_rcv+0x5d1/0x870 net/ipv4/tcp_ipv4.c:1679 sk_backlog_rcv include/net/sock.h:1016 [inline] __release_sock+0x134/0x3b0 net/core/sock.c:2556 release_sock+0x54/0x1b0 net/core/sock.c:3080 sk_stream_wait_memory+0x608/0xed0 net/core/stream.c:145 tcp_sendmsg_locked+0x1072/0x2e40 net/ipv4/tcp.c:1417 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1457 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:821 sock_sendmsg_nosec net/socket.c:654 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:674 __sys_sendto+0x21c/0x320 net/socket.c:1977 __do_sys_sendto net/socket.c:1989 [inline] __se_sys_sendto net/socket.c:1985 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:1985 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 10615: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:357 ____kasan_slab_free mm/kasan/common.c:360 [inline] ____kasan_slab_free mm/kasan/common.c:325 [inline] __kasan_slab_free+0xc7/0x100 mm/kasan/common.c:367 kasan_slab_free include/linux/kasan.h:199 [inline] __cache_free mm/slab.c:3440 [inline] kmem_cache_free+0x6d/0x1f0 mm/slab.c:3733 kfree_skbmem+0x166/0x1b0 net/core/skbuff.c:704 __kfree_skb net/core/skbuff.c:740 [inline] kfree_skb net/core/skbuff.c:757 [inline] kfree_skb+0x140/0x3f0 net/core/skbuff.c:751 skb_rbtree_purge+0x75/0xa0 net/core/skbuff.c:3158 tcp_v4_destroy_sock+0x106/0x780 net/ipv4/tcp_ipv4.c:2225 inet_csk_destroy_sock+0x196/0x490 net/ipv4/inet_connection_sock.c:887 __tcp_close+0xd3e/0x1170 net/ipv4/tcp.c:2855 tcp_close+0x29/0xc0 net/ipv4/tcp.c:2867 inet_release+0x12e/0x280 net/ipv4/af_inet.c:431 __sock_release+0xcd/0x280 net/socket.c:599 sock_close+0x18/0x20 net/socket.c:1258 __fput+0x288/0x920 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:140 get_signal+0x1ba2/0x2150 kernel/signal.c:2554 arch_do_signal_or_restart+0x2a8/0x1eb0 arch/x86/kernel/signal.c:789 handle_signal_work kernel/entry/common.c:147 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x148/0x250 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88801d4f62c0 which belongs to the cache skbuff_fclone_cache of size 472 The buggy address is located 331 bytes inside of 472-byte region [ffff88801d4f62c0, ffff88801d4f6498) The buggy address belongs to the page: page:ffffea0000753d80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1d4f6 flags: 0xfff00000000200(slab) raw: 00fff00000000200 ffffea0000749248 ffffea0000712b08 ffff888140508a00 raw: 0000000000000000 ffff88801d4f6040 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88801d4f6300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801d4f6380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801d4f6400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801d4f6480: fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801d4f6500: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ==================================================================