Hay
Date
June 2, 2025, 2:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.695993] ==================================================================
[   18.696746] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   18.697760] Read of size 16 at addr fff00000c58f5f00 by task kunit_try_catch/158
[   18.698882] 
[   18.699121] CPU: 1 UID: 0 PID: 158 Comm: kunit_try_catch Tainted: G    B            N 6.14.10-rc1 #1
[   18.699310] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.699375] Hardware name: linux,dummy-virt (DT)
[   18.699453] Call trace:
[   18.699482]  show_stack+0x20/0x38 (C)
[   18.699554]  dump_stack_lvl+0x8c/0xd0
[   18.699641]  print_report+0x118/0x608
[   18.699696]  kasan_report+0xdc/0x128
[   18.699747]  __asan_report_load16_noabort+0x20/0x30
[   18.699798]  kmalloc_uaf_16+0x3bc/0x438
[   18.699847]  kunit_try_run_case+0x170/0x3f0
[   18.699899]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.699955]  kthread+0x318/0x620
[   18.700006]  ret_from_fork+0x10/0x20
[   18.700063] 
[   18.704071] Allocated by task 158:
[   18.704618]  kasan_save_stack+0x3c/0x68
[   18.705005]  kasan_save_track+0x20/0x40
[   18.705516]  kasan_save_alloc_info+0x40/0x58
[   18.705883]  __kasan_kmalloc+0xd4/0xd8
[   18.707316]  __kmalloc_cache_noprof+0x16c/0x3c0
[   18.707779]  kmalloc_uaf_16+0x140/0x438
[   18.708172]  kunit_try_run_case+0x170/0x3f0
[   18.708550]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.709308]  kthread+0x318/0x620
[   18.709675]  ret_from_fork+0x10/0x20
[   18.710480] 
[   18.710967] Freed by task 158:
[   18.711213]  kasan_save_stack+0x3c/0x68
[   18.711632]  kasan_save_track+0x20/0x40
[   18.712252]  kasan_save_free_info+0x4c/0x78
[   18.712664]  __kasan_slab_free+0x6c/0x98
[   18.713202]  kfree+0x214/0x3c8
[   18.713592]  kmalloc_uaf_16+0x190/0x438
[   18.715076]  kunit_try_run_case+0x170/0x3f0
[   18.715427]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.715891]  kthread+0x318/0x620
[   18.716562]  ret_from_fork+0x10/0x20
[   18.717093] 
[   18.717357] The buggy address belongs to the object at fff00000c58f5f00
[   18.717357]  which belongs to the cache kmalloc-16 of size 16
[   18.718702] The buggy address is located 0 bytes inside of
[   18.718702]  freed 16-byte region [fff00000c58f5f00, fff00000c58f5f10)
[   18.719671] 
[   18.720047] The buggy address belongs to the physical page:
[   18.720377] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1058f5
[   18.721191] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.721814] page_type: f5(slab)
[   18.722450] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   18.723439] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   18.724222] page dumped because: kasan: bad access detected
[   18.724647] 
[   18.725079] Memory state around the buggy address:
[   18.725403]  fff00000c58f5e00: 00 02 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   18.726441]  fff00000c58f5e80: fa fb fc fc fa fb fc fc 00 04 fc fc 00 00 fc fc
[   18.726986] >fff00000c58f5f00: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.727781]                    ^
[   18.728241]  fff00000c58f5f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.728897]  fff00000c58f6000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.729608] ==================================================================

[   12.713347] ==================================================================
[   12.713817] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47d/0x4c0
[   12.714136] Read of size 16 at addr ffff8881025d03a0 by task kunit_try_catch/176
[   12.714454] 
[   12.714555] CPU: 0 UID: 0 PID: 176 Comm: kunit_try_catch Tainted: G    B            N 6.14.10-rc1 #1
[   12.714594] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.714605] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.714624] Call Trace:
[   12.714636]  <TASK>
[   12.714652]  dump_stack_lvl+0x73/0xb0
[   12.714679]  print_report+0xd1/0x650
[   12.714703]  ? __virt_addr_valid+0x1db/0x2d0
[   12.714729]  ? kmalloc_uaf_16+0x47d/0x4c0
[   12.714751]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.714779]  ? kmalloc_uaf_16+0x47d/0x4c0
[   12.714802]  kasan_report+0x140/0x180
[   12.714827]  ? kmalloc_uaf_16+0x47d/0x4c0
[   12.714855]  __asan_report_load16_noabort+0x18/0x20
[   12.714881]  kmalloc_uaf_16+0x47d/0x4c0
[   12.714904]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   12.714928]  ? __schedule+0xce8/0x2840
[   12.714954]  ? __pfx_read_tsc+0x10/0x10
[   12.714978]  ? ktime_get_ts64+0x86/0x230
[   12.715008]  kunit_try_run_case+0x1a6/0x480
[   12.715045]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.715069]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   12.715095]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.715121]  ? __kthread_parkme+0x82/0x160
[   12.715147]  ? preempt_count_sub+0x50/0x80
[   12.715174]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.715200]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.715229]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.715258]  kthread+0x324/0x6e0
[   12.715283]  ? trace_preempt_on+0x20/0xc0
[   12.715309]  ? __pfx_kthread+0x10/0x10
[   12.715334]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.715359]  ? calculate_sigpending+0x7b/0xa0
[   12.715384]  ? __pfx_kthread+0x10/0x10
[   12.715409]  ret_from_fork+0x41/0x80
[   12.715431]  ? __pfx_kthread+0x10/0x10
[   12.715457]  ret_from_fork_asm+0x1a/0x30
[   12.715492]  </TASK>
[   12.715502] 
[   12.723427] Allocated by task 176:
[   12.724142]  kasan_save_stack+0x45/0x70
[   12.724473]  kasan_save_track+0x18/0x40
[   12.724779]  kasan_save_alloc_info+0x3b/0x50
[   12.724986]  __kasan_kmalloc+0xb7/0xc0
[   12.725173]  __kmalloc_cache_noprof+0x18a/0x420
[   12.725380]  kmalloc_uaf_16+0x15c/0x4c0
[   12.725547]  kunit_try_run_case+0x1a6/0x480
[   12.726336]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.726991]  kthread+0x324/0x6e0
[   12.727234]  ret_from_fork+0x41/0x80
[   12.727416]  ret_from_fork_asm+0x1a/0x30
[   12.727995] 
[   12.728110] Freed by task 176:
[   12.728257]  kasan_save_stack+0x45/0x70
[   12.728444]  kasan_save_track+0x18/0x40
[   12.728970]  kasan_save_free_info+0x3f/0x60
[   12.729393]  __kasan_slab_free+0x56/0x70
[   12.729695]  kfree+0x224/0x3f0
[   12.729979]  kmalloc_uaf_16+0x1d7/0x4c0
[   12.730177]  kunit_try_run_case+0x1a6/0x480
[   12.730368]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.730909]  kthread+0x324/0x6e0
[   12.731146]  ret_from_fork+0x41/0x80
[   12.731448]  ret_from_fork_asm+0x1a/0x30
[   12.732088] 
[   12.732185] The buggy address belongs to the object at ffff8881025d03a0
[   12.732185]  which belongs to the cache kmalloc-16 of size 16
[   12.733331] The buggy address is located 0 bytes inside of
[   12.733331]  freed 16-byte region [ffff8881025d03a0, ffff8881025d03b0)
[   12.734269] 
[   12.734370] The buggy address belongs to the physical page:
[   12.734882] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1025d0
[   12.735226] flags: 0x200000000000000(node=0|zone=2)
[   12.735435] page_type: f5(slab)
[   12.736041] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.736448] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.736956] page dumped because: kasan: bad access detected
[   12.737203] 
[   12.737289] Memory state around the buggy address:
[   12.737493]  ffff8881025d0280: fa fb fc fc 00 02 fc fc 00 05 fc fc 00 02 fc fc
[   12.738356]  ffff8881025d0300: 00 02 fc fc 00 02 fc fc 00 02 fc fc fa fb fc fc
[   12.739114] >ffff8881025d0380: 00 00 fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   12.739836]                                ^
[   12.740048]  ffff8881025d0400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.740336]  ffff8881025d0480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.740916] ==================================================================