device syz_tun left promiscuous mode device syz_tun entered promiscuous mode ================================================================== BUG: KASAN: use-after-free in tcp_connect+0x2771/0x3150 net/ipv4/tcp_output.c:3421 Read of size 4 at addr ffff8801c937e528 by task syz-executor.5/6445 CPU: 0 PID: 6445 Comm: syz-executor.5 Not tainted 4.9.183+ #4 ffff8801d8df7990 ffffffff81b580a1 0000000000000000 ffffea000724df80 ffff8801c937e528 0000000000000004 ffffffff82528cf1 ffff8801d8df79c8 ffffffff8150ac88 0000000000000000 ffff8801c937e528 ffff8801c937e528 Call Trace: [<0000000043c19b74>] __dump_stack lib/dump_stack.c:15 [inline] [<0000000043c19b74>] dump_stack+0xc1/0x120 lib/dump_stack.c:51 [<0000000023def429>] print_address_description+0x6f/0x23a mm/kasan/report.c:256 [<000000005d752c20>] kasan_report_error mm/kasan/report.c:355 [inline] [<000000005d752c20>] kasan_report mm/kasan/report.c:413 [inline] [<000000005d752c20>] kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:397 [<000000009ef23ebd>] __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:433 [<00000000b5eba2cd>] tcp_connect+0x2771/0x3150 net/ipv4/tcp_output.c:3421 [<00000000ebc34d0d>] tcp_v4_connect+0x1489/0x1c30 net/ipv4/tcp_ipv4.c:250 [<00000000f2ef91de>] __inet_stream_connect+0x706/0xbf0 net/ipv4/af_inet.c:623 [<00000000c37f3716>] inet_stream_connect+0x55/0xa0 net/ipv4/af_inet.c:687 [<00000000c4f3ea90>] SYSC_connect net/socket.c:1576 [inline] [<00000000c4f3ea90>] SyS_connect+0x1a5/0x2e0 net/socket.c:1557 [<000000006e30d283>] do_syscall_64+0x1ad/0x5c0 arch/x86/entry/common.c:288 [<00000000aaa92d81>] entry_SYSCALL_64_after_swapgs+0x5d/0xdb Allocated by task 6432: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack mm/kasan/kasan.c:512 [inline] set_track mm/kasan/kasan.c:524 [inline] kasan_kmalloc.part.0+0x62/0xf0 mm/kasan/kasan.c:616 kasan_kmalloc+0xb7/0xd0 mm/kasan/kasan.c:601 kasan_slab_alloc+0xf/0x20 mm/kasan/kasan.c:554 slab_post_alloc_hook mm/slab.h:417 [inline] slab_alloc_node mm/slub.c:2715 [inline] slab_alloc mm/slub.c:2723 [inline] kmem_cache_alloc+0xd5/0x2b0 mm/slub.c:2728 kmem_cache_alloc_node include/linux/slab.h:364 [inline] __alloc_skb+0xe7/0x5e0 net/core/skbuff.c:219 alloc_skb_fclone include/linux/skbuff.h:966 [inline] sk_stream_alloc_skb+0xa3/0x5d0 net/ipv4/tcp.c:828 tcp_sendmsg+0xe8d/0x2f90 net/ipv4/tcp.c:1230 inet_sendmsg+0x202/0x4d0 net/ipv4/af_inet.c:766 sock_sendmsg_nosec net/socket.c:649 [inline] sock_sendmsg+0xbe/0x110 net/socket.c:659 sock_write_iter+0x235/0x3d0 net/socket.c:857 new_sync_write fs/read_write.c:498 [inline] __vfs_write+0x3c1/0x560 fs/read_write.c:511 vfs_write+0x185/0x520 fs/read_write.c:559 SYSC_write fs/read_write.c:607 [inline] SyS_write+0x121/0x270 fs/read_write.c:599 do_syscall_64+0x1ad/0x5c0 arch/x86/entry/common.c:288 entry_SYSCALL_64_after_swapgs+0x5d/0xdb Freed by task 6445: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack mm/kasan/kasan.c:512 [inline] set_track mm/kasan/kasan.c:524 [inline] kasan_slab_free+0xb0/0x190 mm/kasan/kasan.c:589 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kmem_cache_free+0xbe/0x310 mm/slub.c:2980 kfree_skbmem+0x82/0x100 net/core/skbuff.c:648 __kfree_skb+0x1e/0x30 net/core/skbuff.c:689 sk_wmem_free_skb include/net/sock.h:1368 [inline] tcp_write_queue_purge include/net/tcp.h:1532 [inline] tcp_connect_init net/ipv4/tcp_output.c:3261 [inline] tcp_connect+0xaa6/0x3150 net/ipv4/tcp_output.c:3392 tcp_v4_connect+0x1489/0x1c30 net/ipv4/tcp_ipv4.c:250 __inet_stream_connect+0x706/0xbf0 net/ipv4/af_inet.c:623 inet_stream_connect+0x55/0xa0 net/ipv4/af_inet.c:687 SYSC_connect net/socket.c:1576 [inline] SyS_connect+0x1a5/0x2e0 net/socket.c:1557 do_syscall_64+0x1ad/0x5c0 arch/x86/entry/common.c:288 entry_SYSCALL_64_after_swapgs+0x5d/0xdb The buggy address belongs to the object at ffff8801c937e500 which belongs to the cache skbuff_fclone_cache of size 456 The buggy address is located 40 bytes inside of 456-byte region [ffff8801c937e500, ffff8801c937e6c8) The buggy address belongs to the page: page:ffffea000724df80 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x4000000000010200(slab|head) page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c937e400: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ffff8801c937e480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801c937e500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801c937e580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c937e600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================