================================================================== 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 ffff88806b6a2750 by task kworker/u4:4/3006 CPU: 0 PID: 3006 Comm: kworker/u4:4 Not tainted 5.2.0+ #97 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: bat_events batadv_nc_worker 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:lock_release+0x4c0/0x960 /kernel/locking/lockdep.c:4435 Code: 00 00 00 00 00 48 c1 e8 03 80 3c 10 00 0f 85 8c 03 00 00 48 83 3d cf 1f 7a 07 00 0f 84 7f 01 00 00 48 8b bd 48 ff ff ff 57 9d <0f> 1f 44 00 00 48 b8 00 00 00 00 00 fc ff df 48 01 c3 48 c7 03 00 RSP: 0018:ffff88809f96fb88 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 RAX: 1ffffffff11a5e02 RBX: 1ffff11013f2df76 RCX: 1ffff11013f2c1b0 RDX: dffffc0000000000 RSI: 1ffff11013f2c1bc RDI: 0000000000000286 RBP: ffff88809f96fc58 R08: 0000000000000003 R09: ffff88809f960d88 R10: fffffbfff1349eef R11: ffffffff89a4f77f R12: ffff88809f960500 R13: ffffffff871cea7c R14: ffff88809f96fc30 R15: ffff88809f960500 rcu_lock_release /./include/linux/rcupdate.h:213 [inline] rcu_read_unlock /./include/linux/rcupdate.h:646 [inline] batadv_nc_process_nc_paths.part.0+0x273/0x3c0 /net/batman-adv/network-coding.c:698 batadv_nc_process_nc_paths /net/batman-adv/network-coding.c:678 [inline] batadv_nc_worker+0x550/0x760 /net/batman-adv/network-coding.c:727 process_one_work+0x9af/0x1740 /kernel/workqueue.c:2269 worker_thread+0x98/0xe40 /kernel/workqueue.c:2415 kthread+0x361/0x430 /kernel/kthread.c:255 ret_from_fork+0x24/0x30 /arch/x86/entry/entry_64.S:352 Allocated by task 29111: 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_path_symlink+0xaa/0xf0 /security/tomoyo/tomoyo.c:206 security_path_symlink+0x10a/0x170 /security/security.c:1013 do_symlinkat+0x137/0x290 /fs/namei.c:4152 __do_sys_symlink /fs/namei.c:4173 [inline] __se_sys_symlink /fs/namei.c:4171 [inline] __x64_sys_symlink+0x59/0x80 /fs/namei.c:4171 do_syscall_64+0xfd/0x6a0 /arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 29111: 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_path_symlink+0xaa/0xf0 /security/tomoyo/tomoyo.c:206 security_path_symlink+0x10a/0x170 /security/security.c:1013 do_symlinkat+0x137/0x290 /fs/namei.c:4152 __do_sys_symlink /fs/namei.c:4173 [inline] __se_sys_symlink /fs/namei.c:4171 [inline] __x64_sys_symlink+0x59/0x80 /fs/namei.c:4171 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 ffff88806b6a2140 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 1552 bytes inside of 4096-byte region [ffff88806b6a2140, ffff88806b6a3140) The buggy address belongs to the page: page:ffffea0001ada880 refcount:1 mapcount:0 mapping:ffff8880aa402000 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea00017f7b88 ffffea0001a53e88 ffff8880aa402000 raw: 0000000000000000 ffff88806b6a2140 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88806b6a2600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806b6a2680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88806b6a2700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88806b6a2780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806b6a2800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================