Hay
Date
June 23, 2025, 7:07 a.m.

Environment
qemu-arm64
qemu-x86_64

[   32.861142] ==================================================================
[   32.861390] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   32.861683] Read of size 16 at addr fff00000c56f12e0 by task kunit_try_catch/180
[   32.861808] 
[   32.862003] CPU: 1 UID: 0 PID: 180 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250623 #1 PREEMPT 
[   32.862903] Tainted: [B]=BAD_PAGE, [N]=TEST
[   32.862969] Hardware name: linux,dummy-virt (DT)
[   32.863067] Call trace:
[   32.863317]  show_stack+0x20/0x38 (C)
[   32.863447]  dump_stack_lvl+0x8c/0xd0
[   32.864339]  print_report+0x118/0x608
[   32.864811]  kasan_report+0xdc/0x128
[   32.865660]  __asan_report_load16_noabort+0x20/0x30
[   32.866220]  kmalloc_uaf_16+0x3bc/0x438
[   32.866455]  kunit_try_run_case+0x170/0x3f0
[   32.867350]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.867997]  kthread+0x328/0x630
[   32.868342]  ret_from_fork+0x10/0x20
[   32.868464] 
[   32.868508] Allocated by task 180:
[   32.868575]  kasan_save_stack+0x3c/0x68
[   32.869878]  kasan_save_track+0x20/0x40
[   32.870467]  kasan_save_alloc_info+0x40/0x58
[   32.871279]  __kasan_kmalloc+0xd4/0xd8
[   32.871402]  __kmalloc_cache_noprof+0x16c/0x3c0
[   32.871833]  kmalloc_uaf_16+0x140/0x438
[   32.871944]  kunit_try_run_case+0x170/0x3f0
[   32.872419]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.873048]  kthread+0x328/0x630
[   32.873140]  ret_from_fork+0x10/0x20
[   32.873547] 
[   32.873892] Freed by task 180:
[   32.874445]  kasan_save_stack+0x3c/0x68
[   32.874654]  kasan_save_track+0x20/0x40
[   32.874918]  kasan_save_free_info+0x4c/0x78
[   32.875102]  __kasan_slab_free+0x6c/0x98
[   32.875865]  kfree+0x214/0x3c8
[   32.876667]  kmalloc_uaf_16+0x190/0x438
[   32.877167]  kunit_try_run_case+0x170/0x3f0
[   32.877269]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.877741]  kthread+0x328/0x630
[   32.878384]  ret_from_fork+0x10/0x20
[   32.878484] 
[   32.878957] The buggy address belongs to the object at fff00000c56f12e0
[   32.878957]  which belongs to the cache kmalloc-16 of size 16
[   32.879204] The buggy address is located 0 bytes inside of
[   32.879204]  freed 16-byte region [fff00000c56f12e0, fff00000c56f12f0)
[   32.879571] 
[   32.879623] The buggy address belongs to the physical page:
[   32.879693] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1056f1
[   32.879813] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.879925] page_type: f5(slab)
[   32.880485] raw: 0bfffe0000000000 fff00000c0001640 dead000000000100 dead000000000122
[   32.881190] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   32.881775] page dumped because: kasan: bad access detected
[   32.881851] 
[   32.881895] Memory state around the buggy address:
[   32.881971]  fff00000c56f1180: fa fb fc fc 00 00 fc fc fa fb fc fc fa fb fc fc
[   32.883270]  fff00000c56f1200: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   32.883392] >fff00000c56f1280: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   32.884485]                                                        ^
[   32.884661]  fff00000c56f1300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.884764]  fff00000c56f1380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.885072] ==================================================================

[   21.774710] ==================================================================
[   21.775143] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0
[   21.775619] Read of size 16 at addr ffff8881023702e0 by task kunit_try_catch/197
[   21.776060] 
[   21.776196] CPU: 0 UID: 0 PID: 197 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250623 #1 PREEMPT(voluntary) 
[   21.776265] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.776278] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   21.776297] Call Trace:
[   21.776310]  <TASK>
[   21.776326]  dump_stack_lvl+0x73/0xb0
[   21.776353]  print_report+0xd1/0x650
[   21.776371]  ? __virt_addr_valid+0x1db/0x2d0
[   21.776639]  ? kmalloc_uaf_16+0x47b/0x4c0
[   21.776670]  ? kasan_complete_mode_report_info+0x64/0x200
[   21.776694]  ? kmalloc_uaf_16+0x47b/0x4c0
[   21.776712]  kasan_report+0x141/0x180
[   21.776731]  ? kmalloc_uaf_16+0x47b/0x4c0
[   21.776753]  __asan_report_load16_noabort+0x18/0x20
[   21.776774]  kmalloc_uaf_16+0x47b/0x4c0
[   21.776791]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   21.776809]  ? __schedule+0x10cc/0x2b60
[   21.776830]  ? __pfx_read_tsc+0x10/0x10
[   21.777227]  ? ktime_get_ts64+0x86/0x230
[   21.777255]  kunit_try_run_case+0x1a5/0x480
[   21.777278]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.777298]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   21.777317]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   21.777337]  ? __kthread_parkme+0x82/0x180
[   21.777354]  ? preempt_count_sub+0x50/0x80
[   21.777373]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.777414]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.777434]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   21.777454]  kthread+0x337/0x6f0
[   21.777471]  ? trace_preempt_on+0x20/0xc0
[   21.777491]  ? __pfx_kthread+0x10/0x10
[   21.777508]  ? _raw_spin_unlock_irq+0x47/0x80
[   21.777526]  ? calculate_sigpending+0x7b/0xa0
[   21.777546]  ? __pfx_kthread+0x10/0x10
[   21.777564]  ret_from_fork+0x116/0x1d0
[   21.777580]  ? __pfx_kthread+0x10/0x10
[   21.777597]  ret_from_fork_asm+0x1a/0x30
[   21.777624]  </TASK>
[   21.777636] 
[   21.788536] Allocated by task 197:
[   21.788821]  kasan_save_stack+0x45/0x70
[   21.789075]  kasan_save_track+0x18/0x40
[   21.789533]  kasan_save_alloc_info+0x3b/0x50
[   21.789736]  __kasan_kmalloc+0xb7/0xc0
[   21.790229]  __kmalloc_cache_noprof+0x189/0x420
[   21.790468]  kmalloc_uaf_16+0x15b/0x4c0
[   21.790631]  kunit_try_run_case+0x1a5/0x480
[   21.790824]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.791080]  kthread+0x337/0x6f0
[   21.791231]  ret_from_fork+0x116/0x1d0
[   21.791411]  ret_from_fork_asm+0x1a/0x30
[   21.791591] 
[   21.791672] Freed by task 197:
[   21.791812]  kasan_save_stack+0x45/0x70
[   21.792562]  kasan_save_track+0x18/0x40
[   21.792800]  kasan_save_free_info+0x3f/0x60
[   21.792956]  __kasan_slab_free+0x56/0x70
[   21.793095]  kfree+0x222/0x3f0
[   21.793796]  kmalloc_uaf_16+0x1d6/0x4c0
[   21.794000]  kunit_try_run_case+0x1a5/0x480
[   21.794229]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.794470]  kthread+0x337/0x6f0
[   21.794633]  ret_from_fork+0x116/0x1d0
[   21.794799]  ret_from_fork_asm+0x1a/0x30
[   21.795521] 
[   21.795786] The buggy address belongs to the object at ffff8881023702e0
[   21.795786]  which belongs to the cache kmalloc-16 of size 16
[   21.796508] The buggy address is located 0 bytes inside of
[   21.796508]  freed 16-byte region [ffff8881023702e0, ffff8881023702f0)
[   21.797093] 
[   21.797307] The buggy address belongs to the physical page:
[   21.797674] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102370
[   21.798417] flags: 0x200000000000000(node=0|zone=2)
[   21.798613] page_type: f5(slab)
[   21.798764] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   21.799007] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   21.799412] page dumped because: kasan: bad access detected
[   21.799787] 
[   21.799956] Memory state around the buggy address:
[   21.800342]  ffff888102370180: 00 05 fc fc 00 00 fc fc 00 06 fc fc 00 06 fc fc
[   21.800909]  ffff888102370200: 00 00 fc fc fa fb fc fc 00 04 fc fc fa fb fc fc
[   21.801125] >ffff888102370280: fa fb fc fc fa fb fc fc 00 00 fc fc fa fb fc fc
[   21.801524]                                                        ^
[   21.801767]  ffff888102370300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.802252]  ffff888102370380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.802534] ==================================================================