Hay
Date
July 1, 2025, 12:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   19.705981] ==================================================================
[   19.706036] BUG: KASAN: slab-use-after-free in strlen+0xa8/0xb0
[   19.706085] Read of size 1 at addr fff00000c79f3950 by task kunit_try_catch/259
[   19.706137] 
[   19.706168] CPU: 0 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   19.706261] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.706304] Hardware name: linux,dummy-virt (DT)
[   19.706337] Call trace:
[   19.706371]  show_stack+0x20/0x38 (C)
[   19.706425]  dump_stack_lvl+0x8c/0xd0
[   19.706880]  print_report+0x118/0x608
[   19.707347]  kasan_report+0xdc/0x128
[   19.707441]  __asan_report_load1_noabort+0x20/0x30
[   19.707529]  strlen+0xa8/0xb0
[   19.707786]  kasan_strings+0x418/0xb00
[   19.708062]  kunit_try_run_case+0x170/0x3f0
[   19.708300]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.708693]  kthread+0x328/0x630
[   19.709063]  ret_from_fork+0x10/0x20
[   19.709526] 
[   19.709591] Allocated by task 259:
[   19.709651]  kasan_save_stack+0x3c/0x68
[   19.709856]  kasan_save_track+0x20/0x40
[   19.710151]  kasan_save_alloc_info+0x40/0x58
[   19.710477]  __kasan_kmalloc+0xd4/0xd8
[   19.711244]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.711502]  kasan_strings+0xc8/0xb00
[   19.711803]  kunit_try_run_case+0x170/0x3f0
[   19.712155]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.712724]  kthread+0x328/0x630
[   19.712770]  ret_from_fork+0x10/0x20
[   19.712996] 
[   19.713093] Freed by task 259:
[   19.713745]  kasan_save_stack+0x3c/0x68
[   19.714176]  kasan_save_track+0x20/0x40
[   19.714428]  kasan_save_free_info+0x4c/0x78
[   19.714508]  __kasan_slab_free+0x6c/0x98
[   19.714680]  kfree+0x214/0x3c8
[   19.714815]  kasan_strings+0x24c/0xb00
[   19.715093]  kunit_try_run_case+0x170/0x3f0
[   19.715150]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.715197]  kthread+0x328/0x630
[   19.715238]  ret_from_fork+0x10/0x20
[   19.715487] 
[   19.715624] The buggy address belongs to the object at fff00000c79f3940
[   19.715624]  which belongs to the cache kmalloc-32 of size 32
[   19.716021] The buggy address is located 16 bytes inside of
[   19.716021]  freed 32-byte region [fff00000c79f3940, fff00000c79f3960)
[   19.716302] 
[   19.716431] The buggy address belongs to the physical page:
[   19.716797] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1079f3
[   19.717014] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.717123] page_type: f5(slab)
[   19.717167] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   19.717438] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   19.717610] page dumped because: kasan: bad access detected
[   19.717712] 
[   19.718180] Memory state around the buggy address:
[   19.718422]  fff00000c79f3800: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.718511]  fff00000c79f3880: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   19.718648] >fff00000c79f3900: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   19.718759]                                                  ^
[   19.718861]  fff00000c79f3980: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   19.719020]  fff00000c79f3a00: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   19.719086] ==================================================================

[   13.378275] ==================================================================
[   13.378575] BUG: KASAN: slab-use-after-free in strlen+0x8f/0xb0
[   13.378800] Read of size 1 at addr ffff888103124410 by task kunit_try_catch/276
[   13.379231] 
[   13.379341] CPU: 0 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.379381] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.379393] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.379414] Call Trace:
[   13.379427]  <TASK>
[   13.379442]  dump_stack_lvl+0x73/0xb0
[   13.379467]  print_report+0xd1/0x650
[   13.379489]  ? __virt_addr_valid+0x1db/0x2d0
[   13.379510]  ? strlen+0x8f/0xb0
[   13.379526]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.379548]  ? strlen+0x8f/0xb0
[   13.379565]  kasan_report+0x141/0x180
[   13.379585]  ? strlen+0x8f/0xb0
[   13.379606]  __asan_report_load1_noabort+0x18/0x20
[   13.379630]  strlen+0x8f/0xb0
[   13.379647]  kasan_strings+0x57b/0xe80
[   13.379666]  ? trace_hardirqs_on+0x37/0xe0
[   13.379687]  ? __pfx_kasan_strings+0x10/0x10
[   13.379707]  ? finish_task_switch.isra.0+0x153/0x700
[   13.379727]  ? __switch_to+0x47/0xf50
[   13.379751]  ? __schedule+0x10cc/0x2b60
[   13.379772]  ? __pfx_read_tsc+0x10/0x10
[   13.379792]  ? ktime_get_ts64+0x86/0x230
[   13.379815]  kunit_try_run_case+0x1a5/0x480
[   13.379837]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.379859]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.379880]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.379902]  ? __kthread_parkme+0x82/0x180
[   13.379921]  ? preempt_count_sub+0x50/0x80
[   13.379942]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.379965]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.379987]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.380010]  kthread+0x337/0x6f0
[   13.380040]  ? trace_preempt_on+0x20/0xc0
[   13.380061]  ? __pfx_kthread+0x10/0x10
[   13.380080]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.380099]  ? calculate_sigpending+0x7b/0xa0
[   13.380121]  ? __pfx_kthread+0x10/0x10
[   13.380141]  ret_from_fork+0x116/0x1d0
[   13.380158]  ? __pfx_kthread+0x10/0x10
[   13.380179]  ret_from_fork_asm+0x1a/0x30
[   13.380208]  </TASK>
[   13.380218] 
[   13.387352] Allocated by task 276:
[   13.387632]  kasan_save_stack+0x45/0x70
[   13.387771]  kasan_save_track+0x18/0x40
[   13.387905]  kasan_save_alloc_info+0x3b/0x50
[   13.388132]  __kasan_kmalloc+0xb7/0xc0
[   13.388331]  __kmalloc_cache_noprof+0x189/0x420
[   13.388562]  kasan_strings+0xc0/0xe80
[   13.388744]  kunit_try_run_case+0x1a5/0x480
[   13.388928]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.389111]  kthread+0x337/0x6f0
[   13.389359]  ret_from_fork+0x116/0x1d0
[   13.389544]  ret_from_fork_asm+0x1a/0x30
[   13.389740] 
[   13.389829] Freed by task 276:
[   13.389936]  kasan_save_stack+0x45/0x70
[   13.390135]  kasan_save_track+0x18/0x40
[   13.390325]  kasan_save_free_info+0x3f/0x60
[   13.390511]  __kasan_slab_free+0x56/0x70
[   13.390667]  kfree+0x222/0x3f0
[   13.390782]  kasan_strings+0x2aa/0xe80
[   13.390912]  kunit_try_run_case+0x1a5/0x480
[   13.391068]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.391241]  kthread+0x337/0x6f0
[   13.391359]  ret_from_fork+0x116/0x1d0
[   13.391488]  ret_from_fork_asm+0x1a/0x30
[   13.391624] 
[   13.391693] The buggy address belongs to the object at ffff888103124400
[   13.391693]  which belongs to the cache kmalloc-32 of size 32
[   13.392228] The buggy address is located 16 bytes inside of
[   13.392228]  freed 32-byte region [ffff888103124400, ffff888103124420)
[   13.392738] 
[   13.392830] The buggy address belongs to the physical page:
[   13.393087] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103124
[   13.393444] flags: 0x200000000000000(node=0|zone=2)
[   13.393609] page_type: f5(slab)
[   13.393729] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.393957] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.394191] page dumped because: kasan: bad access detected
[   13.394361] 
[   13.394430] Memory state around the buggy address:
[   13.394583]  ffff888103124300: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.394912]  ffff888103124380: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.395324] >ffff888103124400: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.395638]                          ^
[   13.395827]  ffff888103124480: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.396179]  ffff888103124500: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.396504] ==================================================================