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

Environment
qemu-arm64
qemu-x86_64

[   22.292572] ==================================================================
[   22.292719] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   22.292849] Read of size 1 at addr fff00000c5941f90 by task kunit_try_catch/260
[   22.292951] 
[   22.293033] CPU: 1 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   22.293286] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.293357] Hardware name: linux,dummy-virt (DT)
[   22.293480] Call trace:
[   22.293608]  show_stack+0x20/0x38 (C)
[   22.293722]  dump_stack_lvl+0x8c/0xd0
[   22.293839]  print_report+0x118/0x608
[   22.293959]  kasan_report+0xdc/0x128
[   22.294070]  __asan_report_load1_noabort+0x20/0x30
[   22.294211]  strcmp+0xc0/0xc8
[   22.294314]  kasan_strings+0x340/0xb00
[   22.294410]  kunit_try_run_case+0x170/0x3f0
[   22.294509]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.294640]  kthread+0x328/0x630
[   22.294778]  ret_from_fork+0x10/0x20
[   22.294950] 
[   22.295023] Allocated by task 260:
[   22.295099]  kasan_save_stack+0x3c/0x68
[   22.295243]  kasan_save_track+0x20/0x40
[   22.295366]  kasan_save_alloc_info+0x40/0x58
[   22.295500]  __kasan_kmalloc+0xd4/0xd8
[   22.295611]  __kmalloc_cache_noprof+0x16c/0x3c0
[   22.295709]  kasan_strings+0xc8/0xb00
[   22.295788]  kunit_try_run_case+0x170/0x3f0
[   22.295899]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.296011]  kthread+0x328/0x630
[   22.296123]  ret_from_fork+0x10/0x20
[   22.296245] 
[   22.296312] Freed by task 260:
[   22.296375]  kasan_save_stack+0x3c/0x68
[   22.296467]  kasan_save_track+0x20/0x40
[   22.296553]  kasan_save_free_info+0x4c/0x78
[   22.296650]  __kasan_slab_free+0x6c/0x98
[   22.296742]  kfree+0x214/0x3c8
[   22.296860]  kasan_strings+0x24c/0xb00
[   22.296989]  kunit_try_run_case+0x170/0x3f0
[   22.297120]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.297264]  kthread+0x328/0x630
[   22.297344]  ret_from_fork+0x10/0x20
[   22.297436] 
[   22.297775] The buggy address belongs to the object at fff00000c5941f80
[   22.297775]  which belongs to the cache kmalloc-32 of size 32
[   22.297953] The buggy address is located 16 bytes inside of
[   22.297953]  freed 32-byte region [fff00000c5941f80, fff00000c5941fa0)
[   22.298111] 
[   22.298188] The buggy address belongs to the physical page:
[   22.298274] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105941
[   22.298580] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   22.298732] page_type: f5(slab)
[   22.298883] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   22.299003] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   22.299150] page dumped because: kasan: bad access detected
[   22.299363] 
[   22.299438] Memory state around the buggy address:
[   22.299574]  fff00000c5941e80: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   22.299699]  fff00000c5941f00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   22.299806] >fff00000c5941f80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   22.299911]                          ^
[   22.300478]  fff00000c5942000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   22.300649]  fff00000c5942080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.300854] ==================================================================

[   14.547078] ==================================================================
[   14.548158] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   14.548415] Read of size 1 at addr ffff888103acf910 by task kunit_try_catch/277
[   14.548832] 
[   14.548923] CPU: 0 UID: 0 PID: 277 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   14.548968] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.549004] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.549025] Call Trace:
[   14.549037]  <TASK>
[   14.549054]  dump_stack_lvl+0x73/0xb0
[   14.549082]  print_report+0xd1/0x650
[   14.549107]  ? __virt_addr_valid+0x1db/0x2d0
[   14.549132]  ? strcmp+0xb0/0xc0
[   14.549166]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.549191]  ? strcmp+0xb0/0xc0
[   14.549209]  kasan_report+0x141/0x180
[   14.549231]  ? strcmp+0xb0/0xc0
[   14.549252]  __asan_report_load1_noabort+0x18/0x20
[   14.549279]  strcmp+0xb0/0xc0
[   14.549298]  kasan_strings+0x431/0xe80
[   14.549319]  ? trace_hardirqs_on+0x37/0xe0
[   14.549342]  ? __pfx_kasan_strings+0x10/0x10
[   14.549363]  ? finish_task_switch.isra.0+0x153/0x700
[   14.549404]  ? __switch_to+0x47/0xf50
[   14.549444]  ? __schedule+0x10cc/0x2b60
[   14.549467]  ? __pfx_read_tsc+0x10/0x10
[   14.549489]  ? ktime_get_ts64+0x86/0x230
[   14.549513]  kunit_try_run_case+0x1a5/0x480
[   14.549539]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.549562]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.549588]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.549612]  ? __kthread_parkme+0x82/0x180
[   14.549633]  ? preempt_count_sub+0x50/0x80
[   14.549675]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.549700]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.549725]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.549762]  kthread+0x337/0x6f0
[   14.549782]  ? trace_preempt_on+0x20/0xc0
[   14.549804]  ? __pfx_kthread+0x10/0x10
[   14.549824]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.549846]  ? calculate_sigpending+0x7b/0xa0
[   14.549871]  ? __pfx_kthread+0x10/0x10
[   14.549894]  ret_from_fork+0x116/0x1d0
[   14.549913]  ? __pfx_kthread+0x10/0x10
[   14.549934]  ret_from_fork_asm+0x1a/0x30
[   14.549965]  </TASK>
[   14.549976] 
[   14.558531] Allocated by task 277:
[   14.558665]  kasan_save_stack+0x45/0x70
[   14.559737]  kasan_save_track+0x18/0x40
[   14.559912]  kasan_save_alloc_info+0x3b/0x50
[   14.560061]  __kasan_kmalloc+0xb7/0xc0
[   14.560193]  __kmalloc_cache_noprof+0x189/0x420
[   14.560348]  kasan_strings+0xc0/0xe80
[   14.560509]  kunit_try_run_case+0x1a5/0x480
[   14.560778]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.561035]  kthread+0x337/0x6f0
[   14.561207]  ret_from_fork+0x116/0x1d0
[   14.561407]  ret_from_fork_asm+0x1a/0x30
[   14.561605] 
[   14.561882] Freed by task 277:
[   14.562050]  kasan_save_stack+0x45/0x70
[   14.562250]  kasan_save_track+0x18/0x40
[   14.562445]  kasan_save_free_info+0x3f/0x60
[   14.563736]  __kasan_slab_free+0x56/0x70
[   14.564951]  kfree+0x222/0x3f0
[   14.565090]  kasan_strings+0x2aa/0xe80
[   14.565223]  kunit_try_run_case+0x1a5/0x480
[   14.565367]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.565537]  kthread+0x337/0x6f0
[   14.565667]  ret_from_fork+0x116/0x1d0
[   14.566207]  ret_from_fork_asm+0x1a/0x30
[   14.566731] 
[   14.567921] The buggy address belongs to the object at ffff888103acf900
[   14.567921]  which belongs to the cache kmalloc-32 of size 32
[   14.569825] The buggy address is located 16 bytes inside of
[   14.569825]  freed 32-byte region [ffff888103acf900, ffff888103acf920)
[   14.571585] 
[   14.571980] The buggy address belongs to the physical page:
[   14.572725] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103acf
[   14.573207] flags: 0x200000000000000(node=0|zone=2)
[   14.573385] page_type: f5(slab)
[   14.573509] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.574547] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.575553] page dumped because: kasan: bad access detected
[   14.576340] 
[   14.576761] Memory state around the buggy address:
[   14.577328]  ffff888103acf800: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.578222]  ffff888103acf880: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.578563] >ffff888103acf900: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.579532]                          ^
[   14.580171]  ffff888103acf980: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.580502]  ffff888103acfa00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.581146] ==================================================================