Hay
Date
July 10, 2025, 6:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.157975] ==================================================================
[   19.158349] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   19.158818] Read of size 1 at addr fff00000c5a4d450 by task kunit_try_catch/259
[   19.158981] 
[   19.159077] CPU: 0 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   19.159250] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.159330] Hardware name: linux,dummy-virt (DT)
[   19.159377] Call trace:
[   19.159707]  show_stack+0x20/0x38 (C)
[   19.159880]  dump_stack_lvl+0x8c/0xd0
[   19.160006]  print_report+0x118/0x608
[   19.160138]  kasan_report+0xdc/0x128
[   19.160317]  __asan_report_load1_noabort+0x20/0x30
[   19.160633]  strcmp+0xc0/0xc8
[   19.160781]  kasan_strings+0x340/0xb00
[   19.160939]  kunit_try_run_case+0x170/0x3f0
[   19.161092]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.161276]  kthread+0x328/0x630
[   19.161595]  ret_from_fork+0x10/0x20
[   19.161839] 
[   19.161963] Allocated by task 259:
[   19.162042]  kasan_save_stack+0x3c/0x68
[   19.162130]  kasan_save_track+0x20/0x40
[   19.162254]  kasan_save_alloc_info+0x40/0x58
[   19.162360]  __kasan_kmalloc+0xd4/0xd8
[   19.162404]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.162759]  kasan_strings+0xc8/0xb00
[   19.162895]  kunit_try_run_case+0x170/0x3f0
[   19.163055]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.163183]  kthread+0x328/0x630
[   19.163393]  ret_from_fork+0x10/0x20
[   19.163457] 
[   19.163973] Freed by task 259:
[   19.164024]  kasan_save_stack+0x3c/0x68
[   19.164348]  kasan_save_track+0x20/0x40
[   19.164595]  kasan_save_free_info+0x4c/0x78
[   19.164741]  __kasan_slab_free+0x6c/0x98
[   19.164890]  kfree+0x214/0x3c8
[   19.165046]  kasan_strings+0x24c/0xb00
[   19.165211]  kunit_try_run_case+0x170/0x3f0
[   19.165425]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.165557]  kthread+0x328/0x630
[   19.165644]  ret_from_fork+0x10/0x20
[   19.165799] 
[   19.165864] The buggy address belongs to the object at fff00000c5a4d440
[   19.165864]  which belongs to the cache kmalloc-32 of size 32
[   19.166104] The buggy address is located 16 bytes inside of
[   19.166104]  freed 32-byte region [fff00000c5a4d440, fff00000c5a4d460)
[   19.166332] 
[   19.166404] The buggy address belongs to the physical page:
[   19.166573] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105a4d
[   19.166743] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.166855] page_type: f5(slab)
[   19.166976] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   19.167051] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   19.167420] page dumped because: kasan: bad access detected
[   19.167465] 
[   19.167738] Memory state around the buggy address:
[   19.167849]  fff00000c5a4d300: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.167975]  fff00000c5a4d380: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.168155] >fff00000c5a4d400: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   19.168244]                                                  ^
[   19.168328]  fff00000c5a4d480: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   19.168677]  fff00000c5a4d500: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   19.168808] ==================================================================

[   14.398406] ==================================================================
[   14.399492] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   14.399749] Read of size 1 at addr ffff8881027b2750 by task kunit_try_catch/276
[   14.400060] 
[   14.400200] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   14.400245] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.400256] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.400277] Call Trace:
[   14.400290]  <TASK>
[   14.400307]  dump_stack_lvl+0x73/0xb0
[   14.400335]  print_report+0xd1/0x650
[   14.400359]  ? __virt_addr_valid+0x1db/0x2d0
[   14.400383]  ? strcmp+0xb0/0xc0
[   14.400399]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.400423]  ? strcmp+0xb0/0xc0
[   14.400440]  kasan_report+0x141/0x180
[   14.400462]  ? strcmp+0xb0/0xc0
[   14.400560]  __asan_report_load1_noabort+0x18/0x20
[   14.400589]  strcmp+0xb0/0xc0
[   14.400608]  kasan_strings+0x431/0xe80
[   14.400628]  ? trace_hardirqs_on+0x37/0xe0
[   14.400652]  ? __pfx_kasan_strings+0x10/0x10
[   14.400675]  ? __kasan_check_write+0x18/0x20
[   14.400694]  ? queued_spin_lock_slowpath+0x116/0xb40
[   14.400720]  ? irqentry_exit+0x2a/0x60
[   14.400743]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   14.400768]  ? trace_hardirqs_on+0x37/0xe0
[   14.400790]  ? __pfx_read_tsc+0x10/0x10
[   14.400812]  ? ktime_get_ts64+0x86/0x230
[   14.400858]  kunit_try_run_case+0x1a5/0x480
[   14.400884]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.400910]  ? queued_spin_lock_slowpath+0x116/0xb40
[   14.400934]  ? __kthread_parkme+0x82/0x180
[   14.401001]  ? preempt_count_sub+0x50/0x80
[   14.401026]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.401061]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.401086]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.401112]  kthread+0x337/0x6f0
[   14.401130]  ? trace_preempt_on+0x20/0xc0
[   14.401153]  ? __pfx_kthread+0x10/0x10
[   14.401173]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.401194]  ? calculate_sigpending+0x7b/0xa0
[   14.401218]  ? __pfx_kthread+0x10/0x10
[   14.401239]  ret_from_fork+0x116/0x1d0
[   14.401257]  ? __pfx_kthread+0x10/0x10
[   14.401278]  ret_from_fork_asm+0x1a/0x30
[   14.401309]  </TASK>
[   14.401319] 
[   14.411679] Allocated by task 276:
[   14.412060]  kasan_save_stack+0x45/0x70
[   14.412264]  kasan_save_track+0x18/0x40
[   14.412441]  kasan_save_alloc_info+0x3b/0x50
[   14.412634]  __kasan_kmalloc+0xb7/0xc0
[   14.412853]  __kmalloc_cache_noprof+0x189/0x420
[   14.413845]  kasan_strings+0xc0/0xe80
[   14.414001]  kunit_try_run_case+0x1a5/0x480
[   14.414156]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.414325]  kthread+0x337/0x6f0
[   14.414442]  ret_from_fork+0x116/0x1d0
[   14.414631]  ret_from_fork_asm+0x1a/0x30
[   14.414812] 
[   14.414902] Freed by task 276:
[   14.415110]  kasan_save_stack+0x45/0x70
[   14.415288]  kasan_save_track+0x18/0x40
[   14.415460]  kasan_save_free_info+0x3f/0x60
[   14.415643]  __kasan_slab_free+0x56/0x70
[   14.416370]  kfree+0x222/0x3f0
[   14.416539]  kasan_strings+0x2aa/0xe80
[   14.416676]  kunit_try_run_case+0x1a5/0x480
[   14.416824]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.417363]  kthread+0x337/0x6f0
[   14.417991]  ret_from_fork+0x116/0x1d0
[   14.418432]  ret_from_fork_asm+0x1a/0x30
[   14.418705] 
[   14.418863] The buggy address belongs to the object at ffff8881027b2740
[   14.418863]  which belongs to the cache kmalloc-32 of size 32
[   14.419859] The buggy address is located 16 bytes inside of
[   14.419859]  freed 32-byte region [ffff8881027b2740, ffff8881027b2760)
[   14.420373] 
[   14.420468] The buggy address belongs to the physical page:
[   14.420708] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027b2
[   14.421337] flags: 0x200000000000000(node=0|zone=2)
[   14.421553] page_type: f5(slab)
[   14.421710] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.423042] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.423351] page dumped because: kasan: bad access detected
[   14.423658] 
[   14.424122] Memory state around the buggy address:
[   14.424339]  ffff8881027b2600: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.424633]  ffff8881027b2680: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.425304] >ffff8881027b2700: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.425858]                                                  ^
[   14.426271]  ffff8881027b2780: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.426559]  ffff8881027b2800: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.427292] ==================================================================