Hay
Date
July 16, 2025, 12:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   32.995693] ==================================================================
[   32.996124] BUG: KASAN: slab-use-after-free in strlen+0xa8/0xb0
[   32.996189] Read of size 1 at addr fff00000c9bb4890 by task kunit_try_catch/290
[   32.996422] 
[   32.996649] CPU: 0 UID: 0 PID: 290 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT 
[   32.996860] Tainted: [B]=BAD_PAGE, [N]=TEST
[   32.997015] Hardware name: linux,dummy-virt (DT)
[   32.997094] Call trace:
[   32.997365]  show_stack+0x20/0x38 (C)
[   32.997690]  dump_stack_lvl+0x8c/0xd0
[   32.997865]  print_report+0x118/0x5d0
[   32.997995]  kasan_report+0xdc/0x128
[   32.998296]  __asan_report_load1_noabort+0x20/0x30
[   32.998540]  strlen+0xa8/0xb0
[   32.998631]  kasan_strings+0x418/0xb00
[   32.998821]  kunit_try_run_case+0x170/0x3f0
[   32.999051]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.999151]  kthread+0x328/0x630
[   32.999277]  ret_from_fork+0x10/0x20
[   32.999586] 
[   32.999663] Allocated by task 290:
[   32.999960]  kasan_save_stack+0x3c/0x68
[   33.000063]  kasan_save_track+0x20/0x40
[   33.000108]  kasan_save_alloc_info+0x40/0x58
[   33.000151]  __kasan_kmalloc+0xd4/0xd8
[   33.000190]  __kmalloc_cache_noprof+0x16c/0x3c0
[   33.000693]  kasan_strings+0xc8/0xb00
[   33.000755]  kunit_try_run_case+0x170/0x3f0
[   33.000926]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.001148]  kthread+0x328/0x630
[   33.001230]  ret_from_fork+0x10/0x20
[   33.001403] 
[   33.001429] Freed by task 290:
[   33.001680]  kasan_save_stack+0x3c/0x68
[   33.001840]  kasan_save_track+0x20/0x40
[   33.002062]  kasan_save_free_info+0x4c/0x78
[   33.002306]  __kasan_slab_free+0x6c/0x98
[   33.002419]  kfree+0x214/0x3c8
[   33.002719]  kasan_strings+0x24c/0xb00
[   33.002876]  kunit_try_run_case+0x170/0x3f0
[   33.003104]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.003366]  kthread+0x328/0x630
[   33.003451]  ret_from_fork+0x10/0x20
[   33.003702] 
[   33.003882] The buggy address belongs to the object at fff00000c9bb4880
[   33.003882]  which belongs to the cache kmalloc-32 of size 32
[   33.004081] The buggy address is located 16 bytes inside of
[   33.004081]  freed 32-byte region [fff00000c9bb4880, fff00000c9bb48a0)
[   33.004162] 
[   33.004236] The buggy address belongs to the physical page:
[   33.004272] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109bb4
[   33.004330] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   33.004643] page_type: f5(slab)
[   33.004706] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   33.004761] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   33.004807] page dumped because: kasan: bad access detected
[   33.004843] 
[   33.004863] Memory state around the buggy address:
[   33.004916]  fff00000c9bb4780: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   33.004979]  fff00000c9bb4800: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   33.005027] >fff00000c9bb4880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   33.005068]                          ^
[   33.005100]  fff00000c9bb4900: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   33.005175]  fff00000c9bb4980: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   33.005218] ==================================================================

[   25.277458] ==================================================================
[   25.277707] BUG: KASAN: slab-use-after-free in strlen+0x8f/0xb0
[   25.278188] Read of size 1 at addr ffff8881053b8d50 by task kunit_try_catch/308
[   25.278872] 
[   25.279116] CPU: 0 UID: 0 PID: 308 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT(voluntary) 
[   25.279182] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.279195] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.279217] Call Trace:
[   25.279246]  <TASK>
[   25.279264]  dump_stack_lvl+0x73/0xb0
[   25.279312]  print_report+0xd1/0x610
[   25.279335]  ? __virt_addr_valid+0x1db/0x2d0
[   25.279358]  ? strlen+0x8f/0xb0
[   25.279390]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.279417]  ? strlen+0x8f/0xb0
[   25.279438]  kasan_report+0x141/0x180
[   25.279459]  ? strlen+0x8f/0xb0
[   25.279484]  __asan_report_load1_noabort+0x18/0x20
[   25.279508]  strlen+0x8f/0xb0
[   25.279530]  kasan_strings+0x57b/0xe80
[   25.279550]  ? trace_hardirqs_on+0x37/0xe0
[   25.279591]  ? __pfx_kasan_strings+0x10/0x10
[   25.279611]  ? finish_task_switch.isra.0+0x153/0x700
[   25.279632]  ? __switch_to+0x47/0xf80
[   25.279657]  ? __schedule+0x10c6/0x2b60
[   25.279679]  ? __pfx_read_tsc+0x10/0x10
[   25.279701]  ? ktime_get_ts64+0x86/0x230
[   25.279726]  kunit_try_run_case+0x1a5/0x480
[   25.279750]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.279771]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.279794]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.279817]  ? __kthread_parkme+0x82/0x180
[   25.279837]  ? preempt_count_sub+0x50/0x80
[   25.279879]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.279902]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.279929]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.279955]  kthread+0x337/0x6f0
[   25.279974]  ? trace_preempt_on+0x20/0xc0
[   25.279996]  ? __pfx_kthread+0x10/0x10
[   25.280016]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.280037]  ? calculate_sigpending+0x7b/0xa0
[   25.280060]  ? __pfx_kthread+0x10/0x10
[   25.280081]  ret_from_fork+0x116/0x1d0
[   25.280099]  ? __pfx_kthread+0x10/0x10
[   25.280120]  ret_from_fork_asm+0x1a/0x30
[   25.280151]  </TASK>
[   25.280162] 
[   25.293477] Allocated by task 308:
[   25.293869]  kasan_save_stack+0x45/0x70
[   25.294311]  kasan_save_track+0x18/0x40
[   25.294800]  kasan_save_alloc_info+0x3b/0x50
[   25.295372]  __kasan_kmalloc+0xb7/0xc0
[   25.295754]  __kmalloc_cache_noprof+0x189/0x420
[   25.296146]  kasan_strings+0xc0/0xe80
[   25.296522]  kunit_try_run_case+0x1a5/0x480
[   25.296856]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.297161]  kthread+0x337/0x6f0
[   25.297275]  ret_from_fork+0x116/0x1d0
[   25.297774]  ret_from_fork_asm+0x1a/0x30
[   25.298230] 
[   25.298559] Freed by task 308:
[   25.298694]  kasan_save_stack+0x45/0x70
[   25.299125]  kasan_save_track+0x18/0x40
[   25.299635]  kasan_save_free_info+0x3f/0x60
[   25.300168]  __kasan_slab_free+0x56/0x70
[   25.300332]  kfree+0x222/0x3f0
[   25.300736]  kasan_strings+0x2aa/0xe80
[   25.301215]  kunit_try_run_case+0x1a5/0x480
[   25.301691]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.301907]  kthread+0x337/0x6f0
[   25.302485]  ret_from_fork+0x116/0x1d0
[   25.302970]  ret_from_fork_asm+0x1a/0x30
[   25.303124] 
[   25.303192] The buggy address belongs to the object at ffff8881053b8d40
[   25.303192]  which belongs to the cache kmalloc-32 of size 32
[   25.304618] The buggy address is located 16 bytes inside of
[   25.304618]  freed 32-byte region [ffff8881053b8d40, ffff8881053b8d60)
[   25.305380] 
[   25.305556] The buggy address belongs to the physical page:
[   25.306064] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1053b8
[   25.306484] flags: 0x200000000000000(node=0|zone=2)
[   25.306712] page_type: f5(slab)
[   25.306854] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   25.307122] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   25.307410] page dumped because: kasan: bad access detected
[   25.307603] 
[   25.307675] Memory state around the buggy address:
[   25.307861]  ffff8881053b8c00: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   25.308111]  ffff8881053b8c80: fa fb fb fb fc fc fc fc 00 00 07 fc fc fc fc fc
[   25.309611] >ffff8881053b8d00: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   25.310658]                                                  ^
[   25.311584]  ffff8881053b8d80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   25.312549]  ffff8881053b8e00: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   25.314186] ==================================================================