================================================================== BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:378 [inline] BUG: KASAN: use-after-free in tcp_write_timer_handler net/ipv4/tcp_timer.c:624 [inline] BUG: KASAN: use-after-free in tcp_write_timer_handler+0x99c/0x9f0 net/ipv4/tcp_timer.c:594 Read of size 1 at addr ffff888075976805 by task kworker/u16:5/19049 CPU: 0 PID: 19049 Comm: kworker/u16:5 Not tainted 6.1.0-rc7-syzkaller-00103-gef4d3ea40565 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Workqueue: bat_events batadv_nc_worker Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15e/0x461 mm/kasan/report.c:395 kasan_report+0xbf/0x1f0 mm/kasan/report.c:495 tcp_probe_timer net/ipv4/tcp_timer.c:378 [inline] tcp_write_timer_handler net/ipv4/tcp_timer.c:624 [inline] tcp_write_timer_handler+0x99c/0x9f0 net/ipv4/tcp_timer.c:594 tcp_write_timer+0xa6/0x2b0 net/ipv4/tcp_timer.c:637 call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers.part.0+0x6a2/0xaf0 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb7/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1fb/0xadc kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 irq_exit_rcu+0x9/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x97/0xc0 arch/x86/kernel/apic/apic.c:1107 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0010:lock_is_held_type+0x103/0x140 kernel/locking/lockdep.c:5716 Code: 00 00 b8 ff ff ff ff 65 0f c1 05 20 a6 15 76 83 f8 01 75 29 9c 58 f6 c4 02 75 3d 48 f7 04 24 00 02 00 00 74 01 fb 48 83 c4 08 <44> 89 e8 5b 5d 41 5c 41 5d 41 5e 41 5f c3 45 31 ed eb b9 0f 0b 48 RSP: 0018:ffffc90004b6fb78 EFLAGS: 00000286 RAX: 0000000000000046 RBX: 0000000000000003 RCX: 0000000000000001 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000 RBP: ffffffff8c58cd00 R08: 0000000000000000 R09: ffffffff8e50f517 R10: fffffbfff1ca1ea2 R11: 0000000000000000 R12: ffff88806a3341c0 R13: 0000000000000000 R14: 00000000ffffffff R15: ffff88806a334c60 lock_is_held include/linux/lockdep.h:283 [inline] rcu_read_lock_sched_held+0x3e/0x70 kernel/rcu/update.c:125 trace_lock_release include/trace/events/lock.h:69 [inline] lock_release+0x5cf/0x810 kernel/locking/lockdep.c:5679 rcu_lock_release include/linux/rcupdate.h:309 [inline] rcu_read_unlock include/linux/rcupdate.h:771 [inline] batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:412 [inline] batadv_nc_worker+0x86f/0xfa0 net/batman-adv/network-coding.c:719 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 23833: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x7f/0x90 mm/kasan/common.c:325 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slab.c:3257 [inline] slab_alloc mm/slab.c:3265 [inline] __kmem_cache_alloc_lru mm/slab.c:3442 [inline] kmem_cache_alloc+0x220/0x460 mm/slab.c:3461 kmem_cache_zalloc include/linux/slab.h:679 [inline] net_alloc net/core/net_namespace.c:410 [inline] copy_net_ns+0x129/0x760 net/core/net_namespace.c:465 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc5/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x449/0x920 kernel/fork.c:3188 __do_sys_unshare kernel/fork.c:3259 [inline] __se_sys_unshare kernel/fork.c:3257 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3257 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0x7b/0x90 mm/kasan/generic.c:481 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x693/0x13b0 kernel/workqueue.c:1517 call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers.part.0+0x4a3/0xaf0 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0x156/0x1d0 kernel/time/timer.c:1805 __do_softirq+0x1fb/0xadc kernel/softirq.c:571 Second to last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0x7b/0x90 mm/kasan/generic.c:481 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x693/0x13b0 kernel/workqueue.c:1517 call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers.part.0+0x4a3/0xaf0 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0x156/0x1d0 kernel/time/timer.c:1805 __do_softirq+0x1fb/0xadc kernel/softirq.c:571 The buggy address belongs to the object at ffff8880759760c0 which belongs to the cache net_namespace of size 6976 The buggy address is located 1861 bytes inside of 6976-byte region [ffff8880759760c0, ffff888075977c00) The buggy address belongs to the physical page: page:ffffea0001d65d80 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880759760c0 pfn:0x75976 head:ffffea0001d65d80 order:1 compound_mapcount:0 compound_pincount:0 memcg:ffff888074ed4801 flags: 0x4fff00000010200(slab|head|node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000010200 ffffea00010b5988 ffffea0001a8cb88 ffff8880129a5700 raw: ffff8880759760c0 ffff8880759760c0 0000000100000000 ffff888074ed4801 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x140cc0(GFP_USER|__GFP_COMP), pid 16809, tgid 16809 (syz-executor.3), ts 704507835281, free_ts 702867719614 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4291 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5558 __alloc_pages_node include/linux/gfp.h:223 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x75/0x360 mm/slab.c:2570 fallback_alloc+0x1e2/0x2d0 mm/slab.c:3113 __do_cache_alloc mm/slab.c:3217 [inline] slab_alloc_node mm/slab.c:3250 [inline] slab_alloc mm/slab.c:3265 [inline] __kmem_cache_alloc_lru mm/slab.c:3442 [inline] kmem_cache_alloc+0x300/0x460 mm/slab.c:3461 kmem_cache_zalloc include/linux/slab.h:679 [inline] net_alloc net/core/net_namespace.c:410 [inline] copy_net_ns+0x129/0x760 net/core/net_namespace.c:465 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc5/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x449/0x920 kernel/fork.c:3188 __do_sys_unshare kernel/fork.c:3259 [inline] __se_sys_unshare kernel/fork.c:3257 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3257 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1509 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page+0x1d/0x4d0 mm/page_alloc.c:3483 slab_destroy mm/slab.c:1615 [inline] slabs_destroy+0x85/0xc0 mm/slab.c:1635 __cache_free_alien mm/slab.c:774 [inline] cache_free_alien mm/slab.c:790 [inline] ___cache_free+0x204/0x3d0 mm/slab.c:3416 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x4f/0x1a0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x184/0x210 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x63/0x90 mm/kasan/common.c:302 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slab.c:3257 [inline] slab_alloc mm/slab.c:3265 [inline] __kmem_cache_alloc_lru mm/slab.c:3442 [inline] kmem_cache_alloc+0x220/0x460 mm/slab.c:3461 getname_flags.part.0+0x50/0x4f0 fs/namei.c:139 getname_flags+0x9e/0xe0 include/linux/audit.h:320 user_path_at_empty+0x2f/0x60 fs/namei.c:2875 user_path_at include/linux/namei.h:57 [inline] ksys_umount fs/namespace.c:1822 [inline] __do_sys_umount fs/namespace.c:1830 [inline] __se_sys_umount fs/namespace.c:1828 [inline] __x64_sys_umount+0xfc/0x190 fs/namespace.c:1828 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888075976700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888075976780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888075976800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888075976880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888075976900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: b8 ff ff ff ff mov $0xffffffff,%eax 7: 65 0f c1 05 20 a6 15 xadd %eax,%gs:0x7615a620(%rip) # 0x7615a62f e: 76 f: 83 f8 01 cmp $0x1,%eax 12: 75 29 jne 0x3d 14: 9c pushfq 15: 58 pop %rax 16: f6 c4 02 test $0x2,%ah 19: 75 3d jne 0x58 1b: 48 f7 04 24 00 02 00 testq $0x200,(%rsp) 22: 00 23: 74 01 je 0x26 25: fb sti 26: 48 83 c4 08 add $0x8,%rsp * 2a: 44 89 e8 mov %r13d,%eax <-- trapping instruction 2d: 5b pop %rbx 2e: 5d pop %rbp 2f: 41 5c pop %r12 31: 41 5d pop %r13 33: 41 5e pop %r14 35: 41 5f pop %r15 37: c3 retq 38: 45 31 ed xor %r13d,%r13d 3b: eb b9 jmp 0xfffffff6 3d: 0f 0b ud2 3f: 48 rex.W