Hay
Date
May 23, 2025, 11:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   31.012700] ==================================================================
[   31.012886] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   31.013038] Read of size 1 at addr fff00000c77a2dd0 by task kunit_try_catch/261
[   31.013191] 
[   31.013291] CPU: 0 UID: 0 PID: 261 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7 #1 PREEMPT 
[   31.013526] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.013608] Hardware name: linux,dummy-virt (DT)
[   31.013708] Call trace:
[   31.013781]  show_stack+0x20/0x38 (C)
[   31.013941]  dump_stack_lvl+0x8c/0xd0
[   31.014095]  print_report+0x118/0x608
[   31.014230]  kasan_report+0xdc/0x128
[   31.014397]  __asan_report_load1_noabort+0x20/0x30
[   31.014568]  strcmp+0xc0/0xc8
[   31.014743]  kasan_strings+0x340/0xb00
[   31.014939]  kunit_try_run_case+0x170/0x3f0
[   31.015088]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.015325]  kthread+0x328/0x630
[   31.015507]  ret_from_fork+0x10/0x20
[   31.015705] 
[   31.015791] Allocated by task 261:
[   31.015908]  kasan_save_stack+0x3c/0x68
[   31.016029]  kasan_save_track+0x20/0x40
[   31.016140]  kasan_save_alloc_info+0x40/0x58
[   31.016262]  __kasan_kmalloc+0xd4/0xd8
[   31.016467]  __kmalloc_cache_noprof+0x15c/0x3c0
[   31.016611]  kasan_strings+0xc8/0xb00
[   31.016740]  kunit_try_run_case+0x170/0x3f0
[   31.016905]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.017060]  kthread+0x328/0x630
[   31.017253]  ret_from_fork+0x10/0x20
[   31.017390] 
[   31.017496] Freed by task 261:
[   31.017574]  kasan_save_stack+0x3c/0x68
[   31.017681]  kasan_save_track+0x20/0x40
[   31.017790]  kasan_save_free_info+0x4c/0x78
[   31.017900]  __kasan_slab_free+0x6c/0x98
[   31.018016]  kfree+0x214/0x3c8
[   31.018116]  kasan_strings+0x24c/0xb00
[   31.018211]  kunit_try_run_case+0x170/0x3f0
[   31.018306]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.018422]  kthread+0x328/0x630
[   31.018550]  ret_from_fork+0x10/0x20
[   31.018717] 
[   31.018789] The buggy address belongs to the object at fff00000c77a2dc0
[   31.018789]  which belongs to the cache kmalloc-32 of size 32
[   31.019000] The buggy address is located 16 bytes inside of
[   31.019000]  freed 32-byte region [fff00000c77a2dc0, fff00000c77a2de0)
[   31.019224] 
[   31.019282] The buggy address belongs to the physical page:
[   31.019409] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1077a2
[   31.019582] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.019796] page_type: f5(slab)
[   31.019945] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   31.020253] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   31.020370] page dumped because: kasan: bad access detected
[   31.020481] 
[   31.020540] Memory state around the buggy address:
[   31.020668]  fff00000c77a2c80: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   31.020801]  fff00000c77a2d00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   31.020914] >fff00000c77a2d80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   31.021082]                                                  ^
[   31.021286]  fff00000c77a2e00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   31.021507]  fff00000c77a2e80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   31.021805] ==================================================================

[   14.512132] ==================================================================
[   14.513149] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   14.513686] Read of size 1 at addr ffff888102714790 by task kunit_try_catch/278
[   14.514008] 
[   14.514122] CPU: 0 UID: 0 PID: 278 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7 #1 PREEMPT(voluntary) 
[   14.514171] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.514184] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.514207] Call Trace:
[   14.514219]  <TASK>
[   14.514237]  dump_stack_lvl+0x73/0xb0
[   14.514266]  print_report+0xd1/0x650
[   14.514290]  ? __virt_addr_valid+0x1db/0x2d0
[   14.514326]  ? strcmp+0xb0/0xc0
[   14.514344]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.514368]  ? strcmp+0xb0/0xc0
[   14.514385]  kasan_report+0x141/0x180
[   14.514408]  ? strcmp+0xb0/0xc0
[   14.514430]  __asan_report_load1_noabort+0x18/0x20
[   14.514452]  strcmp+0xb0/0xc0
[   14.514471]  kasan_strings+0x431/0xe80
[   14.514491]  ? trace_hardirqs_on+0x37/0xe0
[   14.514515]  ? __pfx_kasan_strings+0x10/0x10
[   14.514536]  ? finish_task_switch.isra.0+0x153/0x700
[   14.514560]  ? __switch_to+0x5d9/0xf60
[   14.514582]  ? dequeue_task_fair+0x156/0x4e0
[   14.514607]  ? __schedule+0x10cc/0x2b30
[   14.514630]  ? __pfx_read_tsc+0x10/0x10
[   14.514649]  ? ktime_get_ts64+0x86/0x230
[   14.514680]  kunit_try_run_case+0x1a5/0x480
[   14.514705]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.514727]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.514751]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.514782]  ? __kthread_parkme+0x82/0x180
[   14.514805]  ? preempt_count_sub+0x50/0x80
[   14.514828]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.514852]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.514874]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.514897]  kthread+0x337/0x6f0
[   14.514914]  ? trace_preempt_on+0x20/0xc0
[   14.514936]  ? __pfx_kthread+0x10/0x10
[   14.514954]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.514975]  ? calculate_sigpending+0x7b/0xa0
[   14.514997]  ? __pfx_kthread+0x10/0x10
[   14.515015]  ret_from_fork+0x41/0x80
[   14.515036]  ? __pfx_kthread+0x10/0x10
[   14.515053]  ret_from_fork_asm+0x1a/0x30
[   14.515084]  </TASK>
[   14.515096] 
[   14.522819] Allocated by task 278:
[   14.522988]  kasan_save_stack+0x45/0x70
[   14.523136]  kasan_save_track+0x18/0x40
[   14.523275]  kasan_save_alloc_info+0x3b/0x50
[   14.523493]  __kasan_kmalloc+0xb7/0xc0
[   14.523688]  __kmalloc_cache_noprof+0x189/0x420
[   14.523910]  kasan_strings+0xc0/0xe80
[   14.524087]  kunit_try_run_case+0x1a5/0x480
[   14.524235]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.524421]  kthread+0x337/0x6f0
[   14.524656]  ret_from_fork+0x41/0x80
[   14.524841]  ret_from_fork_asm+0x1a/0x30
[   14.525041] 
[   14.525135] Freed by task 278:
[   14.525296]  kasan_save_stack+0x45/0x70
[   14.525520]  kasan_save_track+0x18/0x40
[   14.525692]  kasan_save_free_info+0x3f/0x60
[   14.525888]  __kasan_slab_free+0x56/0x70
[   14.526067]  kfree+0x222/0x3f0
[   14.526212]  kasan_strings+0x2aa/0xe80
[   14.526407]  kunit_try_run_case+0x1a5/0x480
[   14.526619]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.526875]  kthread+0x337/0x6f0
[   14.527005]  ret_from_fork+0x41/0x80
[   14.527141]  ret_from_fork_asm+0x1a/0x30
[   14.527282] 
[   14.527364] The buggy address belongs to the object at ffff888102714780
[   14.527364]  which belongs to the cache kmalloc-32 of size 32
[   14.527739] The buggy address is located 16 bytes inside of
[   14.527739]  freed 32-byte region [ffff888102714780, ffff8881027147a0)
[   14.528561] 
[   14.528664] The buggy address belongs to the physical page:
[   14.528917] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102714
[   14.529367] flags: 0x200000000000000(node=0|zone=2)
[   14.529747] page_type: f5(slab)
[   14.529911] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.530163] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.530419] page dumped because: kasan: bad access detected
[   14.530654] 
[   14.530755] Memory state around the buggy address:
[   14.530985]  ffff888102714680: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.531320]  ffff888102714700: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   14.531744] >ffff888102714780: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.531994]                          ^
[   14.532170]  ffff888102714800: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.532528]  ffff888102714880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.532805] ==================================================================