==================================================================
BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:388 [inline]
BUG: KASAN: use-after-free in tcp_write_timer_handler+0x7ef/0x930 net/ipv4/tcp_timer.c:652
Read of size 1 at addr ffff8880a93b5c05 by task syz-executor.0/10123
CPU: 0 PID: 10123 Comm: syz-executor.0 Not tainted 6.1.82-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x15f/0x4f0 mm/kasan/report.c:395
kasan_report+0x136/0x160 mm/kasan/report.c:495
tcp_probe_timer net/ipv4/tcp_timer.c:388 [inline]
tcp_write_timer_handler+0x7ef/0x930 net/ipv4/tcp_timer.c:652
tcp_write_timer+0x12e/0x280 net/ipv4/tcp_timer.c:665
call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1519 [inline]
__run_timers+0x67c/0x890 kernel/time/timer.c:1790
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1803
__do_softirq+0x2e9/0xa4c kernel/softirq.c:571
invoke_softirq kernel/softirq.c:445 [inline]
__irq_exit_rcu+0x155/0x240 kernel/softirq.c:650
irq_exit_rcu+0x5/0x20 kernel/softirq.c:662
sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1106
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:653
RIP: 0010:finish_task_switch+0x1d3/0x810 kernel/sched/core.c:5124
Code: 38 0b 00 48 83 c4 08 4c 89 f7 e8 98 30 00 00 0f 1f 44 00 00 4c 89 f7 e8 5b b0 34 09 e8 c6 2a 32 00 fb 49 8d bc 24 f8 15 00 00 <48> 89 f8 48 c1 e8 03 49 bd 00 00 00 00 00 fc ff df 42 0f b6 04 28
RSP: 0018:ffffc9000327e928 EFLAGS: 00000282
RAX: 1fb8e78b7e25b100 RBX: ffff88807be5bbb4 RCX: ffffffff816abf3a
RDX: dffffc0000000000 RSI: ffffffff8aebee40 RDI: ffff8880260c6f38
RBP: ffffc9000327e970 R08: dffffc0000000000 R09: fffffbfff2092c55
R10: 0000000000000000 R11: dffffc0000000001 R12: ffff8880260c5940
R13: 1ffff110173076eb R14: ffff8880b983aa00 R15: ffff8880b983b758
context_switch kernel/sched/core.c:5248 [inline]
__schedule+0x1435/0x4550 kernel/sched/core.c:6558
preempt_schedule_common+0x83/0xd0 kernel/sched/core.c:6727
preempt_schedule+0xd9/0xe0 kernel/sched/core.c:6751
preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:34
unwind_next_frame+0x1a55/0x2220 arch/x86/kernel/unwind_orc.c:629
arch_stack_walk+0x10d/0x140 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x113/0x1c0 kernel/stacktrace.c:122
save_stack+0xf6/0x1e0 mm/page_owner.c:127
__set_page_owner+0x26/0x390 mm/page_owner.c:190
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513
prep_new_page mm/page_alloc.c:2520 [inline]
get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279
__alloc_pages+0x28d/0x770 mm/page_alloc.c:5545
__alloc_pages_bulk+0x74a/0xd60 mm/page_alloc.c:5493
vm_area_alloc_pages mm/vmalloc.c:2955 [inline]
__vmalloc_area_node mm/vmalloc.c:3051 [inline]
__vmalloc_node_range+0x743/0x1460 mm/vmalloc.c:3223
__vmalloc_node mm/vmalloc.c:3288 [inline]
vzalloc+0x75/0x80 mm/vmalloc.c:3361
alloc_counters+0xd0/0x7b0 net/ipv4/netfilter/ip_tables.c:801
copy_entries_to_user net/ipv4/netfilter/ip_tables.c:823 [inline]
get_entries net/ipv4/netfilter/ip_tables.c:1024 [inline]
do_ipt_get_ctl+0xeb1/0x1890 net/ipv4/netfilter/ip_tables.c:1662
nf_getsockopt+0x28e/0x2b0 net/netfilter/nf_sockopt.c:116
ip_getsockopt+0x21a/0x2d0 net/ipv4/ip_sockglue.c:1826
tcp_getsockopt+0x15c/0x1c0 net/ipv4/tcp.c:4443
__sys_getsockopt+0x2b2/0x5d0 net/socket.c:2327
__do_sys_getsockopt net/socket.c:2342 [inline]
__se_sys_getsockopt net/socket.c:2339 [inline]
__x64_sys_getsockopt+0xb1/0xc0 net/socket.c:2339
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fb222a7f94a
Code: c4 c1 e0 1a 0d 00 00 04 00 89 01 e9 e0 fe ff ff e8 3b 05 00 00 66 2e 0f 1f 84 00 00 00 00 00 90 49 89 ca b8 37 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 06 c3 0f 1f 44 00 00 48 c7 c2 b0 ff ff ff f7
RSP: 002b:00007ffc6320fcc8 EFLAGS: 00000216 ORIG_RAX: 0000000000000037
RAX: ffffffffffffffda RBX: 00007ffc6320fd50 RCX: 00007fb222a7f94a
RDX: 0000000000000041 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000003 R08: 00007ffc6320fcec R09: 00007ffc63210107
R10: 00007ffc6320fd50 R11: 0000000000000216 R12: 00007fb222b7cd00
R13: 00007ffc6320fcec R14: 0000000000000000 R15: 00007fb222b7eec0
Allocated by task 11216:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
__kasan_slab_alloc+0x65/0x70 mm/kasan/common.c:328
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x52/0x3a0 mm/slab.h:737
slab_alloc_node mm/slub.c:3398 [inline]
slab_alloc mm/slub.c:3406 [inline]
__kmem_cache_alloc_lru mm/slub.c:3413 [inline]
kmem_cache_alloc+0x10c/0x2d0 mm/slub.c:3422
kmem_cache_zalloc include/linux/slab.h:682 [inline]
net_alloc net/core/net_namespace.c:410 [inline]
copy_net_ns+0x143/0x5d0 net/core/net_namespace.c:465
create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0x11e/0x170 kernel/nsproxy.c:226
ksys_unshare+0x580/0xb20 kernel/fork.c:3203
__do_sys_unshare kernel/fork.c:3274 [inline]
__se_sys_unshare kernel/fork.c:3272 [inline]
__x64_sys_unshare+0x34/0x40 kernel/fork.c:3272
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45
__kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:486
insert_work+0x54/0x3d0 kernel/workqueue.c:1361
__queue_work+0xb4b/0xf90 kernel/workqueue.c:1520
call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1514 [inline]
__run_timers+0x6a8/0x890 kernel/time/timer.c:1790
__do_softirq+0x2e9/0xa4c kernel/softirq.c:571
Second to last potentially related work creation:
kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45
__kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:486
insert_work+0x54/0x3d0 kernel/workqueue.c:1361
__queue_work+0xb4b/0xf90 kernel/workqueue.c:1520
call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1514 [inline]
__run_timers+0x6a8/0x890 kernel/time/timer.c:1790
__do_softirq+0x2e9/0xa4c kernel/softirq.c:571
The buggy address belongs to the object at ffff8880a93b54c0
which belongs to the cache net_namespace of size 6976
The buggy address is located 1861 bytes inside of
6976-byte region [ffff8880a93b54c0, ffff8880a93b7000)
The buggy address belongs to the physical page:
page:ffffea0002a4ec00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880a93b54c0 pfn:0xa93b0
head:ffffea0002a4ec00 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff888012767201
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888012626500
raw: ffff8880a93b54c0 0000000080040001 00000001ffffffff ffff888012767201
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 1616, tgid 1613 (syz-executor.3), ts 1020505916316, free_ts 1020497577704
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513
prep_new_page mm/page_alloc.c:2520 [inline]
get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279
__alloc_pages+0x28d/0x770 mm/page_alloc.c:5545
alloc_slab_page+0x6a/0x150 mm/slub.c:1794
allocate_slab mm/slub.c:1939 [inline]
new_slab+0x84/0x2d0 mm/slub.c:1992
___slab_alloc+0xc20/0x1270 mm/slub.c:3180
__slab_alloc mm/slub.c:3279 [inline]
slab_alloc_node mm/slub.c:3364 [inline]
slab_alloc mm/slub.c:3406 [inline]
__kmem_cache_alloc_lru mm/slub.c:3413 [inline]
kmem_cache_alloc+0x1a5/0x2d0 mm/slub.c:3422
kmem_cache_zalloc include/linux/slab.h:682 [inline]
net_alloc net/core/net_namespace.c:410 [inline]
copy_net_ns+0x143/0x5d0 net/core/net_namespace.c:465
create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0x11e/0x170 kernel/nsproxy.c:226
ksys_unshare+0x580/0xb20 kernel/fork.c:3203
__do_sys_unshare kernel/fork.c:3274 [inline]
__se_sys_unshare kernel/fork.c:3272 [inline]
__x64_sys_unshare+0x34/0x40 kernel/fork.c:3272
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
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:1440 [inline]
free_pcp_prepare mm/page_alloc.c:1490 [inline]
free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3358
free_unref_page+0x33/0x3e0 mm/page_alloc.c:3453
free_slab mm/slub.c:2031 [inline]
discard_slab mm/slub.c:2037 [inline]
__unfreeze_partials+0x1b7/0x210 mm/slub.c:2586
put_cpu_partial+0x17b/0x250 mm/slub.c:2662
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x156/0x170 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x1f/0x70 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x52/0x3a0 mm/slab.h:737
slab_alloc_node mm/slub.c:3398 [inline]
slab_alloc mm/slub.c:3406 [inline]
__kmem_cache_alloc_lru mm/slub.c:3413 [inline]
kmem_cache_alloc_lru+0x10c/0x2d0 mm/slub.c:3429
__d_alloc+0x31/0x710 fs/dcache.c:1770
d_alloc fs/dcache.c:1850 [inline]
d_alloc_name+0xe0/0x290 fs/dcache.c:1912
simple_fill_super+0x2ee/0x600 fs/libfs.c:684
nfsd_fill_super+0x80/0x110 fs/nfsd/nfsctl.c:1366
vfs_get_super fs/super.c:1200 [inline]
get_tree_keyed+0xd7/0x180 fs/super.c:1256
vfs_get_tree+0x88/0x270 fs/super.c:1562
do_new_mount+0x2ba/0xb40 fs/namespace.c:3051
Memory state around the buggy address:
ffff8880a93b5b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880a93b5b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880a93b5c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880a93b5c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880a93b5d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess), 1 bytes skipped:
0: 0b 00 or (%rax),%eax
2: 48 83 c4 08 add $0x8,%rsp
6: 4c 89 f7 mov %r14,%rdi
9: e8 98 30 00 00 call 0x30a6
e: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
13: 4c 89 f7 mov %r14,%rdi
16: e8 5b b0 34 09 call 0x934b076
1b: e8 c6 2a 32 00 call 0x322ae6
20: fb sti
21: 49 8d bc 24 f8 15 00 lea 0x15f8(%r12),%rdi
28: 00
* 29: 48 89 f8 mov %rdi,%rax <-- trapping instruction
2c: 48 c1 e8 03 shr $0x3,%rax
30: 49 bd 00 00 00 00 00 movabs $0xdffffc0000000000,%r13
37: fc ff df
3a: 42 0f b6 04 28 movzbl (%rax,%r13,1),%eax