Hay
Date
June 17, 2025, 3:40 p.m.

Environment
qemu-arm64
qemu-x86_64

[   21.952994] ==================================================================
[   21.953235] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   21.953463] Read of size 1 at addr fff00000c58ac288 by task kunit_try_catch/186
[   21.953567] 
[   21.953794] CPU: 0 UID: 0 PID: 186 Comm: kunit_try_catch Tainted: G    B            N  6.15.3-rc1 #1 PREEMPT 
[   21.953949] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.953981] Hardware name: linux,dummy-virt (DT)
[   21.954021] Call trace:
[   21.954073]  show_stack+0x20/0x38 (C)
[   21.954150]  dump_stack_lvl+0x8c/0xd0
[   21.954203]  print_report+0x118/0x608
[   21.954253]  kasan_report+0xdc/0x128
[   21.954300]  __asan_report_load1_noabort+0x20/0x30
[   21.954353]  kmalloc_uaf+0x300/0x338
[   21.954402]  kunit_try_run_case+0x170/0x3f0
[   21.954456]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.954513]  kthread+0x328/0x630
[   21.954563]  ret_from_fork+0x10/0x20
[   21.954617] 
[   21.954638] Allocated by task 186:
[   21.954670]  kasan_save_stack+0x3c/0x68
[   21.954716]  kasan_save_track+0x20/0x40
[   21.954780]  kasan_save_alloc_info+0x40/0x58
[   21.954823]  __kasan_kmalloc+0xd4/0xd8
[   21.954861]  __kmalloc_cache_noprof+0x16c/0x3c0
[   21.954907]  kmalloc_uaf+0xb8/0x338
[   21.954946]  kunit_try_run_case+0x170/0x3f0
[   21.954987]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.955034]  kthread+0x328/0x630
[   21.955072]  ret_from_fork+0x10/0x20
[   21.955110] 
[   21.955132] Freed by task 186:
[   21.955161]  kasan_save_stack+0x3c/0x68
[   21.955200]  kasan_save_track+0x20/0x40
[   21.955238]  kasan_save_free_info+0x4c/0x78
[   21.955279]  __kasan_slab_free+0x6c/0x98
[   21.955317]  kfree+0x214/0x3c8
[   21.955351]  kmalloc_uaf+0x11c/0x338
[   21.955390]  kunit_try_run_case+0x170/0x3f0
[   21.955431]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.955477]  kthread+0x328/0x630
[   21.955515]  ret_from_fork+0x10/0x20
[   21.955553] 
[   21.955575] The buggy address belongs to the object at fff00000c58ac280
[   21.955575]  which belongs to the cache kmalloc-16 of size 16
[   21.955637] The buggy address is located 8 bytes inside of
[   21.955637]  freed 16-byte region [fff00000c58ac280, fff00000c58ac290)
[   21.955701] 
[   21.955724] The buggy address belongs to the physical page:
[   21.955818] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1058ac
[   21.955926] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   21.956030] page_type: f5(slab)
[   21.956126] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   21.956340] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   21.956447] page dumped because: kasan: bad access detected
[   21.956490] 
[   21.956511] Memory state around the buggy address:
[   21.956550]  fff00000c58ac180: 00 04 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   21.956598]  fff00000c58ac200: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   21.956642] >fff00000c58ac280: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.956681]                       ^
[   21.956714]  fff00000c58ac300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.956781]  fff00000c58ac380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.956823] ==================================================================

[   19.611524] ==================================================================
[   19.612461] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   19.613004] Read of size 1 at addr ffff8881026cd088 by task kunit_try_catch/204
[   19.613665] 
[   19.613883] CPU: 0 UID: 0 PID: 204 Comm: kunit_try_catch Tainted: G    B            N  6.15.3-rc1 #1 PREEMPT(voluntary) 
[   19.614004] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.614112] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   19.614195] Call Trace:
[   19.614234]  <TASK>
[   19.614282]  dump_stack_lvl+0x73/0xb0
[   19.614821]  print_report+0xd1/0x650
[   19.614861]  ? __virt_addr_valid+0x1db/0x2d0
[   19.614895]  ? kmalloc_uaf+0x320/0x380
[   19.614925]  ? kasan_complete_mode_report_info+0x64/0x200
[   19.615355]  ? kmalloc_uaf+0x320/0x380
[   19.615512]  kasan_report+0x141/0x180
[   19.615559]  ? kmalloc_uaf+0x320/0x380
[   19.615621]  __asan_report_load1_noabort+0x18/0x20
[   19.615687]  kmalloc_uaf+0x320/0x380
[   19.615722]  ? __pfx_kmalloc_uaf+0x10/0x10
[   19.615754]  ? __schedule+0x10cc/0x2b60
[   19.615788]  ? __pfx_read_tsc+0x10/0x10
[   19.615819]  ? ktime_get_ts64+0x86/0x230
[   19.615856]  kunit_try_run_case+0x1a5/0x480
[   19.615904]  ? __pfx_kunit_try_run_case+0x10/0x10
[   19.615936]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   19.616010]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   19.616146]  ? __kthread_parkme+0x82/0x180
[   19.616195]  ? preempt_count_sub+0x50/0x80
[   19.616232]  ? __pfx_kunit_try_run_case+0x10/0x10
[   19.616267]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.616326]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   19.616362]  kthread+0x337/0x6f0
[   19.616385]  ? trace_preempt_on+0x20/0xc0
[   19.616421]  ? __pfx_kthread+0x10/0x10
[   19.616445]  ? _raw_spin_unlock_irq+0x47/0x80
[   19.616475]  ? calculate_sigpending+0x7b/0xa0
[   19.616506]  ? __pfx_kthread+0x10/0x10
[   19.616530]  ret_from_fork+0x41/0x80
[   19.616561]  ? __pfx_kthread+0x10/0x10
[   19.616586]  ret_from_fork_asm+0x1a/0x30
[   19.616630]  </TASK>
[   19.616645] 
[   19.635576] Allocated by task 204:
[   19.636097]  kasan_save_stack+0x45/0x70
[   19.636566]  kasan_save_track+0x18/0x40
[   19.637084]  kasan_save_alloc_info+0x3b/0x50
[   19.638154]  __kasan_kmalloc+0xb7/0xc0
[   19.638689]  __kmalloc_cache_noprof+0x189/0x420
[   19.639671]  kmalloc_uaf+0xaa/0x380
[   19.640308]  kunit_try_run_case+0x1a5/0x480
[   19.640829]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.641211]  kthread+0x337/0x6f0
[   19.642095]  ret_from_fork+0x41/0x80
[   19.642829]  ret_from_fork_asm+0x1a/0x30
[   19.643490] 
[   19.643677] Freed by task 204:
[   19.644480]  kasan_save_stack+0x45/0x70
[   19.644964]  kasan_save_track+0x18/0x40
[   19.645634]  kasan_save_free_info+0x3f/0x60
[   19.646008]  __kasan_slab_free+0x56/0x70
[   19.647246]  kfree+0x222/0x3f0
[   19.647537]  kmalloc_uaf+0x12c/0x380
[   19.647980]  kunit_try_run_case+0x1a5/0x480
[   19.648587]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.649369]  kthread+0x337/0x6f0
[   19.649788]  ret_from_fork+0x41/0x80
[   19.650860]  ret_from_fork_asm+0x1a/0x30
[   19.651541] 
[   19.651916] The buggy address belongs to the object at ffff8881026cd080
[   19.651916]  which belongs to the cache kmalloc-16 of size 16
[   19.653331] The buggy address is located 8 bytes inside of
[   19.653331]  freed 16-byte region [ffff8881026cd080, ffff8881026cd090)
[   19.654687] 
[   19.654789] The buggy address belongs to the physical page:
[   19.655340] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1026cd
[   19.656183] flags: 0x200000000000000(node=0|zone=2)
[   19.656645] page_type: f5(slab)
[   19.657032] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   19.658485] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   19.659129] page dumped because: kasan: bad access detected
[   19.660021] 
[   19.660553] Memory state around the buggy address:
[   19.660896]  ffff8881026ccf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.661873]  ffff8881026cd000: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   19.663114] >ffff8881026cd080: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.663924]                       ^
[   19.664525]  ffff8881026cd100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.665103]  ffff8881026cd180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.666640] ==================================================================