Hay
Date
July 3, 2025, 6:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.962932] ==================================================================
[   16.963001] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   16.963062] Read of size 1 at addr fff00000c78c38a8 by task kunit_try_catch/188
[   16.963110] 
[   16.963498] CPU: 0 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   16.963651] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.963690] Hardware name: linux,dummy-virt (DT)
[   16.963723] Call trace:
[   16.963744]  show_stack+0x20/0x38 (C)
[   16.963794]  dump_stack_lvl+0x8c/0xd0
[   16.963839]  print_report+0x118/0x608
[   16.963883]  kasan_report+0xdc/0x128
[   16.963938]  __asan_report_load1_noabort+0x20/0x30
[   16.963989]  kmalloc_uaf2+0x3f4/0x468
[   16.964043]  kunit_try_run_case+0x170/0x3f0
[   16.964090]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.964141]  kthread+0x328/0x630
[   16.964183]  ret_from_fork+0x10/0x20
[   16.964228] 
[   16.964254] Allocated by task 188:
[   16.964282]  kasan_save_stack+0x3c/0x68
[   16.964319]  kasan_save_track+0x20/0x40
[   16.964356]  kasan_save_alloc_info+0x40/0x58
[   16.964393]  __kasan_kmalloc+0xd4/0xd8
[   16.964438]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.964487]  kmalloc_uaf2+0xc4/0x468
[   16.964771]  kunit_try_run_case+0x170/0x3f0
[   16.965052]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.965236]  kthread+0x328/0x630
[   16.965382]  ret_from_fork+0x10/0x20
[   16.965454] 
[   16.965599] Freed by task 188:
[   16.965747]  kasan_save_stack+0x3c/0x68
[   16.965919]  kasan_save_track+0x20/0x40
[   16.965964]  kasan_save_free_info+0x4c/0x78
[   16.966048]  __kasan_slab_free+0x6c/0x98
[   16.966279]  kfree+0x214/0x3c8
[   16.966502]  kmalloc_uaf2+0x134/0x468
[   16.966628]  kunit_try_run_case+0x170/0x3f0
[   16.966736]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.966866]  kthread+0x328/0x630
[   16.966901]  ret_from_fork+0x10/0x20
[   16.967094] 
[   16.967178] The buggy address belongs to the object at fff00000c78c3880
[   16.967178]  which belongs to the cache kmalloc-64 of size 64
[   16.967462] The buggy address is located 40 bytes inside of
[   16.967462]  freed 64-byte region [fff00000c78c3880, fff00000c78c38c0)
[   16.967741] 
[   16.967953] The buggy address belongs to the physical page:
[   16.968074] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078c3
[   16.968179] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.968255] page_type: f5(slab)
[   16.968433] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   16.968665] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   16.968725] page dumped because: kasan: bad access detected
[   16.968903] 
[   16.968965] Memory state around the buggy address:
[   16.969180]  fff00000c78c3780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.969297]  fff00000c78c3800: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.969471] >fff00000c78c3880: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.969548]                                   ^
[   16.969677]  fff00000c78c3900: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   16.969912]  fff00000c78c3980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.970089] ==================================================================

[   11.775490] ==================================================================
[   11.775916] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   11.776289] Read of size 1 at addr ffff8881038d51a8 by task kunit_try_catch/206
[   11.776633] 
[   11.776745] CPU: 0 UID: 0 PID: 206 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.776792] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.776804] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.776824] Call Trace:
[   11.776836]  <TASK>
[   11.776854]  dump_stack_lvl+0x73/0xb0
[   11.776881]  print_report+0xd1/0x650
[   11.776904]  ? __virt_addr_valid+0x1db/0x2d0
[   11.776927]  ? kmalloc_uaf2+0x4a8/0x520
[   11.776946]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.776968]  ? kmalloc_uaf2+0x4a8/0x520
[   11.776987]  kasan_report+0x141/0x180
[   11.777008]  ? kmalloc_uaf2+0x4a8/0x520
[   11.777032]  __asan_report_load1_noabort+0x18/0x20
[   11.777055]  kmalloc_uaf2+0x4a8/0x520
[   11.777075]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   11.777093]  ? finish_task_switch.isra.0+0x153/0x700
[   11.777125]  ? __switch_to+0x47/0xf50
[   11.777152]  ? __schedule+0x10cc/0x2b60
[   11.777173]  ? __pfx_read_tsc+0x10/0x10
[   11.777193]  ? ktime_get_ts64+0x86/0x230
[   11.777217]  kunit_try_run_case+0x1a5/0x480
[   11.777240]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.777261]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.777284]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.777306]  ? __kthread_parkme+0x82/0x180
[   11.777325]  ? preempt_count_sub+0x50/0x80
[   11.777358]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.777381]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.777403]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.777425]  kthread+0x337/0x6f0
[   11.777444]  ? trace_preempt_on+0x20/0xc0
[   11.777468]  ? __pfx_kthread+0x10/0x10
[   11.777488]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.777508]  ? calculate_sigpending+0x7b/0xa0
[   11.777531]  ? __pfx_kthread+0x10/0x10
[   11.777551]  ret_from_fork+0x116/0x1d0
[   11.777569]  ? __pfx_kthread+0x10/0x10
[   11.777588]  ret_from_fork_asm+0x1a/0x30
[   11.777631]  </TASK>
[   11.777643] 
[   11.784891] Allocated by task 206:
[   11.785078]  kasan_save_stack+0x45/0x70
[   11.785366]  kasan_save_track+0x18/0x40
[   11.785572]  kasan_save_alloc_info+0x3b/0x50
[   11.785828]  __kasan_kmalloc+0xb7/0xc0
[   11.786028]  __kmalloc_cache_noprof+0x189/0x420
[   11.786450]  kmalloc_uaf2+0xc6/0x520
[   11.786643]  kunit_try_run_case+0x1a5/0x480
[   11.786827]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.787035]  kthread+0x337/0x6f0
[   11.787215]  ret_from_fork+0x116/0x1d0
[   11.787428]  ret_from_fork_asm+0x1a/0x30
[   11.787573] 
[   11.787645] Freed by task 206:
[   11.787758]  kasan_save_stack+0x45/0x70
[   11.788060]  kasan_save_track+0x18/0x40
[   11.788285]  kasan_save_free_info+0x3f/0x60
[   11.788538]  __kasan_slab_free+0x56/0x70
[   11.788729]  kfree+0x222/0x3f0
[   11.789000]  kmalloc_uaf2+0x14c/0x520
[   11.789348]  kunit_try_run_case+0x1a5/0x480
[   11.789539]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.789781]  kthread+0x337/0x6f0
[   11.789916]  ret_from_fork+0x116/0x1d0
[   11.790100]  ret_from_fork_asm+0x1a/0x30
[   11.790407] 
[   11.790506] The buggy address belongs to the object at ffff8881038d5180
[   11.790506]  which belongs to the cache kmalloc-64 of size 64
[   11.790888] The buggy address is located 40 bytes inside of
[   11.790888]  freed 64-byte region [ffff8881038d5180, ffff8881038d51c0)
[   11.791482] 
[   11.791584] The buggy address belongs to the physical page:
[   11.791825] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1038d5
[   11.792071] flags: 0x200000000000000(node=0|zone=2)
[   11.792253] page_type: f5(slab)
[   11.792397] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   11.792739] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   11.793125] page dumped because: kasan: bad access detected
[   11.793470] 
[   11.793566] Memory state around the buggy address:
[   11.793768]  ffff8881038d5080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.794026]  ffff8881038d5100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.794260] >ffff8881038d5180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.794766]                                   ^
[   11.794986]  ffff8881038d5200: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   11.795271]  ffff8881038d5280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.795685] ==================================================================