================================================================== BUG: KASAN: use-after-free in eth_header_parse_protocol+0xad/0xd0 net/ethernet/eth.c:282 Read of size 2 at addr ffff8880122f480b by task syz-executor.4/17636 CPU: 0 PID: 17636 Comm: syz-executor.4 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+0x176/0x24e lib/dump_stack.c:120 print_address_description+0x5f/0x3a0 mm/kasan/report.c:232 __kasan_report mm/kasan/report.c:399 [inline] kasan_report+0x15c/0x200 mm/kasan/report.c:416 eth_header_parse_protocol+0xad/0xd0 net/ethernet/eth.c:282 dev_parse_header_protocol include/linux/netdevice.h:3179 [inline] virtio_net_hdr_to_skb+0x566/0xce0 include/linux/virtio_net.h:83 packet_snd net/packet/af_packet.c:2994 [inline] packet_sendmsg+0x47d2/0x6650 net/packet/af_packet.c:3031 sock_sendmsg_nosec net/socket.c:654 [inline] sock_sendmsg net/socket.c:674 [inline] kernel_sendmsg+0xf5/0x130 net/socket.c:694 sock_no_sendpage+0xe5/0x130 net/core/sock.c:2860 kernel_sendpage+0x2ca/0x370 net/socket.c:3631 sock_sendpage+0x7e/0xb0 net/socket.c:947 pipe_to_sendpage+0x208/0x2d0 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x351/0x8b0 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0x112/0x180 fs/splice.c:746 do_splice_from fs/splice.c:767 [inline] do_splice+0x1135/0x16e0 fs/splice.c:1079 __do_splice fs/splice.c:1144 [inline] __do_sys_splice fs/splice.c:1350 [inline] __se_sys_splice+0x2a6/0x390 fs/splice.c:1332 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:00007f6d0fab2188 EFLAGS: 00000246 ORIG_RAX: 0000000000000113 RAX: ffffffffffffffda RBX: 000000000056c008 RCX: 0000000000466459 RDX: 0000000000000005 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 00000000004bf9fb R08: 000000000004ffe0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056c008 R13: 00007ffe96eb3a1f R14: 00007f6d0fab2300 R15: 0000000000022000 Allocated by task 4824: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:427 [inline] ____kasan_kmalloc+0xc2/0xf0 mm/kasan/common.c:506 kasan_kmalloc include/linux/kasan.h:233 [inline] __kmalloc+0xb4/0x380 mm/slub.c:4055 kmalloc include/linux/slab.h:559 [inline] tomoyo_realpath_from_path+0xd8/0x610 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x191/0x570 security/tomoyo/file.c:822 security_inode_getattr+0xc0/0x140 security/security.c:1288 vfs_getattr fs/stat.c:131 [inline] vfs_statx+0xe8/0x320 fs/stat.c:199 vfs_fstatat fs/stat.c:217 [inline] vfs_lstat include/linux/fs.h:3240 [inline] __do_sys_newlstat fs/stat.c:372 [inline] __se_sys_newlstat fs/stat.c:366 [inline] __x64_sys_newlstat+0x81/0xd0 fs/stat.c:366 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 9705: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x3d/0x70 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:357 ____kasan_slab_free+0x100/0x140 mm/kasan/common.c:360 kasan_slab_free include/linux/kasan.h:199 [inline] slab_free_hook mm/slub.c:1562 [inline] slab_free_freelist_hook+0x171/0x270 mm/slub.c:1600 slab_free mm/slub.c:3161 [inline] kfree+0xcf/0x2d0 mm/slub.c:4213 skb_release_all net/core/skbuff.c:725 [inline] __kfree_skb+0x56/0x1d0 net/core/skbuff.c:739 nsim_dev_trap_report drivers/net/netdevsim/dev.c:586 [inline] nsim_dev_trap_report_work+0x7d5/0xb20 drivers/net/netdevsim/dev.c:611 process_one_work+0x789/0xfd0 kernel/workqueue.c:2275 worker_thread+0xac1/0x1300 kernel/workqueue.c:2421 kthread+0x39a/0x3c0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 The buggy address belongs to the object at ffff8880122f4000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 2059 bytes inside of 4096-byte region [ffff8880122f4000, ffff8880122f5000) The buggy address belongs to the page: page:ffffea000048bc00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x122f0 head:ffffea000048bc00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888010842140 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880122f4700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880122f4780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880122f4800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880122f4880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880122f4900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================