Hay
Date
July 23, 2025, 2:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   15.562051] ==================================================================
[   15.562119] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   15.562172] Read of size 1 at addr fff00000c3f904a8 by task kunit_try_catch/188
[   15.562225] 
[   15.562256] CPU: 1 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7 #1 PREEMPT 
[   15.562338] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.562366] Hardware name: linux,dummy-virt (DT)
[   15.562398] Call trace:
[   15.562421]  show_stack+0x20/0x38 (C)
[   15.562477]  dump_stack_lvl+0x8c/0xd0
[   15.562537]  print_report+0x118/0x5d0
[   15.563030]  kasan_report+0xdc/0x128
[   15.563082]  __asan_report_load1_noabort+0x20/0x30
[   15.563519]  kmalloc_uaf2+0x3f4/0x468
[   15.563590]  kunit_try_run_case+0x170/0x3f0
[   15.563659]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.563862]  kthread+0x328/0x630
[   15.564061]  ret_from_fork+0x10/0x20
[   15.564504] 
[   15.564532] Allocated by task 188:
[   15.564937]  kasan_save_stack+0x3c/0x68
[   15.564995]  kasan_save_track+0x20/0x40
[   15.565210]  kasan_save_alloc_info+0x40/0x58
[   15.565399]  __kasan_kmalloc+0xd4/0xd8
[   15.565474]  __kmalloc_cache_noprof+0x16c/0x3c0
[   15.565812]  kmalloc_uaf2+0xc4/0x468
[   15.566016]  kunit_try_run_case+0x170/0x3f0
[   15.566284]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.566395]  kthread+0x328/0x630
[   15.566469]  ret_from_fork+0x10/0x20
[   15.566668] 
[   15.566766] Freed by task 188:
[   15.566827]  kasan_save_stack+0x3c/0x68
[   15.567071]  kasan_save_track+0x20/0x40
[   15.567357]  kasan_save_free_info+0x4c/0x78
[   15.567497]  __kasan_slab_free+0x6c/0x98
[   15.567609]  kfree+0x214/0x3c8
[   15.567869]  kmalloc_uaf2+0x134/0x468
[   15.568010]  kunit_try_run_case+0x170/0x3f0
[   15.568202]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.568300]  kthread+0x328/0x630
[   15.568437]  ret_from_fork+0x10/0x20
[   15.568508] 
[   15.568549] The buggy address belongs to the object at fff00000c3f90480
[   15.568549]  which belongs to the cache kmalloc-64 of size 64
[   15.568863] The buggy address is located 40 bytes inside of
[   15.568863]  freed 64-byte region [fff00000c3f90480, fff00000c3f904c0)
[   15.569208] 
[   15.569251] The buggy address belongs to the physical page:
[   15.569421] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103f90
[   15.569704] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.569793] page_type: f5(slab)
[   15.569971] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   15.570054] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   15.570152] page dumped because: kasan: bad access detected
[   15.570275] 
[   15.570364] Memory state around the buggy address:
[   15.570645]  fff00000c3f90380: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   15.570900]  fff00000c3f90400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   15.571048] >fff00000c3f90480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   15.571201]                                   ^
[   15.571355]  fff00000c3f90500: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   15.571429]  fff00000c3f90580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.571747] ==================================================================

[   12.897708] ==================================================================
[   12.898252] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   12.898587] Read of size 1 at addr ffff888102b02e28 by task kunit_try_catch/205
[   12.899182] 
[   12.899506] CPU: 0 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7 #1 PREEMPT(voluntary) 
[   12.899554] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.899741] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.899766] Call Trace:
[   12.899780]  <TASK>
[   12.899795]  dump_stack_lvl+0x73/0xb0
[   12.899839]  print_report+0xd1/0x610
[   12.899861]  ? __virt_addr_valid+0x1db/0x2d0
[   12.899883]  ? kmalloc_uaf2+0x4a8/0x520
[   12.899902]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.899923]  ? kmalloc_uaf2+0x4a8/0x520
[   12.899942]  kasan_report+0x141/0x180
[   12.899963]  ? kmalloc_uaf2+0x4a8/0x520
[   12.899987]  __asan_report_load1_noabort+0x18/0x20
[   12.900010]  kmalloc_uaf2+0x4a8/0x520
[   12.900030]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   12.900049]  ? finish_task_switch.isra.0+0x153/0x700
[   12.900070]  ? __switch_to+0x47/0xf50
[   12.900118]  ? __schedule+0x10c6/0x2b60
[   12.900140]  ? __pfx_read_tsc+0x10/0x10
[   12.900159]  ? ktime_get_ts64+0x86/0x230
[   12.900182]  kunit_try_run_case+0x1a5/0x480
[   12.900230]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.900252]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.900275]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.900297]  ? __kthread_parkme+0x82/0x180
[   12.900316]  ? preempt_count_sub+0x50/0x80
[   12.900338]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.900361]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.900383]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.900407]  kthread+0x337/0x6f0
[   12.900426]  ? trace_preempt_on+0x20/0xc0
[   12.900448]  ? __pfx_kthread+0x10/0x10
[   12.900468]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.900488]  ? calculate_sigpending+0x7b/0xa0
[   12.900512]  ? __pfx_kthread+0x10/0x10
[   12.900532]  ret_from_fork+0x116/0x1d0
[   12.900550]  ? __pfx_kthread+0x10/0x10
[   12.900570]  ret_from_fork_asm+0x1a/0x30
[   12.900600]  </TASK>
[   12.900610] 
[   12.911072] Allocated by task 205:
[   12.911730]  kasan_save_stack+0x45/0x70
[   12.911927]  kasan_save_track+0x18/0x40
[   12.912071]  kasan_save_alloc_info+0x3b/0x50
[   12.912360]  __kasan_kmalloc+0xb7/0xc0
[   12.912621]  __kmalloc_cache_noprof+0x189/0x420
[   12.912857]  kmalloc_uaf2+0xc6/0x520
[   12.913025]  kunit_try_run_case+0x1a5/0x480
[   12.913488]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.913797]  kthread+0x337/0x6f0
[   12.913936]  ret_from_fork+0x116/0x1d0
[   12.914227]  ret_from_fork_asm+0x1a/0x30
[   12.914699] 
[   12.914798] Freed by task 205:
[   12.915037]  kasan_save_stack+0x45/0x70
[   12.915360]  kasan_save_track+0x18/0x40
[   12.915644]  kasan_save_free_info+0x3f/0x60
[   12.915922]  __kasan_slab_free+0x56/0x70
[   12.916169]  kfree+0x222/0x3f0
[   12.916390]  kmalloc_uaf2+0x14c/0x520
[   12.916562]  kunit_try_run_case+0x1a5/0x480
[   12.916747]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.917000]  kthread+0x337/0x6f0
[   12.917432]  ret_from_fork+0x116/0x1d0
[   12.917610]  ret_from_fork_asm+0x1a/0x30
[   12.917801] 
[   12.918029] The buggy address belongs to the object at ffff888102b02e00
[   12.918029]  which belongs to the cache kmalloc-64 of size 64
[   12.918668] The buggy address is located 40 bytes inside of
[   12.918668]  freed 64-byte region [ffff888102b02e00, ffff888102b02e40)
[   12.919164] 
[   12.919250] The buggy address belongs to the physical page:
[   12.919505] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b02
[   12.919840] flags: 0x200000000000000(node=0|zone=2)
[   12.920066] page_type: f5(slab)
[   12.920851] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   12.921143] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   12.921710] page dumped because: kasan: bad access detected
[   12.922076] 
[   12.922169] Memory state around the buggy address:
[   12.922537]  ffff888102b02d00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.923010]  ffff888102b02d80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.923450] >ffff888102b02e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   12.923747]                                   ^
[   12.923957]  ffff888102b02e80: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   12.924658]  ffff888102b02f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.924965] ==================================================================