Hay
Date
May 13, 2025, 12:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.285023] ==================================================================
[   19.285120] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   19.285212] Read of size 16 at addr fff00000c40350e0 by task kunit_try_catch/168
[   19.285268] 
[   19.285316] CPU: 1 UID: 0 PID: 168 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250513 #1 PREEMPT 
[   19.285412] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.286722] Hardware name: linux,dummy-virt (DT)
[   19.286929] Call trace:
[   19.286989]  show_stack+0x20/0x38 (C)
[   19.287063]  dump_stack_lvl+0x8c/0xd0
[   19.287189]  print_report+0x118/0x608
[   19.287370]  kasan_report+0xdc/0x128
[   19.287486]  __asan_report_load16_noabort+0x20/0x30
[   19.287875]  kmalloc_uaf_16+0x3bc/0x438
[   19.287950]  kunit_try_run_case+0x170/0x3f0
[   19.288032]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.288093]  kthread+0x328/0x630
[   19.288371]  ret_from_fork+0x10/0x20
[   19.288638] 
[   19.288667] Allocated by task 168:
[   19.288732]  kasan_save_stack+0x3c/0x68
[   19.288930]  kasan_save_track+0x20/0x40
[   19.288993]  kasan_save_alloc_info+0x40/0x58
[   19.289042]  __kasan_kmalloc+0xd4/0xd8
[   19.289084]  __kmalloc_cache_noprof+0x15c/0x3c0
[   19.289136]  kmalloc_uaf_16+0x140/0x438
[   19.289373]  kunit_try_run_case+0x170/0x3f0
[   19.289451]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.289690]  kthread+0x328/0x630
[   19.290124]  ret_from_fork+0x10/0x20
[   19.290209] 
[   19.290463] Freed by task 168:
[   19.290665]  kasan_save_stack+0x3c/0x68
[   19.291002]  kasan_save_track+0x20/0x40
[   19.291344]  kasan_save_free_info+0x4c/0x78
[   19.291415]  __kasan_slab_free+0x6c/0x98
[   19.291809]  kfree+0x214/0x3c8
[   19.291928]  kmalloc_uaf_16+0x190/0x438
[   19.291982]  kunit_try_run_case+0x170/0x3f0
[   19.292025]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.292746]  kthread+0x328/0x630
[   19.292809]  ret_from_fork+0x10/0x20
[   19.293017] 
[   19.293149] The buggy address belongs to the object at fff00000c40350e0
[   19.293149]  which belongs to the cache kmalloc-16 of size 16
[   19.293304] The buggy address is located 0 bytes inside of
[   19.293304]  freed 16-byte region [fff00000c40350e0, fff00000c40350f0)
[   19.293372] 
[   19.293397] The buggy address belongs to the physical page:
[   19.293440] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104035
[   19.293513] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.293570] page_type: f5(slab)
[   19.293621] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   19.293677] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   19.293721] page dumped because: kasan: bad access detected
[   19.293755] 
[   19.293774] Memory state around the buggy address:
[   19.293819]  fff00000c4034f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.293872]  fff00000c4035000: 00 02 fc fc 00 05 fc fc fa fb fc fc fa fb fc fc
[   19.293919] >fff00000c4035080: fa fb fc fc fa fb fc fc 00 00 fc fc fa fb fc fc
[   19.293980]                                                        ^
[   19.294070]  fff00000c4035100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.294113]  fff00000c4035180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.294186] ==================================================================

[   11.092864] ==================================================================
[   11.093416] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0
[   11.094271] Read of size 16 at addr ffff888101c86980 by task kunit_try_catch/185
[   11.095042] 
[   11.095135] CPU: 1 UID: 0 PID: 185 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250513 #1 PREEMPT(voluntary) 
[   11.095210] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.095222] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.095242] Call Trace:
[   11.095254]  <TASK>
[   11.095270]  dump_stack_lvl+0x73/0xb0
[   11.095318]  print_report+0xd1/0x650
[   11.095341]  ? __virt_addr_valid+0x1db/0x2d0
[   11.095388]  ? kmalloc_uaf_16+0x47b/0x4c0
[   11.095409]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.095431]  ? kmalloc_uaf_16+0x47b/0x4c0
[   11.095452]  kasan_report+0x141/0x180
[   11.095519]  ? kmalloc_uaf_16+0x47b/0x4c0
[   11.095546]  __asan_report_load16_noabort+0x18/0x20
[   11.095566]  kmalloc_uaf_16+0x47b/0x4c0
[   11.095587]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   11.095609]  ? __schedule+0x10cc/0x2b60
[   11.095641]  ? __pfx_read_tsc+0x10/0x10
[   11.095662]  ? ktime_get_ts64+0x86/0x230
[   11.095688]  kunit_try_run_case+0x1a5/0x480
[   11.095713]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.095734]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.095757]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.095778]  ? __kthread_parkme+0x82/0x180
[   11.095799]  ? preempt_count_sub+0x50/0x80
[   11.095824]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.095846]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.095869]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.095891]  kthread+0x337/0x6f0
[   11.095910]  ? trace_preempt_on+0x20/0xc0
[   11.095934]  ? __pfx_kthread+0x10/0x10
[   11.095956]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.095976]  ? calculate_sigpending+0x7b/0xa0
[   11.096000]  ? __pfx_kthread+0x10/0x10
[   11.096021]  ret_from_fork+0x116/0x1d0
[   11.096039]  ? __pfx_kthread+0x10/0x10
[   11.096059]  ret_from_fork_asm+0x1a/0x30
[   11.096091]  </TASK>
[   11.096101] 
[   11.107367] Allocated by task 185:
[   11.107789]  kasan_save_stack+0x45/0x70
[   11.108189]  kasan_save_track+0x18/0x40
[   11.108746]  kasan_save_alloc_info+0x3b/0x50
[   11.109247]  __kasan_kmalloc+0xb7/0xc0
[   11.109600]  __kmalloc_cache_noprof+0x189/0x420
[   11.110080]  kmalloc_uaf_16+0x15b/0x4c0
[   11.110603]  kunit_try_run_case+0x1a5/0x480
[   11.111025]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.111627]  kthread+0x337/0x6f0
[   11.112027]  ret_from_fork+0x116/0x1d0
[   11.112425]  ret_from_fork_asm+0x1a/0x30
[   11.112885] 
[   11.113057] Freed by task 185:
[   11.113369]  kasan_save_stack+0x45/0x70
[   11.113774]  kasan_save_track+0x18/0x40
[   11.114126]  kasan_save_free_info+0x3f/0x60
[   11.114590]  __kasan_slab_free+0x56/0x70
[   11.115018]  kfree+0x222/0x3f0
[   11.115322]  kmalloc_uaf_16+0x1d6/0x4c0
[   11.115710]  kunit_try_run_case+0x1a5/0x480
[   11.116206]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.116791]  kthread+0x337/0x6f0
[   11.117115]  ret_from_fork+0x116/0x1d0
[   11.117519]  ret_from_fork_asm+0x1a/0x30
[   11.117948] 
[   11.118123] The buggy address belongs to the object at ffff888101c86980
[   11.118123]  which belongs to the cache kmalloc-16 of size 16
[   11.119300] The buggy address is located 0 bytes inside of
[   11.119300]  freed 16-byte region [ffff888101c86980, ffff888101c86990)
[   11.120222] 
[   11.120303] The buggy address belongs to the physical page:
[   11.120476] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101c86
[   11.121193] flags: 0x200000000000000(node=0|zone=2)
[   11.121707] page_type: f5(slab)
[   11.122014] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   11.122676] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   11.123013] page dumped because: kasan: bad access detected
[   11.123191] 
[   11.123356] Memory state around the buggy address:
[   11.123836]  ffff888101c86880: 00 00 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   11.124578]  ffff888101c86900: fa fb fc fc fa fb fc fc fa fb fc fc 00 00 fc fc
[   11.125328] >ffff888101c86980: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.125788]                    ^
[   11.126089]  ffff888101c86a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.126734]  ffff888101c86a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.126961] ==================================================================