[v6.1] KASAN: use-after-free Read in tcp_retransmit_timer (4)

0 views
Skip to first unread message

syzbot

unread,
Mar 28, 2025, 2:41:25 AMMar 28
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 344a09659766 Linux 6.1.131
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1233b43f980000
kernel config: https://syzkaller.appspot.com/x/.config?x=1eebf09bc04ebd78
dashboard link: https://syzkaller.appspot.com/bug?extid=724b6182cd2c88e9450e
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/bccba205a29a/disk-344a0965.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/bdca79b3b5db/vmlinux-344a0965.xz
kernel image: https://storage.googleapis.com/syzbot-assets/6c2271a91ef3/bzImage-344a0965.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+724b61...@syzkaller.appspotmail.com

IPVS: nq: UDP 224.0.0.2:0 - no destination available
==================================================================
BUG: KASAN: use-after-free in tcp_retransmit_timer+0x751/0x2830 net/ipv4/tcp_timer.c:546
Read of size 8 at addr ffff88805ace82c8 by task syz.2.481/6359

CPU: 0 PID: 6359 Comm: syz.2.481 Not tainted 6.1.131-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
<TASK>
__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:316 [inline]
print_report+0x15f/0x4f0 mm/kasan/report.c:427
kasan_report+0x136/0x160 mm/kasan/report.c:531
tcp_retransmit_timer+0x751/0x2830 net/ipv4/tcp_timer.c:546
tcp_write_timer+0x12e/0x280 net/ipv4/tcp_timer.c:676
call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1504
expire_timers kernel/time/timer.c:1549 [inline]
__run_timers+0x67c/0x890 kernel/time/timer.c:1820
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1833
handle_softirqs+0x2ee/0xa40 kernel/softirq.c:578
__do_softirq kernel/softirq.c:612 [inline]
invoke_softirq kernel/softirq.c:452 [inline]
__irq_exit_rcu+0x157/0x240 kernel/softirq.c:661
irq_exit_rcu+0x5/0x20 kernel/softirq.c:673
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1118 [inline]
sysvec_apic_timer_interrupt+0x52/0xc0 arch/x86/kernel/apic/apic.c:1118
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:691
RIP: 0033:0x7f08f084fc8b
Code: cd 48 01 c1 49 39 4f 08 72 4c 8d 4d ff 85 ed 74 33 66 0f 1f 44 00 00 48 39 f0 72 1b 4d 8b 07 49 89 c1 49 29 f1 47 0f b6 0c 08 <45> 84 c9 74 08 45 88 0c 00 49 8b 47 10 48 83 c0 01 49 89 47 10 83
RSP: 002b:00007f08f18084a0 EFLAGS: 00000202
RAX: 00000000001c2e63 RBX: 00007f08f1808540 RCX: 0000000000000016
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 00007f08f18085e0
RBP: 0000000000000102 R08: 00007f08e61f7000 R09: 0000000000000000
R10: 0000000000000000 R11: 00007f08f1808550 R12: 0000000000000001
R13: 00007f08f0a293e0 R14: 0000000000000000 R15: 00007f08f18085e0
</TASK>

Allocated by task 4262:
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:689 [inline]
net_alloc net/core/net_namespace.c:423 [inline]
copy_net_ns+0x13c/0x590 net/core/net_namespace.c:495
create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0x11e/0x170 kernel/nsproxy.c:226
ksys_unshare+0x531/0xa40 kernel/fork.c:3201
__do_sys_unshare kernel/fork.c:3272 [inline]
__se_sys_unshare kernel/fork.c:3270 [inline]
__x64_sys_unshare+0x34/0x40 kernel/fork.c:3270
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 4537:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook mm/slub.c:1750 [inline]
slab_free mm/slub.c:3661 [inline]
kmem_cache_free+0x292/0x510 mm/slub.c:3683
net_complete_free net/core/net_namespace.c:459 [inline]
cleanup_net+0x99a/0xd20 net/core/net_namespace.c:653
process_one_work+0x917/0x1260 kernel/workqueue.c:2292
worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
kthread+0x28d/0x320 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

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:1504
expire_timers kernel/time/timer.c:1544 [inline]
__run_timers+0x6a8/0x890 kernel/time/timer.c:1820
handle_softirqs+0x2ee/0xa40 kernel/softirq.c:578
__do_softirq kernel/softirq.c:612 [inline]
invoke_softirq kernel/softirq.c:452 [inline]
__irq_exit_rcu+0x157/0x240 kernel/softirq.c:661
irq_exit_rcu+0x5/0x20 kernel/softirq.c:673
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1118 [inline]
sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1118
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:691

The buggy address belongs to the object at ffff88805ace8000
which belongs to the cache net_namespace of size 6976
The buggy address is located 712 bytes inside of
6976-byte region [ffff88805ace8000, ffff88805ace9b40)

The buggy address belongs to the physical page:
page:ffffea00016b3a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5ace8
head:ffffea00016b3a00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888140009500
raw: 0000000000000000 0000000080040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4262, tgid 4262 (syz-executor), ts 77758028741, free_ts 21075328985
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2532
prep_new_page mm/page_alloc.c:2539 [inline]
get_page_from_freelist+0x3731/0x38d0 mm/page_alloc.c:4328
__alloc_pages+0x28d/0x770 mm/page_alloc.c:5606
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:689 [inline]
net_alloc net/core/net_namespace.c:423 [inline]
copy_net_ns+0x13c/0x590 net/core/net_namespace.c:495
create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0x11e/0x170 kernel/nsproxy.c:226
ksys_unshare+0x531/0xa40 kernel/fork.c:3201
__do_sys_unshare kernel/fork.c:3272 [inline]
__se_sys_unshare kernel/fork.c:3270 [inline]
__x64_sys_unshare+0x34/0x40 kernel/fork.c:3270
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
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 mm/page_alloc.c:1509 [inline]
free_unref_page_prepare+0x12a6/0x15b0 mm/page_alloc.c:3384
free_unref_page+0x33/0x3e0 mm/page_alloc.c:3479
free_contig_range+0x9a/0x150 mm/page_alloc.c:9566
destroy_args+0xfe/0x997 mm/debug_vm_pgtable.c:1031
debug_vm_pgtable+0x46d/0x4c2 mm/debug_vm_pgtable.c:1354
do_one_initcall+0x265/0x8f0 init/main.c:1298
do_initcall_level+0x157/0x207 init/main.c:1371
do_initcalls+0x49/0x86 init/main.c:1387
kernel_init_freeable+0x45c/0x60f init/main.c:1626
kernel_init+0x19/0x290 init/main.c:1514
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Memory state around the buggy address:
ffff88805ace8180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88805ace8200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88805ace8280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88805ace8300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88805ace8380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Sep 23, 2025, 5:19:20 PM (2 days ago) Sep 23
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages