================================================================== BUG: KASAN: use-after-free in erspan_build_header+0x392/0x3b0 net/ipv4/ip_gre.c:706 Read of size 2 at addr ffff88808cec904b by task syz-executor.2/10945 CPU: 1 PID: 10945 Comm: syz-executor.2 Not tainted 4.14.112 #2 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x138/0x19c lib/dump_stack.c:53 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report mm/kasan/report.c:409 [inline] kasan_report.cold+0xaf/0x2b5 mm/kasan/report.c:393 __asan_report_load_n_noabort+0xf/0x20 mm/kasan/report.c:440 erspan_build_header+0x392/0x3b0 net/ipv4/ip_gre.c:706 erspan_xmit net/ipv4/ip_gre.c:748 [inline] erspan_xmit+0x3ec/0x11c0 net/ipv4/ip_gre.c:725 __netdev_start_xmit include/linux/netdevice.h:4033 [inline] netdev_start_xmit include/linux/netdevice.h:4042 [inline] packet_direct_xmit+0x438/0x640 net/packet/af_packet.c:269 packet_snd net/packet/af_packet.c:2969 [inline] packet_sendmsg+0x31e1/0x5990 net/packet/af_packet.c:2994 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xd0/0x110 net/socket.c:656 ___sys_sendmsg+0x70c/0x850 net/socket.c:2062 __sys_sendmsg+0xb9/0x140 net/socket.c:2096 SYSC_sendmsg net/socket.c:2107 [inline] SyS_sendmsg+0x2d/0x50 net/socket.c:2103 do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x458c29 RSP: 002b:00007fb3cf974c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000458c29 RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000000000003 RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb3cf9756d4 R13: 00000000004c64a3 R14: 00000000004dadd8 R15: 00000000ffffffff Allocated by task 10560: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x45/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc mm/kasan/kasan.c:551 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529 kmem_cache_alloc_trace+0x152/0x790 mm/slab.c:3618 kmalloc include/linux/slab.h:488 [inline] kzalloc include/linux/slab.h:661 [inline] snd_pcm_attach_substream+0x376/0xaa0 sound/core/pcm.c:1005 snd_pcm_open_substream+0x71/0x290 sound/core/pcm_native.c:2391 snd_pcm_oss_open_file sound/core/oss/pcm_oss.c:2424 [inline] snd_pcm_oss_open.part.0+0x611/0x1120 sound/core/oss/pcm_oss.c:2506 snd_pcm_oss_open+0x37/0x50 sound/core/oss/pcm_oss.c:2470 soundcore_open+0x3f6/0x5a0 sound/sound_core.c:639 chrdev_open+0x209/0x590 fs/char_dev.c:417 do_dentry_open+0x73e/0xeb0 fs/open.c:758 vfs_open+0x105/0x230 fs/open.c:872 do_last fs/namei.c:3425 [inline] path_openat+0x8bd/0x3f70 fs/namei.c:3566 do_filp_open+0x18e/0x250 fs/namei.c:3600 do_sys_open+0x2c5/0x430 fs/open.c:1065 SYSC_openat fs/open.c:1092 [inline] SyS_openat+0x30/0x40 fs/open.c:1086 do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 10555: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x45/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 snd_pcm_detach_substream+0x1e9/0x380 sound/core/pcm.c:1062 snd_pcm_release_substream.part.0+0x21f/0x310 sound/core/pcm_native.c:2380 snd_pcm_release_substream+0x57/0x70 sound/core/pcm_native.c:2363 snd_pcm_oss_release_file.part.0+0x3d/0xa0 sound/core/oss/pcm_oss.c:2383 snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2378 [inline] snd_pcm_oss_release+0x10b/0x280 sound/core/oss/pcm_oss.c:2563 __fput+0x277/0x7a0 fs/file_table.c:210 ____fput+0x16/0x20 fs/file_table.c:244 task_work_run+0x119/0x190 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x1da/0x220 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:267 [inline] do_syscall_64+0x4a9/0x630 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff88808cec8e40 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 523 bytes inside of 2048-byte region [ffff88808cec8e40, ffff88808cec9640) The buggy address belongs to the page: page:ffffea000233b200 count:1 mapcount:0 mapping:ffff88808cec85c0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000008100(slab|head) raw: 01fffc0000008100 ffff88808cec85c0 0000000000000000 0000000100000003 raw: ffffea0002a38c20 ffffea00023068a0 ffff8880aa800c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808cec8f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808cec8f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88808cec9000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808cec9080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808cec9100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================