Hay
Date
May 12, 2025, 11:48 a.m.

Environment
qemu-arm64
qemu-x86_64

[   19.016560] ==================================================================
[   19.016614] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   19.016671] Read of size 1 at addr fff00000c78896d0 by task kunit_try_catch/259
[   19.017618] 
[   19.017688] CPU: 0 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250512 #1 PREEMPT 
[   19.017793] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.017825] Hardware name: linux,dummy-virt (DT)
[   19.017858] Call trace:
[   19.017894]  show_stack+0x20/0x38 (C)
[   19.017954]  dump_stack_lvl+0x8c/0xd0
[   19.018005]  print_report+0x118/0x608
[   19.018062]  kasan_report+0xdc/0x128
[   19.018111]  __asan_report_load1_noabort+0x20/0x30
[   19.018162]  strcmp+0xc0/0xc8
[   19.019485]  kasan_strings+0x340/0xb00
[   19.019917]  kunit_try_run_case+0x170/0x3f0
[   19.020263]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.020793]  kthread+0x328/0x630
[   19.021003]  ret_from_fork+0x10/0x20
[   19.021068] 
[   19.021093] Allocated by task 259:
[   19.021917]  kasan_save_stack+0x3c/0x68
[   19.022118]  kasan_save_track+0x20/0x40
[   19.022354]  kasan_save_alloc_info+0x40/0x58
[   19.022401]  __kasan_kmalloc+0xd4/0xd8
[   19.023321]  __kmalloc_cache_noprof+0x15c/0x3c0
[   19.023375]  kasan_strings+0xc8/0xb00
[   19.023482]  kunit_try_run_case+0x170/0x3f0
[   19.023616]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.023678]  kthread+0x328/0x630
[   19.023717]  ret_from_fork+0x10/0x20
[   19.023923] 
[   19.023990] Freed by task 259:
[   19.024139]  kasan_save_stack+0x3c/0x68
[   19.024429]  kasan_save_track+0x20/0x40
[   19.024486]  kasan_save_free_info+0x4c/0x78
[   19.024529]  __kasan_slab_free+0x6c/0x98
[   19.024577]  kfree+0x214/0x3c8
[   19.024615]  kasan_strings+0x24c/0xb00
[   19.024652]  kunit_try_run_case+0x170/0x3f0
[   19.024691]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.024735]  kthread+0x328/0x630
[   19.025322]  ret_from_fork+0x10/0x20
[   19.025389] 
[   19.025432] The buggy address belongs to the object at fff00000c78896c0
[   19.025432]  which belongs to the cache kmalloc-32 of size 32
[   19.025576] The buggy address is located 16 bytes inside of
[   19.025576]  freed 32-byte region [fff00000c78896c0, fff00000c78896e0)
[   19.025647] 
[   19.025671] The buggy address belongs to the physical page:
[   19.025704] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107889
[   19.025854] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.025987] page_type: f5(slab)
[   19.026074] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   19.026198] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   19.026243] page dumped because: kasan: bad access detected
[   19.026322] 
[   19.026348] Memory state around the buggy address:
[   19.026384]  fff00000c7889580: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.026429]  fff00000c7889600: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   19.026472] >fff00000c7889680: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   19.027036]                                                  ^
[   19.027272]  fff00000c7889700: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   19.027322]  fff00000c7889780: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   19.027373] ==================================================================

[   18.938032] ==================================================================
[   18.939466] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   18.939862] Read of size 1 at addr ffff888102327750 by task kunit_try_catch/276
[   18.940205] 
[   18.940738] CPU: 0 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250512 #1 PREEMPT(voluntary) 
[   18.940865] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.940894] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   18.940945] Call Trace:
[   18.940977]  <TASK>
[   18.941020]  dump_stack_lvl+0x73/0xb0
[   18.941672]  print_report+0xd1/0x650
[   18.941732]  ? __virt_addr_valid+0x1db/0x2d0
[   18.941762]  ? strcmp+0xb0/0xc0
[   18.941785]  ? kasan_complete_mode_report_info+0x64/0x200
[   18.941810]  ? strcmp+0xb0/0xc0
[   18.941833]  kasan_report+0x141/0x180
[   18.941856]  ? strcmp+0xb0/0xc0
[   18.941883]  __asan_report_load1_noabort+0x18/0x20
[   18.941905]  strcmp+0xb0/0xc0
[   18.941929]  kasan_strings+0x431/0xe80
[   18.941951]  ? trace_hardirqs_on+0x37/0xe0
[   18.941979]  ? __pfx_kasan_strings+0x10/0x10
[   18.942002]  ? finish_task_switch.isra.0+0x153/0x700
[   18.942029]  ? __switch_to+0x47/0xf50
[   18.942102]  ? __schedule+0x10cc/0x2b60
[   18.942147]  ? __pfx_read_tsc+0x10/0x10
[   18.942184]  ? ktime_get_ts64+0x86/0x230
[   18.942227]  kunit_try_run_case+0x1a5/0x480
[   18.942281]  ? __pfx_kunit_try_run_case+0x10/0x10
[   18.942311]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   18.942338]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   18.942363]  ? __kthread_parkme+0x82/0x180
[   18.942387]  ? preempt_count_sub+0x50/0x80
[   18.942412]  ? __pfx_kunit_try_run_case+0x10/0x10
[   18.942438]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.942464]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   18.942489]  kthread+0x337/0x6f0
[   18.942511]  ? trace_preempt_on+0x20/0xc0
[   18.942535]  ? __pfx_kthread+0x10/0x10
[   18.942558]  ? _raw_spin_unlock_irq+0x47/0x80
[   18.942580]  ? calculate_sigpending+0x7b/0xa0
[   18.942607]  ? __pfx_kthread+0x10/0x10
[   18.942630]  ret_from_fork+0x116/0x1d0
[   18.942650]  ? __pfx_kthread+0x10/0x10
[   18.942713]  ret_from_fork_asm+0x1a/0x30
[   18.942748]  </TASK>
[   18.942764] 
[   18.958927] Allocated by task 276:
[   18.959722]  kasan_save_stack+0x45/0x70
[   18.960252]  kasan_save_track+0x18/0x40
[   18.960391]  kasan_save_alloc_info+0x3b/0x50
[   18.960493]  __kasan_kmalloc+0xb7/0xc0
[   18.960585]  __kmalloc_cache_noprof+0x189/0x420
[   18.960732]  kasan_strings+0xc0/0xe80
[   18.960901]  kunit_try_run_case+0x1a5/0x480
[   18.961369]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.962149]  kthread+0x337/0x6f0
[   18.962510]  ret_from_fork+0x116/0x1d0
[   18.962985]  ret_from_fork_asm+0x1a/0x30
[   18.963714] 
[   18.963970] Freed by task 276:
[   18.964206]  kasan_save_stack+0x45/0x70
[   18.964408]  kasan_save_track+0x18/0x40
[   18.964901]  kasan_save_free_info+0x3f/0x60
[   18.965386]  __kasan_slab_free+0x56/0x70
[   18.966125]  kfree+0x222/0x3f0
[   18.966450]  kasan_strings+0x2aa/0xe80
[   18.967011]  kunit_try_run_case+0x1a5/0x480
[   18.967634]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.968192]  kthread+0x337/0x6f0
[   18.968825]  ret_from_fork+0x116/0x1d0
[   18.969275]  ret_from_fork_asm+0x1a/0x30
[   18.969723] 
[   18.969837] The buggy address belongs to the object at ffff888102327740
[   18.969837]  which belongs to the cache kmalloc-32 of size 32
[   18.971166] The buggy address is located 16 bytes inside of
[   18.971166]  freed 32-byte region [ffff888102327740, ffff888102327760)
[   18.972345] 
[   18.972430] The buggy address belongs to the physical page:
[   18.972555] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102327
[   18.972799] flags: 0x200000000000000(node=0|zone=2)
[   18.973274] page_type: f5(slab)
[   18.973594] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   18.974088] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   18.974383] page dumped because: kasan: bad access detected
[   18.975171] 
[   18.975644] Memory state around the buggy address:
[   18.975861]  ffff888102327600: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   18.976540]  ffff888102327680: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   18.977176] >ffff888102327700: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   18.978101]                                                  ^
[   18.978534]  ffff888102327780: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   18.979181]  ffff888102327800: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   18.979444] ==================================================================