================================================================== BUG: KASAN: use-after-free in tcp_probe_timer /net/ipv4/tcp_timer.c:360 [inline] BUG: KASAN: use-after-free in tcp_write_timer_handler+0x8c6/0x8d0 /net/ipv4/tcp_timer.c:596 Read of size 4 at addr ffff88809abec990 by task syz-executor.2/26526 CPU: 1 PID: 26526 Comm: syz-executor.2 Not tainted 5.2.0+ #97 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+0x172/0x1f0 /lib/dump_stack.c:113 print_address_description.cold+0xd4/0x306 /mm/kasan/report.c:351 __kasan_report.cold+0x1b/0x36 /mm/kasan/report.c:482 kasan_report+0x12/0x17 /mm/kasan/common.c:612 __asan_report_load4_noabort+0x14/0x20 /mm/kasan/generic_report.c:131 tcp_probe_timer /net/ipv4/tcp_timer.c:360 [inline] tcp_write_timer_handler+0x8c6/0x8d0 /net/ipv4/tcp_timer.c:596 tcp_write_timer+0xa8/0x1e0 /net/ipv4/tcp_timer.c:612 call_timer_fn+0x1ac/0x780 /kernel/time/timer.c:1322 expire_timers /kernel/time/timer.c:1366 [inline] __run_timers /kernel/time/timer.c:1685 [inline] __run_timers /kernel/time/timer.c:1653 [inline] run_timer_softirq+0x697/0x17a0 /kernel/time/timer.c:1698 __do_softirq+0x262/0x98c /kernel/softirq.c:292 invoke_softirq /kernel/softirq.c:373 [inline] irq_exit+0x19b/0x1e0 /kernel/softirq.c:413 exiting_irq /./arch/x86/include/asm/apic.h:537 [inline] smp_apic_timer_interrupt+0x1a3/0x610 /arch/x86/kernel/apic/apic.c:1095 apic_timer_interrupt+0xf/0x20 /arch/x86/entry/entry_64.S:828 RIP: 0010:arch_local_irq_restore /./arch/x86/include/asm/paravirt.h:767 [inline] RIP: 0010:kfree+0x239/0x2c0 /mm/slab.c:3757 Code: 55 7e 0f 85 20 fe ff ff e8 15 1c 54 ff e9 16 fe ff ff e8 0a b6 cb ff 48 83 3d 52 a5 26 07 00 0f 84 85 00 00 00 48 89 df 57 9d <0f> 1f 44 00 00 5b 41 5c 41 5d 41 5e 5d c3 e8 e4 b5 cb ff 48 83 3d RSP: 0018:ffff88808c4ffa58 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000007 RBX: 0000000000000286 RCX: 0000000000000006 RDX: 0000000000000000 RSI: 0000000000000008 RDI: 0000000000000286 RBP: ffff88808c4ffa78 R08: 1ffffffff14a774d R09: fffffbfff14a774e R10: fffffbfff14a774d R11: ffffffff8a53ba6f R12: ffff8880a4eb5300 R13: ffff8880aa400380 R14: ffffffff81a32f12 R15: 0000000000000001 __vunmap+0x6d2/0x920 /mm/vmalloc.c:2252 __vfree+0x41/0xd0 /mm/vmalloc.c:2293 vfree+0x5f/0x90 /mm/vmalloc.c:2323 copy_entries_to_user /net/ipv6/netfilter/ip6_tables.c:883 [inline] get_entries /net/ipv6/netfilter/ip6_tables.c:1041 [inline] do_ip6t_get_ctl+0x750/0x960 /net/ipv6/netfilter/ip6_tables.c:1709 nf_sockopt /net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x7a/0xd0 /net/netfilter/nf_sockopt.c:122 ipv6_getsockopt /net/ipv6/ipv6_sockglue.c:1400 [inline] ipv6_getsockopt+0x205/0x280 /net/ipv6/ipv6_sockglue.c:1380 tcp_getsockopt /net/ipv4/tcp.c:3662 [inline] tcp_getsockopt+0x8f/0xe0 /net/ipv4/tcp.c:3656 sock_common_getsockopt+0x94/0xd0 /net/core/sock.c:3089 __sys_getsockopt+0x16d/0x310 /net/socket.c:2129 __do_sys_getsockopt /net/socket.c:2144 [inline] __se_sys_getsockopt /net/socket.c:2141 [inline] __x64_sys_getsockopt+0xbe/0x150 /net/socket.c:2141 do_syscall_64+0xfd/0x6a0 /arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45c32a Code: b8 34 01 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 dd 8c fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 49 89 ca b8 37 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 ba 8c fb ff c3 66 0f 1f 84 00 00 00 00 00 RSP: 002b:00007ffed227ff28 EFLAGS: 00000212 ORIG_RAX: 0000000000000037 RAX: ffffffffffffffda RBX: 00007ffed227ff50 RCX: 000000000045c32a RDX: 0000000000000041 RSI: 0000000000000029 RDI: 0000000000000003 RBP: 0000000000712cc0 R08: 00007ffed227ff4c R09: 0000000000004000 R10: 00007ffed2280050 R11: 0000000000000212 R12: 0000000000000003 R13: 0000000000000000 R14: 0000000000000029 R15: 0000000000711f40 Allocated by task 12395: save_stack+0x23/0x90 /mm/kasan/common.c:69 set_track /mm/kasan/common.c:77 [inline] __kasan_kmalloc /mm/kasan/common.c:487 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 /mm/kasan/common.c:460 kasan_kmalloc+0x9/0x10 /mm/kasan/common.c:501 __do_kmalloc /mm/slab.c:3655 [inline] __kmalloc+0x163/0x770 /mm/slab.c:3664 kmalloc /./include/linux/slab.h:557 [inline] tomoyo_realpath_from_path+0xcd/0x7b0 /security/tomoyo/realpath.c:277 tomoyo_get_realpath /security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x230/0x430 /security/tomoyo/file.c:822 tomoyo_inode_getattr+0x1d/0x30 /security/tomoyo/tomoyo.c:129 security_inode_getattr+0xf2/0x150 /security/security.c:1182 vfs_getattr+0x25/0x70 /fs/stat.c:115 vfs_statx_fd+0x71/0xc0 /fs/stat.c:145 vfs_fstat /./include/linux/fs.h:3198 [inline] __do_sys_newfstat+0x9b/0x120 /fs/stat.c:378 __se_sys_newfstat /fs/stat.c:375 [inline] __x64_sys_newfstat+0x54/0x80 /fs/stat.c:375 do_syscall_64+0xfd/0x6a0 /arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 12395: save_stack+0x23/0x90 /mm/kasan/common.c:69 set_track /mm/kasan/common.c:77 [inline] __kasan_slab_free+0x102/0x150 /mm/kasan/common.c:449 kasan_slab_free+0xe/0x10 /mm/kasan/common.c:457 __cache_free /mm/slab.c:3425 [inline] kfree+0x10a/0x2c0 /mm/slab.c:3756 tomoyo_realpath_from_path+0x1de/0x7b0 /security/tomoyo/realpath.c:319 tomoyo_get_realpath /security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x230/0x430 /security/tomoyo/file.c:822 tomoyo_inode_getattr+0x1d/0x30 /security/tomoyo/tomoyo.c:129 security_inode_getattr+0xf2/0x150 /security/security.c:1182 vfs_getattr+0x25/0x70 /fs/stat.c:115 vfs_statx_fd+0x71/0xc0 /fs/stat.c:145 vfs_fstat /./include/linux/fs.h:3198 [inline] __do_sys_newfstat+0x9b/0x120 /fs/stat.c:378 __se_sys_newfstat /fs/stat.c:375 [inline] __x64_sys_newfstat+0x54/0x80 /fs/stat.c:375 do_syscall_64+0xfd/0x6a0 /arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88809abec840 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 336 bytes inside of 4096-byte region [ffff88809abec840, ffff88809abed840) The buggy address belongs to the page: page:ffffea00026afb00 refcount:1 mapcount:0 mapping:ffff8880aa402000 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea000267c908 ffffea0000af6c88 ffff8880aa402000 raw: 0000000000000000 ffff88809abec840 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809abec880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809abec900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88809abec980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809abeca00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809abeca80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================