Hay
Date
July 12, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   19.690415] ==================================================================
[   19.690554] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   19.690658] Read of size 1 at addr fff00000c59a1328 by task kunit_try_catch/189
[   19.690761] 
[   19.690844] CPU: 0 UID: 0 PID: 189 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   19.690998] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.691056] Hardware name: linux,dummy-virt (DT)
[   19.691125] Call trace:
[   19.691169]  show_stack+0x20/0x38 (C)
[   19.691272]  dump_stack_lvl+0x8c/0xd0
[   19.691376]  print_report+0x118/0x608
[   19.691474]  kasan_report+0xdc/0x128
[   19.691576]  __asan_report_load1_noabort+0x20/0x30
[   19.691689]  kmalloc_uaf2+0x3f4/0x468
[   19.691784]  kunit_try_run_case+0x170/0x3f0
[   19.691898]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.692005]  kthread+0x328/0x630
[   19.692102]  ret_from_fork+0x10/0x20
[   19.692286] 
[   19.692412] Allocated by task 189:
[   19.692622]  kasan_save_stack+0x3c/0x68
[   19.692791]  kasan_save_track+0x20/0x40
[   19.692882]  kasan_save_alloc_info+0x40/0x58
[   19.693209]  __kasan_kmalloc+0xd4/0xd8
[   19.693277]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.693361]  kmalloc_uaf2+0xc4/0x468
[   19.693695]  kunit_try_run_case+0x170/0x3f0
[   19.693790]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.693902]  kthread+0x328/0x630
[   19.693989]  ret_from_fork+0x10/0x20
[   19.694072] 
[   19.694118] Freed by task 189:
[   19.694173]  kasan_save_stack+0x3c/0x68
[   19.694256]  kasan_save_track+0x20/0x40
[   19.694358]  kasan_save_free_info+0x4c/0x78
[   19.694487]  __kasan_slab_free+0x6c/0x98
[   19.694581]  kfree+0x214/0x3c8
[   19.694698]  kmalloc_uaf2+0x134/0x468
[   19.694798]  kunit_try_run_case+0x170/0x3f0
[   19.694896]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.695029]  kthread+0x328/0x630
[   19.695136]  ret_from_fork+0x10/0x20
[   19.695214] 
[   19.695257] The buggy address belongs to the object at fff00000c59a1300
[   19.695257]  which belongs to the cache kmalloc-64 of size 64
[   19.695399] The buggy address is located 40 bytes inside of
[   19.695399]  freed 64-byte region [fff00000c59a1300, fff00000c59a1340)
[   19.695589] 
[   19.695638] The buggy address belongs to the physical page:
[   19.695703] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1059a1
[   19.695832] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.695938] page_type: f5(slab)
[   19.696028] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   19.696175] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   19.696278] page dumped because: kasan: bad access detected
[   19.696376] 
[   19.696427] Memory state around the buggy address:
[   19.696494]  fff00000c59a1200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.696597]  fff00000c59a1280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.696692] >fff00000c59a1300: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.696778]                                   ^
[   19.696866]  fff00000c59a1380: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   19.696953]  fff00000c59a1400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.697035] ==================================================================

[   12.920761] ==================================================================
[   12.921511] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   12.922247] Read of size 1 at addr ffff888102b9bb28 by task kunit_try_catch/206
[   12.922980] 
[   12.923076] CPU: 0 UID: 0 PID: 206 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.923121] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.923132] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.923153] Call Trace:
[   12.923164]  <TASK>
[   12.923180]  dump_stack_lvl+0x73/0xb0
[   12.923210]  print_report+0xd1/0x650
[   12.923232]  ? __virt_addr_valid+0x1db/0x2d0
[   12.923255]  ? kmalloc_uaf2+0x4a8/0x520
[   12.923274]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.923297]  ? kmalloc_uaf2+0x4a8/0x520
[   12.923317]  kasan_report+0x141/0x180
[   12.923338]  ? kmalloc_uaf2+0x4a8/0x520
[   12.923362]  __asan_report_load1_noabort+0x18/0x20
[   12.923387]  kmalloc_uaf2+0x4a8/0x520
[   12.923406]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   12.923426]  ? finish_task_switch.isra.0+0x153/0x700
[   12.923449]  ? __switch_to+0x47/0xf50
[   12.923476]  ? __schedule+0x10cc/0x2b60
[   12.923497]  ? __pfx_read_tsc+0x10/0x10
[   12.923517]  ? ktime_get_ts64+0x86/0x230
[   12.923540]  kunit_try_run_case+0x1a5/0x480
[   12.923564]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.923586]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.923609]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.923632]  ? __kthread_parkme+0x82/0x180
[   12.923664]  ? preempt_count_sub+0x50/0x80
[   12.923687]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.923711]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.923734]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.923771]  kthread+0x337/0x6f0
[   12.923805]  ? trace_preempt_on+0x20/0xc0
[   12.923830]  ? __pfx_kthread+0x10/0x10
[   12.923851]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.923872]  ? calculate_sigpending+0x7b/0xa0
[   12.923985]  ? __pfx_kthread+0x10/0x10
[   12.924008]  ret_from_fork+0x116/0x1d0
[   12.924027]  ? __pfx_kthread+0x10/0x10
[   12.924047]  ret_from_fork_asm+0x1a/0x30
[   12.924078]  </TASK>
[   12.924089] 
[   12.940973] Allocated by task 206:
[   12.941237]  kasan_save_stack+0x45/0x70
[   12.941657]  kasan_save_track+0x18/0x40
[   12.942110]  kasan_save_alloc_info+0x3b/0x50
[   12.942601]  __kasan_kmalloc+0xb7/0xc0
[   12.942854]  __kmalloc_cache_noprof+0x189/0x420
[   12.943401]  kmalloc_uaf2+0xc6/0x520
[   12.943838]  kunit_try_run_case+0x1a5/0x480
[   12.944363]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.944930]  kthread+0x337/0x6f0
[   12.945210]  ret_from_fork+0x116/0x1d0
[   12.945633]  ret_from_fork_asm+0x1a/0x30
[   12.946122] 
[   12.946220] Freed by task 206:
[   12.946416]  kasan_save_stack+0x45/0x70
[   12.946890]  kasan_save_track+0x18/0x40
[   12.947300]  kasan_save_free_info+0x3f/0x60
[   12.947818]  __kasan_slab_free+0x56/0x70
[   12.948176]  kfree+0x222/0x3f0
[   12.948409]  kmalloc_uaf2+0x14c/0x520
[   12.948576]  kunit_try_run_case+0x1a5/0x480
[   12.948985]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.949601]  kthread+0x337/0x6f0
[   12.949992]  ret_from_fork+0x116/0x1d0
[   12.950399]  ret_from_fork_asm+0x1a/0x30
[   12.950889] 
[   12.951078] The buggy address belongs to the object at ffff888102b9bb00
[   12.951078]  which belongs to the cache kmalloc-64 of size 64
[   12.952161] The buggy address is located 40 bytes inside of
[   12.952161]  freed 64-byte region [ffff888102b9bb00, ffff888102b9bb40)
[   12.953032] 
[   12.953274] The buggy address belongs to the physical page:
[   12.953867] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b9b
[   12.954472] flags: 0x200000000000000(node=0|zone=2)
[   12.954841] page_type: f5(slab)
[   12.955048] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   12.955310] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   12.955596] page dumped because: kasan: bad access detected
[   12.956183] 
[   12.956409] Memory state around the buggy address:
[   12.957027]  ffff888102b9ba00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.957847]  ffff888102b9ba80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.958601] >ffff888102b9bb00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.959370]                                   ^
[   12.959874]  ffff888102b9bb80: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   12.960622]  ffff888102b9bc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.963921] ==================================================================