Hay
Date
July 1, 2025, 11:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   21.091761] ==================================================================
[   21.091841] BUG: KASAN: slab-use-after-free in strlen+0xa8/0xb0
[   21.091905] Read of size 1 at addr fff00000c76d9210 by task kunit_try_catch/260
[   21.091964] 
[   21.092306] CPU: 0 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   21.092821] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.092889] Hardware name: linux,dummy-virt (DT)
[   21.092928] Call trace:
[   21.093032]  show_stack+0x20/0x38 (C)
[   21.093122]  dump_stack_lvl+0x8c/0xd0
[   21.093332]  print_report+0x118/0x608
[   21.093423]  kasan_report+0xdc/0x128
[   21.093726]  __asan_report_load1_noabort+0x20/0x30
[   21.093901]  strlen+0xa8/0xb0
[   21.094044]  kasan_strings+0x418/0xb00
[   21.094125]  kunit_try_run_case+0x170/0x3f0
[   21.094264]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.094343]  kthread+0x328/0x630
[   21.094393]  ret_from_fork+0x10/0x20
[   21.094478] 
[   21.094804] Allocated by task 260:
[   21.094884]  kasan_save_stack+0x3c/0x68
[   21.094942]  kasan_save_track+0x20/0x40
[   21.095077]  kasan_save_alloc_info+0x40/0x58
[   21.095287]  __kasan_kmalloc+0xd4/0xd8
[   21.095370]  __kmalloc_cache_noprof+0x16c/0x3c0
[   21.095424]  kasan_strings+0xc8/0xb00
[   21.095706]  kunit_try_run_case+0x170/0x3f0
[   21.095872]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.095962]  kthread+0x328/0x630
[   21.096097]  ret_from_fork+0x10/0x20
[   21.096217] 
[   21.096393] Freed by task 260:
[   21.096647]  kasan_save_stack+0x3c/0x68
[   21.096726]  kasan_save_track+0x20/0x40
[   21.096883]  kasan_save_free_info+0x4c/0x78
[   21.097020]  __kasan_slab_free+0x6c/0x98
[   21.097116]  kfree+0x214/0x3c8
[   21.097244]  kasan_strings+0x24c/0xb00
[   21.097291]  kunit_try_run_case+0x170/0x3f0
[   21.097352]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.097408]  kthread+0x328/0x630
[   21.097581]  ret_from_fork+0x10/0x20
[   21.097761] 
[   21.097789] The buggy address belongs to the object at fff00000c76d9200
[   21.097789]  which belongs to the cache kmalloc-32 of size 32
[   21.097865] The buggy address is located 16 bytes inside of
[   21.097865]  freed 32-byte region [fff00000c76d9200, fff00000c76d9220)
[   21.098043] 
[   21.098082] The buggy address belongs to the physical page:
[   21.098122] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1076d9
[   21.098211] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   21.098285] page_type: f5(slab)
[   21.098333] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   21.098404] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   21.098469] page dumped because: kasan: bad access detected
[   21.098509] 
[   21.098531] Memory state around the buggy address:
[   21.098572]  fff00000c76d9100: 00 00 00 fc fc fc fc fc 00 00 00 04 fc fc fc fc
[   21.098634]  fff00000c76d9180: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   21.098687] >fff00000c76d9200: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   21.098736]                          ^
[   21.098783]  fff00000c76d9280: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   21.098844]  fff00000c76d9300: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   21.098906] ==================================================================

[   13.470427] ==================================================================
[   13.471219] BUG: KASAN: slab-use-after-free in strlen+0x8f/0xb0
[   13.471497] Read of size 1 at addr ffff888103aaf390 by task kunit_try_catch/276
[   13.471801] 
[   13.471897] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.471944] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.471956] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.471978] Call Trace:
[   13.471997]  <TASK>
[   13.472017]  dump_stack_lvl+0x73/0xb0
[   13.472045]  print_report+0xd1/0x650
[   13.472069]  ? __virt_addr_valid+0x1db/0x2d0
[   13.472092]  ? strlen+0x8f/0xb0
[   13.472108]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.472130]  ? strlen+0x8f/0xb0
[   13.472147]  kasan_report+0x141/0x180
[   13.472168]  ? strlen+0x8f/0xb0
[   13.472188]  __asan_report_load1_noabort+0x18/0x20
[   13.472212]  strlen+0x8f/0xb0
[   13.472229]  kasan_strings+0x57b/0xe80
[   13.472248]  ? trace_hardirqs_on+0x37/0xe0
[   13.472271]  ? __pfx_kasan_strings+0x10/0x10
[   13.472289]  ? finish_task_switch.isra.0+0x153/0x700
[   13.472312]  ? __switch_to+0x47/0xf50
[   13.472337]  ? __schedule+0x10cc/0x2b60
[   13.472360]  ? __pfx_read_tsc+0x10/0x10
[   13.472391]  ? ktime_get_ts64+0x86/0x230
[   13.472419]  kunit_try_run_case+0x1a5/0x480
[   13.472443]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.472465]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.472489]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.472511]  ? __kthread_parkme+0x82/0x180
[   13.472531]  ? preempt_count_sub+0x50/0x80
[   13.472554]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.472589]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.472612]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.472635]  kthread+0x337/0x6f0
[   13.472654]  ? trace_preempt_on+0x20/0xc0
[   13.472675]  ? __pfx_kthread+0x10/0x10
[   13.472695]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.472715]  ? calculate_sigpending+0x7b/0xa0
[   13.472738]  ? __pfx_kthread+0x10/0x10
[   13.472759]  ret_from_fork+0x116/0x1d0
[   13.472777]  ? __pfx_kthread+0x10/0x10
[   13.472796]  ret_from_fork_asm+0x1a/0x30
[   13.472825]  </TASK>
[   13.472836] 
[   13.479810] Allocated by task 276:
[   13.479971]  kasan_save_stack+0x45/0x70
[   13.480166]  kasan_save_track+0x18/0x40
[   13.480352]  kasan_save_alloc_info+0x3b/0x50
[   13.480571]  __kasan_kmalloc+0xb7/0xc0
[   13.480753]  __kmalloc_cache_noprof+0x189/0x420
[   13.480970]  kasan_strings+0xc0/0xe80
[   13.481135]  kunit_try_run_case+0x1a5/0x480
[   13.481278]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.481494]  kthread+0x337/0x6f0
[   13.481821]  ret_from_fork+0x116/0x1d0
[   13.482002]  ret_from_fork_asm+0x1a/0x30
[   13.482194] 
[   13.482287] Freed by task 276:
[   13.482422]  kasan_save_stack+0x45/0x70
[   13.482559]  kasan_save_track+0x18/0x40
[   13.482757]  kasan_save_free_info+0x3f/0x60
[   13.482955]  __kasan_slab_free+0x56/0x70
[   13.483133]  kfree+0x222/0x3f0
[   13.483273]  kasan_strings+0x2aa/0xe80
[   13.483443]  kunit_try_run_case+0x1a5/0x480
[   13.483656]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.483828]  kthread+0x337/0x6f0
[   13.483985]  ret_from_fork+0x116/0x1d0
[   13.484171]  ret_from_fork_asm+0x1a/0x30
[   13.484363] 
[   13.484471] The buggy address belongs to the object at ffff888103aaf380
[   13.484471]  which belongs to the cache kmalloc-32 of size 32
[   13.484984] The buggy address is located 16 bytes inside of
[   13.484984]  freed 32-byte region [ffff888103aaf380, ffff888103aaf3a0)
[   13.485415] 
[   13.485517] The buggy address belongs to the physical page:
[   13.485795] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103aaf
[   13.486127] flags: 0x200000000000000(node=0|zone=2)
[   13.486311] page_type: f5(slab)
[   13.486476] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.486885] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.487166] page dumped because: kasan: bad access detected
[   13.487426] 
[   13.487511] Memory state around the buggy address:
[   13.487750]  ffff888103aaf280: fa fb fb fb fc fc fc fc 00 00 07 fc fc fc fc fc
[   13.488042]  ffff888103aaf300: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.488332] >ffff888103aaf380: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.488589]                          ^
[   13.488771]  ffff888103aaf400: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.489025]  ffff888103aaf480: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.489317] ==================================================================