================================================================== 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 ffff88808977e6d0 by task syz-executor.3/24733 CPU: 0 PID: 24733 Comm: syz-executor.3 Not tainted 5.3.0-rc7+ #0 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:618 __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:1133 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:768 [inline] RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x95/0xe0 kernel/locking/spinlock.c:191 Code: 48 c7 c0 50 f4 d2 88 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 75 39 48 83 3d 72 d9 94 01 00 74 24 48 89 df 57 9d <0f> 1f 44 00 00 bf 01 00 00 00 e8 bc a6 10 fa 65 8b 05 0d e3 c3 78 RSP: 0018:ffff88804dec76f8 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 RAX: 1ffffffff11a5e8a RBX: 0000000000000286 RCX: 1ffffffff134b5ce RDX: dffffc0000000000 RSI: ffffffff8177f1ae RDI: 0000000000000286 RBP: ffff88804dec7708 R08: ffff88808f99a040 R09: ffffed100cedf310 R10: ffffed100cedf30f R11: ffff8880676f987b R12: ffff8880676f9878 R13: 0000000000000286 R14: ffff8880676f9878 R15: ffffea0001ff0788 spin_unlock_irqrestore include/linux/spinlock.h:393 [inline] delete_from_page_cache+0x15a/0x270 mm/filemap.c:272 truncate_inode_page+0x8e/0xd0 mm/truncate.c:228 shmem_undo_range+0xcb3/0x2160 mm/shmem.c:849 shmem_truncate_range+0x27/0xa0 mm/shmem.c:977 shmem_evict_inode+0x311/0xad0 mm/shmem.c:1077 evict+0x306/0x680 fs/inode.c:571 iput_final fs/inode.c:1560 [inline] iput+0x530/0x8b0 fs/inode.c:1586 dentry_unlink_inode+0x2d9/0x400 fs/dcache.c:374 __dentry_kill+0x38b/0x600 fs/dcache.c:579 dentry_kill fs/dcache.c:686 [inline] dput+0x819/0xde0 fs/dcache.c:859 __fput+0x424/0x890 fs/file_table.c:293 ____fput+0x16/0x20 fs/file_table.c:313 task_work_run+0x145/0x1c0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x92f/0x2e50 kernel/exit.c:879 do_group_exit+0x135/0x360 kernel/exit.c:983 __do_sys_exit_group kernel/exit.c:994 [inline] __se_sys_exit_group kernel/exit.c:992 [inline] __x64_sys_exit_group+0x44/0x50 kernel/exit.c:992 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459879 Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ffe63ef8b68 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 000000000000001e RCX: 0000000000459879 RDX: 0000000000413561 RSI: fffffffffffffff7 RDI: 0000000000000000 RBP: 0000000000000000 R08: 000000009cb1f87e R09: 00007ffe63ef8bc0 R10: ffffffff8128fd68 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe63ef8bc0 R14: 0000000000000000 R15: 00007ffe63ef8bd0 Allocated by task 9797: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:493 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:466 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:501 slab_post_alloc_hook mm/slab.h:520 [inline] slab_alloc mm/slab.c:3319 [inline] kmem_cache_alloc+0x121/0x710 mm/slab.c:3483 kmem_cache_zalloc include/linux/slab.h:738 [inline] net_alloc net/core/net_namespace.c:410 [inline] copy_net_ns+0xf1/0x41f net/core/net_namespace.c:462 create_new_namespaces+0x400/0x7b0 kernel/nsproxy.c:103 unshare_nsproxy_namespaces+0xc2/0x200 kernel/nsproxy.c:202 ksys_unshare+0x444/0x980 kernel/fork.c:2831 __do_sys_unshare kernel/fork.c:2899 [inline] __se_sys_unshare kernel/fork.c:2897 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:2897 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 22667: 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:455 kasan_slab_free+0xe/0x10 mm/kasan/common.c:463 __cache_free mm/slab.c:3425 [inline] kmem_cache_free+0x86/0x320 mm/slab.c:3693 net_free net/core/net_namespace.c:438 [inline] net_drop_ns.part.0+0x70/0x90 net/core/net_namespace.c:445 net_drop_ns net/core/net_namespace.c:444 [inline] cleanup_net+0x774/0xa60 net/core/net_namespace.c:613 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 The buggy address belongs to the object at ffff88808977e100 which belongs to the cache net_namespace of size 6784 The buggy address is located 1488 bytes inside of 6784-byte region [ffff88808977e100, ffff88808977fb80) The buggy address belongs to the page: page:ffffea000225df80 refcount:1 mapcount:0 mapping:ffff88821b69e1c0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea0002226888 ffffea0001bb3c88 ffff88821b69e1c0 raw: 0000000000000000 ffff88808977e100 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808977e580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808977e600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88808977e680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808977e700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808977e780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================