tpacket_rcv: packet too big, clamped from 88 to 4294967256. macoff=96 ================================================================== BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:345 [inline] BUG: KASAN: slab-out-of-bounds in eth_header_parse+0x88/0xb0 net/ethernet/eth.c:215 Write of size 6 at addr ffff880194d30004 by task syz-executor3/8291 CPU: 1 PID: 8291 Comm: syz-executor3 Not tainted 4.18.0-rc7+ #81 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+0x1c9/0x2b4 lib/dump_stack.c:113 print_address_description+0x6c/0x20b mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267 memcpy+0x37/0x50 mm/kasan/kasan.c:303 memcpy include/linux/string.h:345 [inline] eth_header_parse+0x88/0xb0 net/ethernet/eth.c:215 dev_parse_header include/linux/netdevice.h:2837 [inline] tpacket_rcv+0xcf7/0x31e0 net/packet/af_packet.c:2333 deliver_skb net/core/dev.c:1925 [inline] deliver_ptype_list_skb net/core/dev.c:1940 [inline] __netif_receive_skb_core+0x1b75/0x35b0 net/core/dev.c:4611 __netif_receive_skb+0x2c/0x1e0 net/core/dev.c:4693 netif_receive_skb_internal+0x12e/0x7d0 net/core/dev.c:4767 netif_receive_skb+0xbf/0x420 net/core/dev.c:4791 tun_rx_batched.isra.55+0x4ba/0x8c0 drivers/net/tun.c:1571 tun_get_user+0x2ac9/0x42c0 drivers/net/tun.c:1981 tun_chr_write_iter+0xb9/0x154 drivers/net/tun.c:2009 call_write_iter include/linux/fs.h:1793 [inline] do_iter_readv_writev+0x897/0xa90 fs/read_write.c:680 do_iter_write+0x185/0x5f0 fs/read_write.c:959 compat_writev+0x234/0x420 fs/read_write.c:1273 do_compat_writev+0x128/0x260 fs/read_write.c:1294 __do_compat_sys_writev fs/read_write.c:1305 [inline] __se_compat_sys_writev fs/read_write.c:1301 [inline] __ia32_compat_sys_writev+0x74/0xb0 fs/read_write.c:1301 do_syscall_32_irqs_on arch/x86/entry/common.c:326 [inline] do_fast_syscall_32+0x34d/0xfb2 arch/x86/entry/common.c:397 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 RIP: 0023:0xf7fc9cb9 Code: 55 08 8b 88 64 cd ff ff 8b 98 68 cd ff ff 89 c8 85 d2 74 02 89 0a 5b 5d c3 8b 04 24 c3 8b 1c 24 c3 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 002b:00000000f5fa4054 EFLAGS: 00000292 ORIG_RAX: 0000000000000092 RAX: ffffffffffffffda RBX: 00000000000000f0 RCX: 00000000f5fa40a4 RDX: 0000000000000001 RSI: 0000000020000140 RDI: 00000000ffffffff RBP: 00000000f5fa4168 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 6746: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553 kmem_cache_alloc_trace+0x152/0x780 mm/slab.c:3620 kmalloc include/linux/slab.h:513 [inline] kzalloc include/linux/slab.h:707 [inline] tipc_nametbl_init+0x281/0x5d0 net/tipc/name_table.c:738 tipc_init_net+0x449/0x6d0 net/tipc/core.c:73 ops_init+0x101/0x560 net/core/net_namespace.c:128 setup_net+0x3d9/0x980 net/core/net_namespace.c:313 copy_net_ns+0x2b8/0x4d0 net/core/net_namespace.c:436 create_new_namespaces+0x6ad/0x900 kernel/nsproxy.c:107 copy_namespaces+0x403/0x4d0 kernel/nsproxy.c:165 copy_process.part.39+0x2e11/0x70b0 kernel/fork.c:1829 copy_process kernel/fork.c:1639 [inline] _do_fork+0x291/0x12a0 kernel/fork.c:2122 __do_compat_sys_x86_clone arch/x86/ia32/sys_ia32.c:240 [inline] __se_compat_sys_x86_clone arch/x86/ia32/sys_ia32.c:236 [inline] __ia32_compat_sys_x86_clone+0xbc/0x140 arch/x86/ia32/sys_ia32.c:236 do_syscall_32_irqs_on arch/x86/entry/common.c:326 [inline] do_fast_syscall_32+0x34d/0xfb2 arch/x86/entry/common.c:397 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 Freed by task 4816: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xd9/0x260 mm/slab.c:3813 tipc_nametbl_stop+0x98a/0xce0 net/tipc/name_table.c:797 tipc_exit_net+0x2d/0x40 net/tipc/core.c:103 ops_exit_list.isra.7+0xb0/0x160 net/core/net_namespace.c:152 cleanup_net+0x537/0xb50 net/core/net_namespace.c:523 process_one_work+0xc73/0x1ba0 kernel/workqueue.c:2153 worker_thread+0x189/0x13c0 kernel/workqueue.c:2296 kthread+0x345/0x410 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:412 The buggy address belongs to the object at ffff880194d324c0 which belongs to the cache kmalloc-16384 of size 16384 The buggy address is located 9404 bytes to the left of 16384-byte region [ffff880194d324c0, ffff880194d364c0) The buggy address belongs to the page: page:ffffea0006534c00 count:1 mapcount:0 mapping:ffff8801dac02200 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000008100(slab|head) raw: 02fffc0000008100 ffffea0006c7d608 ffffea000653c408 ffff8801dac02200 raw: 0000000000000000 ffff880194d324c0 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff880194d2ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff880194d2ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff880194d30000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff880194d30080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff880194d30100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================