KASAN: use-after-free Read in tcp_retransmit_timer (3)

7 views
Skip to first unread message

syzbot

unread,
Oct 30, 2022, 1:38:41 PM10/30/22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=151952ca880000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=d86325b52e12b0fbae30
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/98c0bdb4abb3/disk-3f8a27f9.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ea228ff02669/vmlinux-3f8a27f9.xz

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

==================================================================
BUG: KASAN: use-after-free in tcp_retransmit_timer+0x2fc3/0x33f0 net/ipv4/tcp_timer.c:480
Read of size 8 at addr ffff88808f41c2b8 by task syz-executor.5/1616

CPU: 1 PID: 1616 Comm: syz-executor.5 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022
Call Trace:
<IRQ>
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
kasan_report mm/kasan/report.c:412 [inline]
__asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433
tcp_retransmit_timer+0x2fc3/0x33f0 net/ipv4/tcp_timer.c:480
tcp_write_timer_handler+0x5e6/0xa60 net/ipv4/tcp_timer.c:593
tcp_write_timer+0x103/0x1b0 net/ipv4/tcp_timer.c:613
call_timer_fn+0x177/0x700 kernel/time/timer.c:1338
expire_timers+0x243/0x4e0 kernel/time/timer.c:1375
__run_timers kernel/time/timer.c:1696 [inline]
run_timer_softirq+0x21c/0x670 kernel/time/timer.c:1709
__do_softirq+0x265/0x980 kernel/softirq.c:292
invoke_softirq kernel/softirq.c:372 [inline]
irq_exit+0x215/0x260 kernel/softirq.c:412
exiting_irq arch/x86/include/asm/apic.h:536 [inline]
smp_apic_timer_interrupt+0x136/0x550 arch/x86/kernel/apic/apic.c:1098
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:894
</IRQ>
RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:789 [inline]
RIP: 0010:lock_is_held_type+0x17a/0x210 kernel/locking/lockdep.c:3948
Code: 00 00 00 00 fc ff df c7 85 84 08 00 00 00 00 00 00 48 c1 e8 03 80 3c 10 00 75 63 48 83 3d 45 cc a6 08 00 74 2c 48 89 df 57 9d <0f> 1f 44 00 00 48 83 c4 08 44 89 e0 5b 5d 41 5c c3 48 83 c4 08 41
RSP: 0018:ffff88823100f860 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13
RAX: 1ffffffff13e3051 RBX: 0000000000000286 RCX: 0000000000000001
RDX: dffffc0000000000 RSI: 00000000ffffffff RDI: 0000000000000286
RBP: ffff8880350ae380 R08: 0000000000000001 R09: 00007f8a1a057000
R10: 0000000000000006 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88809bcb2770 R14: ffff8880a3261210 R15: ffff88809ddf7080
lock_is_held include/linux/lockdep.h:344 [inline]
___might_sleep+0x1ea/0x2b0 kernel/sched/core.c:6157
down_write+0x18/0x90 kernel/locking/rwsem.c:69
lock_anon_vma_root mm/rmap.c:238 [inline]
unlink_anon_vmas+0x178/0x840 mm/rmap.c:388
free_pgtables+0xe2/0x2f0 mm/memory.c:638
exit_mmap+0x2c8/0x530 mm/mmap.c:3094
__mmput kernel/fork.c:1016 [inline]
mmput+0x14e/0x4a0 kernel/fork.c:1037
exit_mm kernel/exit.c:549 [inline]
do_exit+0xaec/0x2be0 kernel/exit.c:857
do_group_exit+0x125/0x310 kernel/exit.c:967
get_signal+0x3f2/0x1f70 kernel/signal.c:2589
do_signal+0x8f/0x1670 arch/x86/kernel/signal.c:799
exit_to_usermode_loop+0x204/0x2a0 arch/x86/entry/common.c:163
prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline]
syscall_return_slowpath arch/x86/entry/common.c:271 [inline]
do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f8a194065a9
Code: Bad RIP value.
RSP: 002b:00007f8a17979218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: 0000000000000001 RBX: 00007f8a19526f88 RCX: 00007f8a194065a9
RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f8a19526f8c
RBP: 00007f8a19526f80 R08: 000002a46a7cc5d5 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000246 R12: 00007f8a19526f8c
R13: 00007ffdfbda13cf R14: 00007f8a17979300 R15: 0000000000022000

Allocated by task 8142:
kmem_cache_alloc+0x122/0x370 mm/slab.c:3559
kmem_cache_zalloc include/linux/slab.h:699 [inline]
net_alloc net/core/net_namespace.c:386 [inline]
copy_net_ns+0x106/0x340 net/core/net_namespace.c:426
create_new_namespaces+0x3f6/0x7b0 kernel/nsproxy.c:107
unshare_nsproxy_namespaces+0xbd/0x1f0 kernel/nsproxy.c:206
ksys_unshare+0x36c/0x9a0 kernel/fork.c:2542
__do_sys_unshare kernel/fork.c:2610 [inline]
__se_sys_unshare kernel/fork.c:2608 [inline]
__x64_sys_unshare+0x2d/0x40 kernel/fork.c:2608
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 26998:
__cache_free mm/slab.c:3503 [inline]
kmem_cache_free+0x7f/0x260 mm/slab.c:3765
net_free net/core/net_namespace.c:402 [inline]
net_drop_ns+0x73/0x90 net/core/net_namespace.c:409
cleanup_net+0x64c/0x8b0 net/core/net_namespace.c:572
process_one_work+0x864/0x1570 kernel/workqueue.c:2153
worker_thread+0x64c/0x1130 kernel/workqueue.c:2296
kthread+0x33f/0x460 kernel/kthread.c:259
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

The buggy address belongs to the object at ffff88808f41c080
which belongs to the cache net_namespace of size 8704
The buggy address is located 568 bytes inside of
8704-byte region [ffff88808f41c080, ffff88808f41e280)
The buggy address belongs to the page:
page:ffffea00023d0700 count:1 mapcount:0 mapping:ffff88823b843e00 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffffea000257c108 ffffea0002437b08 ffff88823b843e00
raw: 0000000000000000 ffff88808f41c080 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88808f41c180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88808f41c200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88808f41c280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88808f41c300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88808f41c380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess), 6 bytes skipped:
0: df c7 ffreep %st(7)
2: 85 84 08 00 00 00 00 test %eax,0x0(%rax,%rcx,1)
9: 00 00 add %al,(%rax)
b: 48 c1 e8 03 shr $0x3,%rax
f: 80 3c 10 00 cmpb $0x0,(%rax,%rdx,1)
13: 75 63 jne 0x78
15: 48 83 3d 45 cc a6 08 cmpq $0x0,0x8a6cc45(%rip) # 0x8a6cc62
1c: 00
1d: 74 2c je 0x4b
1f: 48 89 df mov %rbx,%rdi
22: 57 push %rdi
23: 9d popfq
* 24: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) <-- trapping instruction
29: 48 83 c4 08 add $0x8,%rsp
2d: 44 89 e0 mov %r12d,%eax
30: 5b pop %rbx
31: 5d pop %rbp
32: 41 5c pop %r12
34: c3 retq
35: 48 83 c4 08 add $0x8,%rsp
39: 41 rex.B


---
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.

syzbot

unread,
Feb 27, 2023, 12:38:34 PM2/27/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