Hay
Date
July 24, 2025, 4:41 a.m.

Environment
qemu-arm64
qemu-x86_64

[   34.770724] ==================================================================
[   34.771205] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   34.771526] Read of size 1 at addr fff00000c9b90d10 by task kunit_try_catch/290
[   34.771642] 
[   34.771718] CPU: 1 UID: 0 PID: 290 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250724 #1 PREEMPT 
[   34.771874] Tainted: [B]=BAD_PAGE, [N]=TEST
[   34.771916] Hardware name: linux,dummy-virt (DT)
[   34.771952] Call trace:
[   34.771981]  show_stack+0x20/0x38 (C)
[   34.772141]  dump_stack_lvl+0x8c/0xd0
[   34.772271]  print_report+0x118/0x5e8
[   34.772326]  kasan_report+0xdc/0x128
[   34.772425]  __asan_report_load1_noabort+0x20/0x30
[   34.772521]  strcmp+0xc0/0xc8
[   34.772595]  kasan_strings+0x340/0xb00
[   34.772679]  kunit_try_run_case+0x170/0x3f0
[   34.772796]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.772880]  kthread+0x328/0x630
[   34.772924]  ret_from_fork+0x10/0x20
[   34.772976] 
[   34.772997] Allocated by task 290:
[   34.773055]  kasan_save_stack+0x3c/0x68
[   34.773196]  kasan_save_track+0x20/0x40
[   34.773309]  kasan_save_alloc_info+0x40/0x58
[   34.773360]  __kasan_kmalloc+0xd4/0xd8
[   34.773398]  __kmalloc_cache_noprof+0x16c/0x3c0
[   34.773684]  kasan_strings+0xc8/0xb00
[   34.773805]  kunit_try_run_case+0x170/0x3f0
[   34.773861]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.773963]  kthread+0x328/0x630
[   34.774033]  ret_from_fork+0x10/0x20
[   34.774133] 
[   34.774207] Freed by task 290:
[   34.774266]  kasan_save_stack+0x3c/0x68
[   34.774318]  kasan_save_track+0x20/0x40
[   34.774355]  kasan_save_free_info+0x4c/0x78
[   34.774586]  __kasan_slab_free+0x6c/0x98
[   34.774718]  kfree+0x214/0x3c8
[   34.774834]  kasan_strings+0x24c/0xb00
[   34.774937]  kunit_try_run_case+0x170/0x3f0
[   34.775083]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.775140]  kthread+0x328/0x630
[   34.775213]  ret_from_fork+0x10/0x20
[   34.775300] 
[   34.775336] The buggy address belongs to the object at fff00000c9b90d00
[   34.775336]  which belongs to the cache kmalloc-32 of size 32
[   34.775434] The buggy address is located 16 bytes inside of
[   34.775434]  freed 32-byte region [fff00000c9b90d00, fff00000c9b90d20)
[   34.775554] 
[   34.775624] The buggy address belongs to the physical page:
[   34.775690] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109b90
[   34.775760] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   34.775830] page_type: f5(slab)
[   34.775875] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   34.775929] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   34.775971] page dumped because: kasan: bad access detected
[   34.776032] 
[   34.776053] Memory state around the buggy address:
[   34.776208]  fff00000c9b90c00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   34.776259]  fff00000c9b90c80: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   34.776313] >fff00000c9b90d00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   34.776405]                          ^
[   34.776452]  fff00000c9b90d80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   34.776534]  fff00000c9b90e00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   34.776663] ==================================================================

[   28.821737] ==================================================================
[   28.822661] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   28.822910] Read of size 1 at addr ffff888106048f50 by task kunit_try_catch/307
[   28.823218] 
[   28.823310] CPU: 1 UID: 0 PID: 307 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250724 #1 PREEMPT(voluntary) 
[   28.823365] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   28.823377] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   28.823401] Call Trace:
[   28.823414]  <TASK>
[   28.823432]  dump_stack_lvl+0x73/0xb0
[   28.823460]  print_report+0xd1/0x640
[   28.823485]  ? __virt_addr_valid+0x1db/0x2d0
[   28.823510]  ? strcmp+0xb0/0xc0
[   28.823528]  ? kasan_complete_mode_report_info+0x64/0x200
[   28.823554]  ? strcmp+0xb0/0xc0
[   28.823585]  kasan_report+0x141/0x180
[   28.823607]  ? strcmp+0xb0/0xc0
[   28.823631]  __asan_report_load1_noabort+0x18/0x20
[   28.823655]  strcmp+0xb0/0xc0
[   28.823675]  kasan_strings+0x431/0xe80
[   28.823696]  ? trace_hardirqs_on+0x37/0xe0
[   28.823719]  ? __pfx_kasan_strings+0x10/0x10
[   28.823738]  ? finish_task_switch.isra.0+0x153/0x700
[   28.823761]  ? __switch_to+0x47/0xf80
[   28.823786]  ? __schedule+0x10da/0x2b60
[   28.823810]  ? __pfx_read_tsc+0x10/0x10
[   28.823832]  ? ktime_get_ts64+0x86/0x230
[   28.823856]  kunit_try_run_case+0x1a5/0x480
[   28.823881]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.823903]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   28.824276]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   28.824306]  ? __kthread_parkme+0x82/0x180
[   28.824328]  ? preempt_count_sub+0x50/0x80
[   28.824352]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.824377]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.824401]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   28.824425]  kthread+0x337/0x6f0
[   28.824444]  ? trace_preempt_on+0x20/0xc0
[   28.824467]  ? __pfx_kthread+0x10/0x10
[   28.824487]  ? _raw_spin_unlock_irq+0x47/0x80
[   28.824510]  ? calculate_sigpending+0x7b/0xa0
[   28.824534]  ? __pfx_kthread+0x10/0x10
[   28.824554]  ret_from_fork+0x116/0x1d0
[   28.824586]  ? __pfx_kthread+0x10/0x10
[   28.824607]  ret_from_fork_asm+0x1a/0x30
[   28.824640]  </TASK>
[   28.824651] 
[   28.835339] Allocated by task 307:
[   28.835509]  kasan_save_stack+0x45/0x70
[   28.835732]  kasan_save_track+0x18/0x40
[   28.835866]  kasan_save_alloc_info+0x3b/0x50
[   28.836029]  __kasan_kmalloc+0xb7/0xc0
[   28.836323]  __kmalloc_cache_noprof+0x189/0x420
[   28.836645]  kasan_strings+0xc0/0xe80
[   28.836810]  kunit_try_run_case+0x1a5/0x480
[   28.837045]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.837304]  kthread+0x337/0x6f0
[   28.837458]  ret_from_fork+0x116/0x1d0
[   28.837594]  ret_from_fork_asm+0x1a/0x30
[   28.837727] 
[   28.837791] Freed by task 307:
[   28.837894]  kasan_save_stack+0x45/0x70
[   28.838254]  kasan_save_track+0x18/0x40
[   28.838443]  kasan_save_free_info+0x3f/0x60
[   28.838658]  __kasan_slab_free+0x56/0x70
[   28.838934]  kfree+0x222/0x3f0
[   28.839090]  kasan_strings+0x2aa/0xe80
[   28.839279]  kunit_try_run_case+0x1a5/0x480
[   28.839430]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.839634]  kthread+0x337/0x6f0
[   28.839796]  ret_from_fork+0x116/0x1d0
[   28.840124]  ret_from_fork_asm+0x1a/0x30
[   28.840332] 
[   28.840414] The buggy address belongs to the object at ffff888106048f40
[   28.840414]  which belongs to the cache kmalloc-32 of size 32
[   28.841012] The buggy address is located 16 bytes inside of
[   28.841012]  freed 32-byte region [ffff888106048f40, ffff888106048f60)
[   28.841475] 
[   28.841551] The buggy address belongs to the physical page:
[   28.841780] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106048
[   28.842250] flags: 0x200000000000000(node=0|zone=2)
[   28.842417] page_type: f5(slab)
[   28.842537] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   28.842885] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   28.843223] page dumped because: kasan: bad access detected
[   28.843498] 
[   28.843560] Memory state around the buggy address:
[   28.843750]  ffff888106048e00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   28.844417]  ffff888106048e80: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   28.844776] >ffff888106048f00: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   28.845340]                                                  ^
[   28.845544]  ffff888106048f80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   28.845768]  ffff888106049000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   28.845993] ==================================================================