Hay
Date
July 15, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   17.763234] ==================================================================
[   17.763290] BUG: KASAN: slab-use-after-free in strlen+0xa8/0xb0
[   17.763341] Read of size 1 at addr fff00000c5977b10 by task kunit_try_catch/260
[   17.763395] 
[   17.763425] CPU: 1 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   17.763509] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.764771] Hardware name: linux,dummy-virt (DT)
[   17.764829] Call trace:
[   17.764862]  show_stack+0x20/0x38 (C)
[   17.765249]  dump_stack_lvl+0x8c/0xd0
[   17.765304]  print_report+0x118/0x5d0
[   17.765357]  kasan_report+0xdc/0x128
[   17.765451]  __asan_report_load1_noabort+0x20/0x30
[   17.765507]  strlen+0xa8/0xb0
[   17.765549]  kasan_strings+0x418/0xb00
[   17.765596]  kunit_try_run_case+0x170/0x3f0
[   17.765645]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.765702]  kthread+0x328/0x630
[   17.765745]  ret_from_fork+0x10/0x20
[   17.765794] 
[   17.765816] Allocated by task 260:
[   17.765846]  kasan_save_stack+0x3c/0x68
[   17.765888]  kasan_save_track+0x20/0x40
[   17.765926]  kasan_save_alloc_info+0x40/0x58
[   17.765968]  __kasan_kmalloc+0xd4/0xd8
[   17.766004]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.766043]  kasan_strings+0xc8/0xb00
[   17.766081]  kunit_try_run_case+0x170/0x3f0
[   17.766120]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.766164]  kthread+0x328/0x630
[   17.766209]  ret_from_fork+0x10/0x20
[   17.766246] 
[   17.766265] Freed by task 260:
[   17.766295]  kasan_save_stack+0x3c/0x68
[   17.766336]  kasan_save_track+0x20/0x40
[   17.766389]  kasan_save_free_info+0x4c/0x78
[   17.766433]  __kasan_slab_free+0x6c/0x98
[   17.766471]  kfree+0x214/0x3c8
[   17.766506]  kasan_strings+0x24c/0xb00
[   17.766542]  kunit_try_run_case+0x170/0x3f0
[   17.766582]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.766628]  kthread+0x328/0x630
[   17.766660]  ret_from_fork+0x10/0x20
[   17.766788] 
[   17.766838] The buggy address belongs to the object at fff00000c5977b00
[   17.766838]  which belongs to the cache kmalloc-32 of size 32
[   17.767011] The buggy address is located 16 bytes inside of
[   17.767011]  freed 32-byte region [fff00000c5977b00, fff00000c5977b20)
[   17.767131] 
[   17.767416] The buggy address belongs to the physical page:
[   17.767662] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105977
[   17.767844] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.768037] page_type: f5(slab)
[   17.768092] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   17.768146] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   17.768202] page dumped because: kasan: bad access detected
[   17.768731] 
[   17.768755] Memory state around the buggy address:
[   17.768791]  fff00000c5977a00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.769905]  fff00000c5977a80: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.770093] >fff00000c5977b00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   17.770138]                          ^
[   17.770423]  fff00000c5977b80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.770697]  fff00000c5977c00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   17.770742] ==================================================================

[   14.489274] ==================================================================
[   14.489531] BUG: KASAN: slab-use-after-free in strlen+0x8f/0xb0
[   14.489789] Read of size 1 at addr ffff8881038e8050 by task kunit_try_catch/276
[   14.490234] 
[   14.490365] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   14.490413] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.490425] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.490581] Call Trace:
[   14.490602]  <TASK>
[   14.490615]  dump_stack_lvl+0x73/0xb0
[   14.490645]  print_report+0xd1/0x610
[   14.490669]  ? __virt_addr_valid+0x1db/0x2d0
[   14.490692]  ? strlen+0x8f/0xb0
[   14.490708]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.490733]  ? strlen+0x8f/0xb0
[   14.490750]  kasan_report+0x141/0x180
[   14.490787]  ? strlen+0x8f/0xb0
[   14.490809]  __asan_report_load1_noabort+0x18/0x20
[   14.490834]  strlen+0x8f/0xb0
[   14.490852]  kasan_strings+0x57b/0xe80
[   14.490872]  ? trace_hardirqs_on+0x37/0xe0
[   14.490896]  ? __pfx_kasan_strings+0x10/0x10
[   14.490917]  ? finish_task_switch.isra.0+0x153/0x700
[   14.490940]  ? __switch_to+0x47/0xf50
[   14.490966]  ? __schedule+0x10cc/0x2b60
[   14.490989]  ? __pfx_read_tsc+0x10/0x10
[   14.491010]  ? ktime_get_ts64+0x86/0x230
[   14.491034]  kunit_try_run_case+0x1a5/0x480
[   14.491059]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.491084]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.491109]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.491133]  ? __kthread_parkme+0x82/0x180
[   14.491154]  ? preempt_count_sub+0x50/0x80
[   14.491178]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.491203]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.491228]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.491254]  kthread+0x337/0x6f0
[   14.491274]  ? trace_preempt_on+0x20/0xc0
[   14.491297]  ? __pfx_kthread+0x10/0x10
[   14.491319]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.491341]  ? calculate_sigpending+0x7b/0xa0
[   14.491422]  ? __pfx_kthread+0x10/0x10
[   14.491452]  ret_from_fork+0x116/0x1d0
[   14.491471]  ? __pfx_kthread+0x10/0x10
[   14.491493]  ret_from_fork_asm+0x1a/0x30
[   14.491523]  </TASK>
[   14.491533] 
[   14.499230] Allocated by task 276:
[   14.499379]  kasan_save_stack+0x45/0x70
[   14.499522]  kasan_save_track+0x18/0x40
[   14.499715]  kasan_save_alloc_info+0x3b/0x50
[   14.500074]  __kasan_kmalloc+0xb7/0xc0
[   14.500293]  __kmalloc_cache_noprof+0x189/0x420
[   14.500599]  kasan_strings+0xc0/0xe80
[   14.500810]  kunit_try_run_case+0x1a5/0x480
[   14.501024]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.501269]  kthread+0x337/0x6f0
[   14.501494]  ret_from_fork+0x116/0x1d0
[   14.501659]  ret_from_fork_asm+0x1a/0x30
[   14.501851] 
[   14.501944] Freed by task 276:
[   14.502091]  kasan_save_stack+0x45/0x70
[   14.502260]  kasan_save_track+0x18/0x40
[   14.502405]  kasan_save_free_info+0x3f/0x60
[   14.502552]  __kasan_slab_free+0x56/0x70
[   14.502691]  kfree+0x222/0x3f0
[   14.502839]  kasan_strings+0x2aa/0xe80
[   14.503026]  kunit_try_run_case+0x1a5/0x480
[   14.503230]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.503849]  kthread+0x337/0x6f0
[   14.504104]  ret_from_fork+0x116/0x1d0
[   14.504238]  ret_from_fork_asm+0x1a/0x30
[   14.504375] 
[   14.504446] The buggy address belongs to the object at ffff8881038e8040
[   14.504446]  which belongs to the cache kmalloc-32 of size 32
[   14.505476] The buggy address is located 16 bytes inside of
[   14.505476]  freed 32-byte region [ffff8881038e8040, ffff8881038e8060)
[   14.505954] 
[   14.506057] The buggy address belongs to the physical page:
[   14.506233] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1038e8
[   14.506885] flags: 0x200000000000000(node=0|zone=2)
[   14.507130] page_type: f5(slab)
[   14.507283] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.507673] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.507996] page dumped because: kasan: bad access detected
[   14.508225] 
[   14.508298] Memory state around the buggy address:
[   14.508533]  ffff8881038e7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.508809]  ffff8881038e7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.509111] >ffff8881038e8000: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.509329]                                                  ^
[   14.509547]  ffff8881038e8080: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.509877]  ffff8881038e8100: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.510164] ==================================================================