KASAN: use-after-free Read in tcp_write_timer_handler (2)

46 views
Skip to first unread message

syzbot

unread,
Apr 30, 2021, 11:21:16 PM4/30/21
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 97a8651c Linux 4.19.189
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1197ddf5d00000
kernel config: https://syzkaller.appspot.com/x/.config?x=82311d18bf81a023
dashboard link: https://syzkaller.appspot.com/bug?extid=199671c2ccca7ce552f0

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

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

==================================================================
BUG: KASAN: use-after-free in tcp_orphan_retries net/ipv4/tcp_timer.c:139 [inline]
BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:374 [inline]
BUG: KASAN: use-after-free in tcp_write_timer_handler+0xa4b/0xa60 net/ipv4/tcp_timer.c:602
Read of size 4 at addr ffff8880a2554968 by task syz-executor.5/7039

CPU: 0 PID: 7039 Comm: syz-executor.5 Not tainted 4.19.189-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
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_load4_noabort+0x88/0x90 mm/kasan/report.c:432
tcp_orphan_retries net/ipv4/tcp_timer.c:139 [inline]
tcp_probe_timer net/ipv4/tcp_timer.c:374 [inline]
tcp_write_timer_handler+0xa4b/0xa60 net/ipv4/tcp_timer.c:602
tcp_write_timer+0x103/0x1b0 net/ipv4/tcp_timer.c:618
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:535 [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:rcu_is_watching+0x7e/0xc0 kernel/rcu/tree.c:1025
Code: 89 ea 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 0f b6 14 02 48 89 e8 83 e0 07 83 c0 03 38 d0 7c 04 84 d2 75 24 8b 43 10 d1 e8 <83> e0 01 65 ff 0d 18 73 b0 7e 74 07 48 83 c4 08 5b 5d c3 e8 2c d1
RSP: 0018:ffff88802c586b90 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff13
RAX: 0000000000058e61 RBX: ffff8880ba022a80 RCX: ffffffff81516bc3
RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffff8880ba022a90
RBP: ffff8880ba022a90 R08: 0000000000000000 R09: ffffed1017404552
R10: ffff8880ba022a93 R11: 0000000000000000 R12: ffff8880a2268930
R13: 0000000000000001 R14: ffffffff8d36cf40 R15: 0000000000000000
rcu_read_lock_held+0xba/0x110 kernel/rcu/update.c:283
blkg_lookup include/linux/blk-cgroup.h:337 [inline]
blkcg_bio_issue_check include/linux/blk-cgroup.h:813 [inline]
generic_make_request_checks+0xb49/0x22e0 block/blk-core.c:2342
generic_make_request+0x23f/0xdf0 block/blk-core.c:2412
submit_bio+0xb1/0x430 block/blk-core.c:2576
submit_bh_wbc+0x5a7/0x760 fs/buffer.c:3090
__block_write_full_page+0x71a/0xf60 fs/buffer.c:1777
block_write_full_page+0x1f3/0x260 fs/buffer.c:2951
__mpage_writepage+0x6b1/0x1570 fs/mpage.c:678
write_cache_pages+0x802/0x12d0 mm/page-writeback.c:2240
mpage_writepages+0xd1/0x230 fs/mpage.c:730
do_writepages+0xe5/0x290 mm/page-writeback.c:2344
__filemap_fdatawrite_range+0x27d/0x350 mm/filemap.c:446
file_write_and_wait_range+0x93/0x100 mm/filemap.c:776
__generic_file_fsync+0x74/0x1f0 fs/libfs.c:985
fat_file_fsync+0x73/0x200 fs/fat/file.c:198
vfs_fsync_range+0x13a/0x220 fs/sync.c:197
generic_write_sync include/linux/fs.h:2750 [inline]
generic_file_write_iter+0x4be/0x730 mm/filemap.c:3327
call_write_iter include/linux/fs.h:1821 [inline]
new_sync_write fs/read_write.c:474 [inline]
__vfs_write+0x51b/0x770 fs/read_write.c:487
__kernel_write+0x109/0x370 fs/read_write.c:506
write_pipe_buf+0x153/0x1f0 fs/splice.c:798
splice_from_pipe_feed fs/splice.c:503 [inline]
__splice_from_pipe+0x389/0x800 fs/splice.c:627
splice_from_pipe fs/splice.c:662 [inline]
default_file_splice_write+0xd8/0x180 fs/splice.c:810
do_splice_from fs/splice.c:852 [inline]
direct_splice_actor+0x115/0x160 fs/splice.c:1025
splice_direct_to_actor+0x33f/0x8d0 fs/splice.c:980
do_splice_direct+0x1a7/0x270 fs/splice.c:1068
do_sendfile+0x550/0xc30 fs/read_write.c:1447
__do_sys_sendfile64 fs/read_write.c:1508 [inline]
__se_sys_sendfile64+0x147/0x160 fs/read_write.c:1494
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4665f9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f22df76a188 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 00000000004665f9
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000004
RBP: 00000000004bfce1 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000001c500 R11: 0000000000000246 R12: 000000000056bf60
R13: 00007ffd06e045cf R14: 00007f22df76a300 R15: 0000000000022000

Allocated by task 10390:
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:385 [inline]
copy_net_ns+0x106/0x340 net/core/net_namespace.c:425
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:2541
__do_sys_unshare kernel/fork.c:2609 [inline]
__se_sys_unshare kernel/fork.c:2607 [inline]
__x64_sys_unshare+0x2d/0x40 kernel/fork.c:2607
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 33:
__cache_free mm/slab.c:3503 [inline]
kmem_cache_free+0x7f/0x260 mm/slab.c:3765
net_free net/core/net_namespace.c:401 [inline]
net_drop_ns+0x73/0x90 net/core/net_namespace.c:408
cleanup_net+0x64c/0x8b0 net/core/net_namespace.c:571
process_one_work+0x864/0x1570 kernel/workqueue.c:2152
worker_thread+0x64c/0x1130 kernel/workqueue.c:2295
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 ffff8880a2554200
which belongs to the cache net_namespace of size 8704
The buggy address is located 1896 bytes inside of
8704-byte region [ffff8880a2554200, ffff8880a2556400)
The buggy address belongs to the page:
page:ffffea0002895500 count:1 mapcount:0 mapping:ffff88823b843e00 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffffea000117be08 ffffea0002c5ba08 ffff88823b843e00
raw: 0000000000000000 ffff8880a2554200 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880a2554800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880a2554880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880a2554900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880a2554980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880a2554a00: 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.

syzbot

unread,
Jan 25, 2023, 2:39:32 PM1/25/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