Hay
Date
July 9, 2025, 2:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.486907] ==================================================================
[   19.486964] BUG: KASAN: slab-use-after-free in strlen+0xa8/0xb0
[   19.487838] Read of size 1 at addr fff00000c7753290 by task kunit_try_catch/259
[   19.487917] 
[   19.488078] CPU: 1 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc5 #1 PREEMPT 
[   19.488290] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   19.488327] Hardware name: linux,dummy-virt (DT)
[   19.488556] Call trace:
[   19.488735]  show_stack+0x20/0x38 (C)
[   19.488905]  dump_stack_lvl+0x8c/0xd0
[   19.488989]  print_report+0x118/0x608
[   19.489042]  kasan_report+0xdc/0x128
[   19.489173]  __asan_report_load1_noabort+0x20/0x30
[   19.489231]  strlen+0xa8/0xb0
[   19.489294]  kasan_strings+0x418/0xb00
[   19.489484]  kunit_try_run_case+0x170/0x3f0
[   19.489553]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.489847]  kthread+0x328/0x630
[   19.490045]  ret_from_fork+0x10/0x20
[   19.490164] 
[   19.490186] Allocated by task 259:
[   19.490218]  kasan_save_stack+0x3c/0x68
[   19.490261]  kasan_save_track+0x20/0x40
[   19.490568]  kasan_save_alloc_info+0x40/0x58
[   19.490749]  __kasan_kmalloc+0xd4/0xd8
[   19.490818]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.491028]  kasan_strings+0xc8/0xb00
[   19.491248]  kunit_try_run_case+0x170/0x3f0
[   19.491374]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.491529]  kthread+0x328/0x630
[   19.491792]  ret_from_fork+0x10/0x20
[   19.491921] 
[   19.492061] Freed by task 259:
[   19.492224]  kasan_save_stack+0x3c/0x68
[   19.492302]  kasan_save_track+0x20/0x40
[   19.492365]  kasan_save_free_info+0x4c/0x78
[   19.492673]  __kasan_slab_free+0x6c/0x98
[   19.492719]  kfree+0x214/0x3c8
[   19.493058]  kasan_strings+0x24c/0xb00
[   19.493219]  kunit_try_run_case+0x170/0x3f0
[   19.493310]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.493462]  kthread+0x328/0x630
[   19.493540]  ret_from_fork+0x10/0x20
[   19.493976] 
[   19.494028] The buggy address belongs to the object at fff00000c7753280
[   19.494028]  which belongs to the cache kmalloc-32 of size 32
[   19.494708] The buggy address is located 16 bytes inside of
[   19.494708]  freed 32-byte region [fff00000c7753280, fff00000c77532a0)
[   19.494818] 
[   19.494862] The buggy address belongs to the physical page:
[   19.494929] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107753
[   19.495421] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.495538] page_type: f5(slab)
[   19.495671] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   19.495753] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   19.495867] page dumped because: kasan: bad access detected
[   19.495938] 
[   19.495959] Memory state around the buggy address:
[   19.496200]  fff00000c7753180: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.496386]  fff00000c7753200: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.497378] >fff00000c7753280: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   19.497445]                          ^
[   19.497612]  fff00000c7753300: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.498275]  fff00000c7753380: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   19.498330] ==================================================================

[   14.699195] ==================================================================
[   14.699617] BUG: KASAN: slab-use-after-free in strlen+0x8f/0xb0
[   14.699869] Read of size 1 at addr ffff8881029cc7d0 by task kunit_try_catch/276
[   14.700108] 
[   14.700223] CPU: 0 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   14.700266] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.700278] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.700298] Call Trace:
[   14.700316]  <TASK>
[   14.700334]  dump_stack_lvl+0x73/0xb0
[   14.700360]  print_report+0xd1/0x650
[   14.700381]  ? __virt_addr_valid+0x1db/0x2d0
[   14.700402]  ? strlen+0x8f/0xb0
[   14.700418]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.700439]  ? strlen+0x8f/0xb0
[   14.700456]  kasan_report+0x141/0x180
[   14.700477]  ? strlen+0x8f/0xb0
[   14.700497]  __asan_report_load1_noabort+0x18/0x20
[   14.700520]  strlen+0x8f/0xb0
[   14.700537]  kasan_strings+0x57b/0xe80
[   14.700556]  ? trace_hardirqs_on+0x37/0xe0
[   14.700578]  ? __pfx_kasan_strings+0x10/0x10
[   14.700951]  ? finish_task_switch.isra.0+0x153/0x700
[   14.700983]  ? __switch_to+0x47/0xf50
[   14.701010]  ? __schedule+0x10cc/0x2b60
[   14.701032]  ? __pfx_read_tsc+0x10/0x10
[   14.701054]  ? ktime_get_ts64+0x86/0x230
[   14.701078]  kunit_try_run_case+0x1a5/0x480
[   14.701102]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.701125]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.701149]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.701183]  ? __kthread_parkme+0x82/0x180
[   14.701203]  ? preempt_count_sub+0x50/0x80
[   14.701225]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.701261]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.701285]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.701310]  kthread+0x337/0x6f0
[   14.701329]  ? trace_preempt_on+0x20/0xc0
[   14.701351]  ? __pfx_kthread+0x10/0x10
[   14.701372]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.701393]  ? calculate_sigpending+0x7b/0xa0
[   14.701418]  ? __pfx_kthread+0x10/0x10
[   14.701439]  ret_from_fork+0x116/0x1d0
[   14.701457]  ? __pfx_kthread+0x10/0x10
[   14.701477]  ret_from_fork_asm+0x1a/0x30
[   14.701508]  </TASK>
[   14.701518] 
[   14.708878] Allocated by task 276:
[   14.709095]  kasan_save_stack+0x45/0x70
[   14.709330]  kasan_save_track+0x18/0x40
[   14.709518]  kasan_save_alloc_info+0x3b/0x50
[   14.709709]  __kasan_kmalloc+0xb7/0xc0
[   14.709948]  __kmalloc_cache_noprof+0x189/0x420
[   14.710173]  kasan_strings+0xc0/0xe80
[   14.710359]  kunit_try_run_case+0x1a5/0x480
[   14.710572]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.710871]  kthread+0x337/0x6f0
[   14.711050]  ret_from_fork+0x116/0x1d0
[   14.711236]  ret_from_fork_asm+0x1a/0x30
[   14.711405] 
[   14.711516] Freed by task 276:
[   14.711673]  kasan_save_stack+0x45/0x70
[   14.711897]  kasan_save_track+0x18/0x40
[   14.712081]  kasan_save_free_info+0x3f/0x60
[   14.712246]  __kasan_slab_free+0x56/0x70
[   14.712441]  kfree+0x222/0x3f0
[   14.712616]  kasan_strings+0x2aa/0xe80
[   14.712798]  kunit_try_run_case+0x1a5/0x480
[   14.712943]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.713118]  kthread+0x337/0x6f0
[   14.713239]  ret_from_fork+0x116/0x1d0
[   14.713370]  ret_from_fork_asm+0x1a/0x30
[   14.713577] 
[   14.713686] The buggy address belongs to the object at ffff8881029cc7c0
[   14.713686]  which belongs to the cache kmalloc-32 of size 32
[   14.714240] The buggy address is located 16 bytes inside of
[   14.714240]  freed 32-byte region [ffff8881029cc7c0, ffff8881029cc7e0)
[   14.714793] 
[   14.714911] The buggy address belongs to the physical page:
[   14.715152] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1029cc
[   14.715394] flags: 0x200000000000000(node=0|zone=2)
[   14.715558] page_type: f5(slab)
[   14.715688] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.715947] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.716314] page dumped because: kasan: bad access detected
[   14.716602] 
[   14.716700] Memory state around the buggy address:
[   14.716987]  ffff8881029cc680: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.717329]  ffff8881029cc700: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   14.717659] >ffff8881029cc780: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.718008]                                                  ^
[   14.718275]  ffff8881029cc800: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.718577]  ffff8881029cc880: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.718879] ==================================================================