Hay
Date
June 19, 2025, 12:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   33.338866] ==================================================================
[   33.339131] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   33.339337] Read of size 1 at addr fff00000c76d03d0 by task kunit_try_catch/270
[   33.339519] 
[   33.339661] CPU: 0 UID: 0 PID: 270 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250619 #1 PREEMPT 
[   33.339948] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.340018] Hardware name: linux,dummy-virt (DT)
[   33.340145] Call trace:
[   33.340225]  show_stack+0x20/0x38 (C)
[   33.340588]  dump_stack_lvl+0x8c/0xd0
[   33.340728]  print_report+0x118/0x608
[   33.340858]  kasan_report+0xdc/0x128
[   33.340999]  __asan_report_load1_noabort+0x20/0x30
[   33.341133]  strcmp+0xc0/0xc8
[   33.341248]  kasan_strings+0x340/0xb00
[   33.341363]  kunit_try_run_case+0x170/0x3f0
[   33.341536]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.341927]  kthread+0x328/0x630
[   33.342108]  ret_from_fork+0x10/0x20
[   33.342282] 
[   33.342366] Allocated by task 270:
[   33.342450]  kasan_save_stack+0x3c/0x68
[   33.342606]  kasan_save_track+0x20/0x40
[   33.342706]  kasan_save_alloc_info+0x40/0x58
[   33.342814]  __kasan_kmalloc+0xd4/0xd8
[   33.342924]  __kmalloc_cache_noprof+0x16c/0x3c0
[   33.343034]  kasan_strings+0xc8/0xb00
[   33.343108]  kunit_try_run_case+0x170/0x3f0
[   33.343236]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.343385]  kthread+0x328/0x630
[   33.343517]  ret_from_fork+0x10/0x20
[   33.343649] 
[   33.343708] Freed by task 270:
[   33.343813]  kasan_save_stack+0x3c/0x68
[   33.343935]  kasan_save_track+0x20/0x40
[   33.344024]  kasan_save_free_info+0x4c/0x78
[   33.344345]  __kasan_slab_free+0x6c/0x98
[   33.344532]  kfree+0x214/0x3c8
[   33.344628]  kasan_strings+0x24c/0xb00
[   33.344936]  kunit_try_run_case+0x170/0x3f0
[   33.345110]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.345242]  kthread+0x328/0x630
[   33.345335]  ret_from_fork+0x10/0x20
[   33.345666] 
[   33.345726] The buggy address belongs to the object at fff00000c76d03c0
[   33.345726]  which belongs to the cache kmalloc-32 of size 32
[   33.345977] The buggy address is located 16 bytes inside of
[   33.345977]  freed 32-byte region [fff00000c76d03c0, fff00000c76d03e0)
[   33.346153] 
[   33.346207] The buggy address belongs to the physical page:
[   33.346279] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1076d0
[   33.346407] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   33.346539] page_type: f5(slab)
[   33.346935] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   33.347340] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   33.347478] page dumped because: kasan: bad access detected
[   33.347570] 
[   33.347689] Memory state around the buggy address:
[   33.347777]  fff00000c76d0280: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   33.348169]  fff00000c76d0300: 00 00 00 04 fc fc fc fc 00 00 07 fc fc fc fc fc
[   33.348287] >fff00000c76d0380: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   33.348394]                                                  ^
[   33.348610]  fff00000c76d0400: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   33.348783]  fff00000c76d0480: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   33.348917] ==================================================================

[   29.335599] ==================================================================
[   29.337073] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   29.337589] Read of size 1 at addr ffff8881024dbb10 by task kunit_try_catch/288
[   29.337945] 
[   29.338302] CPU: 1 UID: 0 PID: 288 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250619 #1 PREEMPT(voluntary) 
[   29.338423] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.338452] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   29.338499] Call Trace:
[   29.338529]  <TASK>
[   29.338570]  dump_stack_lvl+0x73/0xb0
[   29.338643]  print_report+0xd1/0x650
[   29.338699]  ? __virt_addr_valid+0x1db/0x2d0
[   29.338752]  ? strcmp+0xb0/0xc0
[   29.338790]  ? kasan_complete_mode_report_info+0x64/0x200
[   29.338836]  ? strcmp+0xb0/0xc0
[   29.338880]  kasan_report+0x141/0x180
[   29.339081]  ? strcmp+0xb0/0xc0
[   29.339162]  __asan_report_load1_noabort+0x18/0x20
[   29.339218]  strcmp+0xb0/0xc0
[   29.339261]  kasan_strings+0x431/0xe80
[   29.339303]  ? trace_hardirqs_on+0x37/0xe0
[   29.339347]  ? __pfx_kasan_strings+0x10/0x10
[   29.339385]  ? finish_task_switch.isra.0+0x153/0x700
[   29.339430]  ? __switch_to+0x47/0xf50
[   29.339485]  ? __schedule+0x10cc/0x2b60
[   29.339519]  ? __pfx_read_tsc+0x10/0x10
[   29.339544]  ? ktime_get_ts64+0x86/0x230
[   29.339571]  kunit_try_run_case+0x1a5/0x480
[   29.339599]  ? __pfx_kunit_try_run_case+0x10/0x10
[   29.339623]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   29.339646]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   29.339671]  ? __kthread_parkme+0x82/0x180
[   29.339694]  ? preempt_count_sub+0x50/0x80
[   29.339718]  ? __pfx_kunit_try_run_case+0x10/0x10
[   29.339743]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   29.339766]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   29.339791]  kthread+0x337/0x6f0
[   29.339811]  ? trace_preempt_on+0x20/0xc0
[   29.339835]  ? __pfx_kthread+0x10/0x10
[   29.339857]  ? _raw_spin_unlock_irq+0x47/0x80
[   29.339879]  ? calculate_sigpending+0x7b/0xa0
[   29.339928]  ? __pfx_kthread+0x10/0x10
[   29.340002]  ret_from_fork+0x116/0x1d0
[   29.340052]  ? __pfx_kthread+0x10/0x10
[   29.340123]  ret_from_fork_asm+0x1a/0x30
[   29.340165]  </TASK>
[   29.340180] 
[   29.351412] Allocated by task 288:
[   29.351759]  kasan_save_stack+0x45/0x70
[   29.352717]  kasan_save_track+0x18/0x40
[   29.353129]  kasan_save_alloc_info+0x3b/0x50
[   29.353477]  __kasan_kmalloc+0xb7/0xc0
[   29.353720]  __kmalloc_cache_noprof+0x189/0x420
[   29.353981]  kasan_strings+0xc0/0xe80
[   29.354449]  kunit_try_run_case+0x1a5/0x480
[   29.354716]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   29.355237]  kthread+0x337/0x6f0
[   29.355544]  ret_from_fork+0x116/0x1d0
[   29.355765]  ret_from_fork_asm+0x1a/0x30
[   29.356261] 
[   29.356397] Freed by task 288:
[   29.356634]  kasan_save_stack+0x45/0x70
[   29.356893]  kasan_save_track+0x18/0x40
[   29.357274]  kasan_save_free_info+0x3f/0x60
[   29.357508]  __kasan_slab_free+0x56/0x70
[   29.357811]  kfree+0x222/0x3f0
[   29.358991]  kasan_strings+0x2aa/0xe80
[   29.359238]  kunit_try_run_case+0x1a5/0x480
[   29.359427]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   29.359647]  kthread+0x337/0x6f0
[   29.360187]  ret_from_fork+0x116/0x1d0
[   29.360513]  ret_from_fork_asm+0x1a/0x30
[   29.360849] 
[   29.361167] The buggy address belongs to the object at ffff8881024dbb00
[   29.361167]  which belongs to the cache kmalloc-32 of size 32
[   29.362181] The buggy address is located 16 bytes inside of
[   29.362181]  freed 32-byte region [ffff8881024dbb00, ffff8881024dbb20)
[   29.363603] 
[   29.363749] The buggy address belongs to the physical page:
[   29.364027] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1024db
[   29.364602] flags: 0x200000000000000(node=0|zone=2)
[   29.364953] page_type: f5(slab)
[   29.365277] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   29.365663] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   29.366319] page dumped because: kasan: bad access detected
[   29.366724] 
[   29.366873] Memory state around the buggy address:
[   29.367397]  ffff8881024dba00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   29.368088]  ffff8881024dba80: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   29.368419] >ffff8881024dbb00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   29.368763]                          ^
[   29.369671]  ffff8881024dbb80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   29.370059]  ffff8881024dbc00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   29.370702] ==================================================================