KASAN: use-after-free Read in hrtimer_start_range_ns

8 views
Skip to first unread message

syzbot

unread,
May 27, 2021, 3:30:25 AM5/27/21
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 1d3dcc20 ANDROID: dm-user: Fix build warnings
git tree: android12-5.4
console output: https://syzkaller.appspot.com/x/log.txt?x=12559d5bd00000
kernel config: https://syzkaller.appspot.com/x/.config?x=8fac8bc1c995d734
dashboard link: https://syzkaller.appspot.com/bug?extid=53815b1fb1930285dd18
compiler: Debian clang version 11.0.1-2

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+53815b...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in hrtimer_start_range_ns+0x1ef/0x200 kernel/time/hrtimer.c:1145
Read of size 1 at addr ffff88817e3b4042 by task io_uring-sq/31019

CPU: 0 PID: 31019 Comm: io_uring-sq Not tainted 5.4.121-syzkaller-00751-g1d3dcc209600 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1d8/0x24e lib/dump_stack.c:118
print_address_description+0x9b/0x650 mm/kasan/report.c:384
__kasan_report+0x182/0x260 mm/kasan/report.c:516
kasan_report+0x30/0x60 mm/kasan/common.c:641
hrtimer_start_range_ns+0x1ef/0x200 kernel/time/hrtimer.c:1145
hrtimer_start include/linux/hrtimer.h:424 [inline]
io_timeout fs/io_uring.c:2075 [inline]
__io_submit_sqe+0x2e6e/0x3b80 fs/io_uring.c:2158
__io_queue_sqe+0x39/0xc70 fs/io_uring.c:2459
io_submit_sqes fs/io_uring.c:2776 [inline]
io_sq_thread+0xdec/0x1c00 fs/io_uring.c:2902
kthread+0x30f/0x330 kernel/kthread.c:268
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352

Allocated by task 31019:
save_stack mm/kasan/common.c:70 [inline]
set_track mm/kasan/common.c:78 [inline]
__kasan_kmalloc+0x137/0x1e0 mm/kasan/common.c:517
slab_post_alloc_hook mm/slab.h:584 [inline]
kmem_cache_alloc_bulk+0x18e/0x290 mm/slub.c:3283
io_get_req+0x17a/0x590 fs/io_uring.c:652
io_submit_sqe+0x83/0xe80 fs/io_uring.c:2579
io_submit_sqes fs/io_uring.c:2776 [inline]
io_sq_thread+0xdec/0x1c00 fs/io_uring.c:2902
kthread+0x30f/0x330 kernel/kthread.c:268
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352

Freed by task 31015:
save_stack mm/kasan/common.c:70 [inline]
set_track mm/kasan/common.c:78 [inline]
kasan_set_free_info mm/kasan/common.c:333 [inline]
__kasan_slab_free+0x18a/0x240 mm/kasan/common.c:475
slab_free_hook mm/slub.c:1454 [inline]
slab_free_freelist_hook+0x7b/0x150 mm/slub.c:1492
slab_free mm/slub.c:3072 [inline]
kmem_cache_free+0xb8/0x5f0 mm/slub.c:3088
__io_free_req fs/io_uring.c:701 [inline]
io_kill_timeout fs/io_uring.c:538 [inline]
io_kill_timeouts fs/io_uring.c:548 [inline]
io_ring_ctx_wait_and_kill+0x75e/0x14a0 fs/io_uring.c:3759
io_uring_release+0x57/0x70 fs/io_uring.c:3781
__fput+0x27d/0x6c0 fs/file_table.c:281
task_work_run+0x186/0x1b0 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:188 [inline]
exit_to_usermode_loop arch/x86/entry/common.c:163 [inline]
prepare_exit_to_usermode+0x2b0/0x310 arch/x86/entry/common.c:194
entry_SYSCALL_64_after_hwframe+0x44/0xa9

The buggy address belongs to the object at ffff88817e3b4000
which belongs to the cache io_kiocb of size 264
The buggy address is located 66 bytes inside of
264-byte region [ffff88817e3b4000, ffff88817e3b4108)
The buggy address belongs to the page:
page:ffffea0005f8ed00 refcount:1 mapcount:0 mapping:ffff8881f5fcd680 index:0x0 compound_mapcount: 0
flags: 0x8000000000010200(slab|head)
raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5fcd680
raw: 0000000000000000 0000000080150015 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC)
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook mm/page_alloc.c:2165 [inline]
prep_new_page+0x19a/0x380 mm/page_alloc.c:2171
get_page_from_freelist+0x550/0x8b0 mm/page_alloc.c:3794
__alloc_pages_nodemask+0x3a2/0x880 mm/page_alloc.c:4855
alloc_slab_page+0x39/0x3e0 mm/slub.c:342
allocate_slab mm/slub.c:1675 [inline]
new_slab+0x97/0x460 mm/slub.c:1741
new_slab_objects mm/slub.c:2498 [inline]
___slab_alloc+0x330/0x4c0 mm/slub.c:2659
kmem_cache_alloc_bulk+0xc7/0x290 mm/slub.c:3257
io_get_req+0x17a/0x590 fs/io_uring.c:652
io_submit_sqe+0x83/0xe80 fs/io_uring.c:2579
io_submit_sqes fs/io_uring.c:2776 [inline]
io_sq_thread+0xdec/0x1c00 fs/io_uring.c:2902
kthread+0x30f/0x330 kernel/kthread.c:268
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1176 [inline]
__free_pages_ok+0xc60/0xd80 mm/page_alloc.c:1438
free_the_page mm/page_alloc.c:4917 [inline]
__free_pages+0x8f/0x250 mm/page_alloc.c:4923
__free_slab+0x237/0x2f0 mm/slub.c:1766
free_slab mm/slub.c:1781 [inline]
discard_slab mm/slub.c:1787 [inline]
unfreeze_partials+0x14f/0x180 mm/slub.c:2279
put_cpu_partial+0xb5/0x150 mm/slub.c:2315
__slab_free mm/slub.c:2963 [inline]
do_slab_free mm/slub.c:3060 [inline]
___cache_free+0x352/0x4e0 mm/slub.c:3079
qlist_free_all mm/kasan/quarantine.c:167 [inline]
quarantine_reduce+0x17a/0x1e0 mm/kasan/quarantine.c:260
__kasan_kmalloc+0x43/0x1e0 mm/kasan/common.c:495
slab_post_alloc_hook mm/slab.h:584 [inline]
kmem_cache_alloc_bulk+0x18e/0x290 mm/slub.c:3283
io_get_req+0x17a/0x590 fs/io_uring.c:652
io_submit_sqe+0x83/0xe80 fs/io_uring.c:2579
io_submit_sqes fs/io_uring.c:2776 [inline]
io_sq_thread+0xdec/0x1c00 fs/io_uring.c:2902
kthread+0x30f/0x330 kernel/kthread.c:268
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352

Memory state around the buggy address:
ffff88817e3b3f00: fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88817e3b3f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88817e3b4000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88817e3b4080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88817e3b4100: fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
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,
Sep 24, 2021, 3:30:11 AM9/24/21
to syzkaller-a...@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