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

Environment
qemu-arm64
qemu-x86_64

[   19.463613] ==================================================================
[   19.463776] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   19.464881] Read of size 1 at addr fff00000c63971a8 by task kunit_try_catch/193
[   19.465134] 
[   19.465233] CPU: 0 UID: 0 PID: 193 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250616 #1 PREEMPT 
[   19.465468] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.465540] Hardware name: linux,dummy-virt (DT)
[   19.465620] Call trace:
[   19.465674]  show_stack+0x20/0x38 (C)
[   19.465785]  dump_stack_lvl+0x8c/0xd0
[   19.465913]  print_report+0x118/0x608
[   19.466011]  kasan_report+0xdc/0x128
[   19.466113]  __asan_report_load1_noabort+0x20/0x30
[   19.466243]  kmalloc_uaf+0x300/0x338
[   19.466382]  kunit_try_run_case+0x170/0x3f0
[   19.466519]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.466682]  kthread+0x328/0x630
[   19.466788]  ret_from_fork+0x10/0x20
[   19.466920] 
[   19.466979] Allocated by task 193:
[   19.467083]  kasan_save_stack+0x3c/0x68
[   19.467177]  kasan_save_track+0x20/0x40
[   19.467269]  kasan_save_alloc_info+0x40/0x58
[   19.467387]  __kasan_kmalloc+0xd4/0xd8
[   19.467471]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.467569]  kmalloc_uaf+0xb8/0x338
[   19.467655]  kunit_try_run_case+0x170/0x3f0
[   19.467776]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.467929]  kthread+0x328/0x630
[   19.468032]  ret_from_fork+0x10/0x20
[   19.468146] 
[   19.468210] Freed by task 193:
[   19.468308]  kasan_save_stack+0x3c/0x68
[   19.468425]  kasan_save_track+0x20/0x40
[   19.468530]  kasan_save_free_info+0x4c/0x78
[   19.468617]  __kasan_slab_free+0x6c/0x98
[   19.468740]  kfree+0x214/0x3c8
[   19.468820]  kmalloc_uaf+0x11c/0x338
[   19.468903]  kunit_try_run_case+0x170/0x3f0
[   19.469025]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.469137]  kthread+0x328/0x630
[   19.469221]  ret_from_fork+0x10/0x20
[   19.469373] 
[   19.469470] The buggy address belongs to the object at fff00000c63971a0
[   19.469470]  which belongs to the cache kmalloc-16 of size 16
[   19.469682] The buggy address is located 8 bytes inside of
[   19.469682]  freed 16-byte region [fff00000c63971a0, fff00000c63971b0)
[   19.469848] 
[   19.469896] The buggy address belongs to the physical page:
[   19.470224] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106397
[   19.470459] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.470722] page_type: f5(slab)
[   19.470905] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   19.471126] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   19.471276] page dumped because: kasan: bad access detected
[   19.471364] 
[   19.471413] Memory state around the buggy address:
[   19.471496]  fff00000c6397080: fa fb fc fc fa fb fc fc fa fb fc fc 00 04 fc fc
[   19.472193]  fff00000c6397100: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   19.472365] >fff00000c6397180: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   19.472672]                                   ^
[   19.472770]  fff00000c6397200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.473193]  fff00000c6397280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.473613] ==================================================================

[   11.695386] ==================================================================
[   11.696564] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   11.697152] Read of size 1 at addr ffff888102539488 by task kunit_try_catch/209
[   11.697923] 
[   11.698175] CPU: 1 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250616 #1 PREEMPT(voluntary) 
[   11.698223] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.698235] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.698256] Call Trace:
[   11.698268]  <TASK>
[   11.698285]  dump_stack_lvl+0x73/0xb0
[   11.698314]  print_report+0xd1/0x650
[   11.698336]  ? __virt_addr_valid+0x1db/0x2d0
[   11.698358]  ? kmalloc_uaf+0x320/0x380
[   11.698397]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.698431]  ? kmalloc_uaf+0x320/0x380
[   11.698450]  kasan_report+0x141/0x180
[   11.698471]  ? kmalloc_uaf+0x320/0x380
[   11.698494]  __asan_report_load1_noabort+0x18/0x20
[   11.698517]  kmalloc_uaf+0x320/0x380
[   11.698536]  ? __pfx_kmalloc_uaf+0x10/0x10
[   11.698556]  ? __schedule+0x10cc/0x2b60
[   11.698577]  ? __pfx_read_tsc+0x10/0x10
[   11.698597]  ? ktime_get_ts64+0x86/0x230
[   11.698623]  kunit_try_run_case+0x1a5/0x480
[   11.698646]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.698667]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.698688]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.698709]  ? __kthread_parkme+0x82/0x180
[   11.698730]  ? preempt_count_sub+0x50/0x80
[   11.698754]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.698777]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.698799]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.698820]  kthread+0x337/0x6f0
[   11.698839]  ? trace_preempt_on+0x20/0xc0
[   11.698863]  ? __pfx_kthread+0x10/0x10
[   11.698885]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.698904]  ? calculate_sigpending+0x7b/0xa0
[   11.698928]  ? __pfx_kthread+0x10/0x10
[   11.698958]  ret_from_fork+0x116/0x1d0
[   11.698976]  ? __pfx_kthread+0x10/0x10
[   11.698996]  ret_from_fork_asm+0x1a/0x30
[   11.699026]  </TASK>
[   11.699036] 
[   11.710903] Allocated by task 209:
[   11.711044]  kasan_save_stack+0x45/0x70
[   11.711183]  kasan_save_track+0x18/0x40
[   11.711310]  kasan_save_alloc_info+0x3b/0x50
[   11.711468]  __kasan_kmalloc+0xb7/0xc0
[   11.711593]  __kmalloc_cache_noprof+0x189/0x420
[   11.711885]  kmalloc_uaf+0xaa/0x380
[   11.712020]  kunit_try_run_case+0x1a5/0x480
[   11.712219]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.712461]  kthread+0x337/0x6f0
[   11.712605]  ret_from_fork+0x116/0x1d0
[   11.712731]  ret_from_fork_asm+0x1a/0x30
[   11.712899] 
[   11.712998] Freed by task 209:
[   11.713148]  kasan_save_stack+0x45/0x70
[   11.713334]  kasan_save_track+0x18/0x40
[   11.713608]  kasan_save_free_info+0x3f/0x60
[   11.713767]  __kasan_slab_free+0x56/0x70
[   11.713898]  kfree+0x222/0x3f0
[   11.714095]  kmalloc_uaf+0x12c/0x380
[   11.714387]  kunit_try_run_case+0x1a5/0x480
[   11.714606]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.714822]  kthread+0x337/0x6f0
[   11.714947]  ret_from_fork+0x116/0x1d0
[   11.715073]  ret_from_fork_asm+0x1a/0x30
[   11.715233] 
[   11.715350] The buggy address belongs to the object at ffff888102539480
[   11.715350]  which belongs to the cache kmalloc-16 of size 16
[   11.715948] The buggy address is located 8 bytes inside of
[   11.715948]  freed 16-byte region [ffff888102539480, ffff888102539490)
[   11.716287] 
[   11.716385] The buggy address belongs to the physical page:
[   11.716634] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102539
[   11.717221] flags: 0x200000000000000(node=0|zone=2)
[   11.717516] page_type: f5(slab)
[   11.717779] raw: 0200000000000000 ffff888100041640 dead000000000100 dead000000000122
[   11.718098] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.718318] page dumped because: kasan: bad access detected
[   11.718717] 
[   11.718825] Memory state around the buggy address:
[   11.719130]  ffff888102539380: 00 00 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.719341]  ffff888102539400: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.719757] >ffff888102539480: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.720437]                       ^
[   11.720625]  ffff888102539500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.720979]  ffff888102539580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.721776] ==================================================================