Hay
Date
July 10, 2025, 11:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.069655] ==================================================================
[   16.069716] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   16.069785] Read of size 1 at addr fff00000c64512a8 by task kunit_try_catch/188
[   16.069838] 
[   16.069872] CPU: 1 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   16.069956] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.069981] Hardware name: linux,dummy-virt (DT)
[   16.070013] Call trace:
[   16.070034]  show_stack+0x20/0x38 (C)
[   16.070095]  dump_stack_lvl+0x8c/0xd0
[   16.070144]  print_report+0x118/0x608
[   16.070192]  kasan_report+0xdc/0x128
[   16.070237]  __asan_report_load1_noabort+0x20/0x30
[   16.070290]  kmalloc_uaf2+0x3f4/0x468
[   16.070335]  kunit_try_run_case+0x170/0x3f0
[   16.070385]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.070439]  kthread+0x328/0x630
[   16.070481]  ret_from_fork+0x10/0x20
[   16.070530] 
[   16.070548] Allocated by task 188:
[   16.070576]  kasan_save_stack+0x3c/0x68
[   16.070615]  kasan_save_track+0x20/0x40
[   16.070654]  kasan_save_alloc_info+0x40/0x58
[   16.070693]  __kasan_kmalloc+0xd4/0xd8
[   16.070729]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.070769]  kmalloc_uaf2+0xc4/0x468
[   16.070804]  kunit_try_run_case+0x170/0x3f0
[   16.070841]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.071113]  kthread+0x328/0x630
[   16.071151]  ret_from_fork+0x10/0x20
[   16.071342] 
[   16.071361] Freed by task 188:
[   16.071390]  kasan_save_stack+0x3c/0x68
[   16.071508]  kasan_save_track+0x20/0x40
[   16.071551]  kasan_save_free_info+0x4c/0x78
[   16.071593]  __kasan_slab_free+0x6c/0x98
[   16.071631]  kfree+0x214/0x3c8
[   16.071663]  kmalloc_uaf2+0x134/0x468
[   16.071932]  kunit_try_run_case+0x170/0x3f0
[   16.072022]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.072159]  kthread+0x328/0x630
[   16.072234]  ret_from_fork+0x10/0x20
[   16.072289] 
[   16.072308] The buggy address belongs to the object at fff00000c6451280
[   16.072308]  which belongs to the cache kmalloc-64 of size 64
[   16.072528] The buggy address is located 40 bytes inside of
[   16.072528]  freed 64-byte region [fff00000c6451280, fff00000c64512c0)
[   16.072598] 
[   16.072619] The buggy address belongs to the physical page:
[   16.072652] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106451
[   16.072725] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.072776] page_type: f5(slab)
[   16.072818] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   16.072903] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   16.072996] page dumped because: kasan: bad access detected
[   16.073028] 
[   16.073045] Memory state around the buggy address:
[   16.073170]  fff00000c6451180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.073214]  fff00000c6451200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.073256] >fff00000c6451280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   16.073294]                                   ^
[   16.073326]  fff00000c6451300: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   16.073368]  fff00000c6451380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.073407] ==================================================================

[   12.990092] ==================================================================
[   12.990659] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   12.990951] Read of size 1 at addr ffff888102d67fa8 by task kunit_try_catch/205
[   12.991213] 
[   12.991324] CPU: 1 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.991375] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.991386] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.991405] Call Trace:
[   12.991416]  <TASK>
[   12.991431]  dump_stack_lvl+0x73/0xb0
[   12.991460]  print_report+0xd1/0x650
[   12.991483]  ? __virt_addr_valid+0x1db/0x2d0
[   12.991506]  ? kmalloc_uaf2+0x4a8/0x520
[   12.991525]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.991548]  ? kmalloc_uaf2+0x4a8/0x520
[   12.991568]  kasan_report+0x141/0x180
[   12.991589]  ? kmalloc_uaf2+0x4a8/0x520
[   12.991613]  __asan_report_load1_noabort+0x18/0x20
[   12.991638]  kmalloc_uaf2+0x4a8/0x520
[   12.991658]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   12.991699]  ? finish_task_switch.isra.0+0x153/0x700
[   12.991740]  ? __switch_to+0x47/0xf50
[   12.991767]  ? __schedule+0x10cc/0x2b60
[   12.991791]  ? __pfx_read_tsc+0x10/0x10
[   12.991813]  ? ktime_get_ts64+0x86/0x230
[   12.991838]  kunit_try_run_case+0x1a5/0x480
[   12.991863]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.991886]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.991910]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.991933]  ? __kthread_parkme+0x82/0x180
[   12.991954]  ? preempt_count_sub+0x50/0x80
[   12.991976]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.992000]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.992024]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.992049]  kthread+0x337/0x6f0
[   12.992067]  ? trace_preempt_on+0x20/0xc0
[   12.992091]  ? __pfx_kthread+0x10/0x10
[   12.992112]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.992133]  ? calculate_sigpending+0x7b/0xa0
[   12.992157]  ? __pfx_kthread+0x10/0x10
[   12.992184]  ret_from_fork+0x116/0x1d0
[   12.992202]  ? __pfx_kthread+0x10/0x10
[   12.992222]  ret_from_fork_asm+0x1a/0x30
[   12.992266]  </TASK>
[   12.992275] 
[   12.999600] Allocated by task 205:
[   13.000390]  kasan_save_stack+0x45/0x70
[   13.000590]  kasan_save_track+0x18/0x40
[   13.000916]  kasan_save_alloc_info+0x3b/0x50
[   13.001073]  __kasan_kmalloc+0xb7/0xc0
[   13.001207]  __kmalloc_cache_noprof+0x189/0x420
[   13.001374]  kmalloc_uaf2+0xc6/0x520
[   13.001756]  kunit_try_run_case+0x1a5/0x480
[   13.001965]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.002200]  kthread+0x337/0x6f0
[   13.002405]  ret_from_fork+0x116/0x1d0
[   13.002599]  ret_from_fork_asm+0x1a/0x30
[   13.002763] 
[   13.002857] Freed by task 205:
[   13.002996]  kasan_save_stack+0x45/0x70
[   13.003164]  kasan_save_track+0x18/0x40
[   13.003330]  kasan_save_free_info+0x3f/0x60
[   13.003485]  __kasan_slab_free+0x56/0x70
[   13.003623]  kfree+0x222/0x3f0
[   13.003894]  kmalloc_uaf2+0x14c/0x520
[   13.004080]  kunit_try_run_case+0x1a5/0x480
[   13.004289]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.004521]  kthread+0x337/0x6f0
[   13.004664]  ret_from_fork+0x116/0x1d0
[   13.004796]  ret_from_fork_asm+0x1a/0x30
[   13.004934] 
[   13.005004] The buggy address belongs to the object at ffff888102d67f80
[   13.005004]  which belongs to the cache kmalloc-64 of size 64
[   13.005673] The buggy address is located 40 bytes inside of
[   13.005673]  freed 64-byte region [ffff888102d67f80, ffff888102d67fc0)
[   13.006122] 
[   13.006195] The buggy address belongs to the physical page:
[   13.006375] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102d67
[   13.007110] flags: 0x200000000000000(node=0|zone=2)
[   13.007508] page_type: f5(slab)
[   13.007641] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   13.008086] raw: 0000000000000000 0000000000200020 00000000f5000000 0000000000000000
[   13.008440] page dumped because: kasan: bad access detected
[   13.008709] 
[   13.008778] Memory state around the buggy address:
[   13.008932]  ffff888102d67e80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.009147]  ffff888102d67f00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.009653] >ffff888102d67f80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.009932]                                   ^
[   13.010079]  ffff888102d68000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.010304]  ffff888102d68080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.010903] ==================================================================