Hay
Date
July 23, 2025, 2:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   17.723536] ==================================================================
[   17.723984] BUG: KASAN: slab-use-after-free in strlen+0xa8/0xb0
[   17.724066] Read of size 1 at addr fff00000c3f8c510 by task kunit_try_catch/259
[   17.724131] 
[   17.724178] CPU: 0 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7 #1 PREEMPT 
[   17.724265] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.724297] Hardware name: linux,dummy-virt (DT)
[   17.724331] Call trace:
[   17.724361]  show_stack+0x20/0x38 (C)
[   17.724415]  dump_stack_lvl+0x8c/0xd0
[   17.724464]  print_report+0x118/0x5d0
[   17.724514]  kasan_report+0xdc/0x128
[   17.724561]  __asan_report_load1_noabort+0x20/0x30
[   17.724616]  strlen+0xa8/0xb0
[   17.724658]  kasan_strings+0x418/0xb00
[   17.724711]  kunit_try_run_case+0x170/0x3f0
[   17.724770]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.724828]  kthread+0x328/0x630
[   17.725974]  ret_from_fork+0x10/0x20
[   17.726048] 
[   17.726076] Allocated by task 259:
[   17.726291]  kasan_save_stack+0x3c/0x68
[   17.726586]  kasan_save_track+0x20/0x40
[   17.726703]  kasan_save_alloc_info+0x40/0x58
[   17.726755]  __kasan_kmalloc+0xd4/0xd8
[   17.727079]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.727171]  kasan_strings+0xc8/0xb00
[   17.727267]  kunit_try_run_case+0x170/0x3f0
[   17.727333]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.727668]  kthread+0x328/0x630
[   17.727825]  ret_from_fork+0x10/0x20
[   17.727994] 
[   17.728028] Freed by task 259:
[   17.728058]  kasan_save_stack+0x3c/0x68
[   17.728128]  kasan_save_track+0x20/0x40
[   17.728490]  kasan_save_free_info+0x4c/0x78
[   17.728863]  __kasan_slab_free+0x6c/0x98
[   17.729010]  kfree+0x214/0x3c8
[   17.729104]  kasan_strings+0x24c/0xb00
[   17.729486]  kunit_try_run_case+0x170/0x3f0
[   17.729678]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.729788]  kthread+0x328/0x630
[   17.729928]  ret_from_fork+0x10/0x20
[   17.730078] 
[   17.730139] The buggy address belongs to the object at fff00000c3f8c500
[   17.730139]  which belongs to the cache kmalloc-32 of size 32
[   17.730366] The buggy address is located 16 bytes inside of
[   17.730366]  freed 32-byte region [fff00000c3f8c500, fff00000c3f8c520)
[   17.730604] 
[   17.730661] The buggy address belongs to the physical page:
[   17.730720] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103f8c
[   17.730781] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.731264] page_type: f5(slab)
[   17.731329] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   17.731442] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   17.731557] page dumped because: kasan: bad access detected
[   17.731804] 
[   17.731878] Memory state around the buggy address:
[   17.732091]  fff00000c3f8c400: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.732146]  fff00000c3f8c480: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   17.732258] >fff00000c3f8c500: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   17.732302]                          ^
[   17.732384]  fff00000c3f8c580: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.732694]  fff00000c3f8c600: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   17.733043] ==================================================================

[   14.530099] ==================================================================
[   14.530450] BUG: KASAN: slab-use-after-free in strlen+0x8f/0xb0
[   14.530709] Read of size 1 at addr ffff8881025e0a90 by task kunit_try_catch/276
[   14.531038] 
[   14.531493] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7 #1 PREEMPT(voluntary) 
[   14.531541] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.531554] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.531575] Call Trace:
[   14.531737]  <TASK>
[   14.531754]  dump_stack_lvl+0x73/0xb0
[   14.531783]  print_report+0xd1/0x610
[   14.531806]  ? __virt_addr_valid+0x1db/0x2d0
[   14.531841]  ? strlen+0x8f/0xb0
[   14.531858]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.531881]  ? strlen+0x8f/0xb0
[   14.531898]  kasan_report+0x141/0x180
[   14.531920]  ? strlen+0x8f/0xb0
[   14.531942]  __asan_report_load1_noabort+0x18/0x20
[   14.531966]  strlen+0x8f/0xb0
[   14.531984]  kasan_strings+0x57b/0xe80
[   14.532005]  ? trace_hardirqs_on+0x37/0xe0
[   14.532027]  ? __pfx_kasan_strings+0x10/0x10
[   14.532047]  ? finish_task_switch.isra.0+0x153/0x700
[   14.532069]  ? __switch_to+0x47/0xf50
[   14.532103]  ? __schedule+0x10c6/0x2b60
[   14.532125]  ? __pfx_read_tsc+0x10/0x10
[   14.532146]  ? ktime_get_ts64+0x86/0x230
[   14.532169]  kunit_try_run_case+0x1a5/0x480
[   14.532195]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.532220]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.532246]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.532269]  ? __kthread_parkme+0x82/0x180
[   14.532291]  ? preempt_count_sub+0x50/0x80
[   14.532313]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.532338]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.532361]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.532384]  kthread+0x337/0x6f0
[   14.532404]  ? trace_preempt_on+0x20/0xc0
[   14.532426]  ? __pfx_kthread+0x10/0x10
[   14.532448]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.532469]  ? calculate_sigpending+0x7b/0xa0
[   14.532492]  ? __pfx_kthread+0x10/0x10
[   14.532512]  ret_from_fork+0x116/0x1d0
[   14.532531]  ? __pfx_kthread+0x10/0x10
[   14.532551]  ret_from_fork_asm+0x1a/0x30
[   14.532580]  </TASK>
[   14.532591] 
[   14.541956] Allocated by task 276:
[   14.542095]  kasan_save_stack+0x45/0x70
[   14.542717]  kasan_save_track+0x18/0x40
[   14.542908]  kasan_save_alloc_info+0x3b/0x50
[   14.543130]  __kasan_kmalloc+0xb7/0xc0
[   14.543398]  __kmalloc_cache_noprof+0x189/0x420
[   14.543778]  kasan_strings+0xc0/0xe80
[   14.543932]  kunit_try_run_case+0x1a5/0x480
[   14.544261]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.544460]  kthread+0x337/0x6f0
[   14.544737]  ret_from_fork+0x116/0x1d0
[   14.544912]  ret_from_fork_asm+0x1a/0x30
[   14.545213] 
[   14.545311] Freed by task 276:
[   14.545647]  kasan_save_stack+0x45/0x70
[   14.545850]  kasan_save_track+0x18/0x40
[   14.546024]  kasan_save_free_info+0x3f/0x60
[   14.546441]  __kasan_slab_free+0x56/0x70
[   14.546625]  kfree+0x222/0x3f0
[   14.546899]  kasan_strings+0x2aa/0xe80
[   14.547056]  kunit_try_run_case+0x1a5/0x480
[   14.547296]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.547520]  kthread+0x337/0x6f0
[   14.547684]  ret_from_fork+0x116/0x1d0
[   14.547872]  ret_from_fork_asm+0x1a/0x30
[   14.548055] 
[   14.548137] The buggy address belongs to the object at ffff8881025e0a80
[   14.548137]  which belongs to the cache kmalloc-32 of size 32
[   14.548619] The buggy address is located 16 bytes inside of
[   14.548619]  freed 32-byte region [ffff8881025e0a80, ffff8881025e0aa0)
[   14.549620] 
[   14.549795] The buggy address belongs to the physical page:
[   14.550195] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1025e0
[   14.550580] flags: 0x200000000000000(node=0|zone=2)
[   14.550882] page_type: f5(slab)
[   14.551010] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.551623] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.551965] page dumped because: kasan: bad access detected
[   14.552219] 
[   14.552375] Memory state around the buggy address:
[   14.552690]  ffff8881025e0980: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.553026]  ffff8881025e0a00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.553544] >ffff8881025e0a80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.553896]                          ^
[   14.554082]  ffff8881025e0b00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.554640]  ffff8881025e0b80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.555378] ==================================================================