Hay
Date
May 26, 2025, 9:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   20.305104] ==================================================================
[   20.305231] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   20.306739] Read of size 1 at addr fff00000c7896b90 by task kunit_try_catch/259
[   20.307164] 
[   20.309234] CPU: 0 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7-next-20250526 #1 PREEMPT 
[   20.310826] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.311007] Hardware name: linux,dummy-virt (DT)
[   20.311176] Call trace:
[   20.311226]  show_stack+0x20/0x38 (C)
[   20.311505]  dump_stack_lvl+0x8c/0xd0
[   20.311725]  print_report+0x118/0x608
[   20.311838]  kasan_report+0xdc/0x128
[   20.311949]  __asan_report_load1_noabort+0x20/0x30
[   20.312071]  strcmp+0xc0/0xc8
[   20.312171]  kasan_strings+0x340/0xb00
[   20.312271]  kunit_try_run_case+0x170/0x3f0
[   20.314015]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.314972]  kthread+0x328/0x630
[   20.315085]  ret_from_fork+0x10/0x20
[   20.315419] 
[   20.315469] Allocated by task 259:
[   20.315520]  kasan_save_stack+0x3c/0x68
[   20.315575]  kasan_save_track+0x20/0x40
[   20.315618]  kasan_save_alloc_info+0x40/0x58
[   20.315746]  __kasan_kmalloc+0xd4/0xd8
[   20.316072]  __kmalloc_cache_noprof+0x15c/0x3c0
[   20.316183]  kasan_strings+0xc8/0xb00
[   20.316291]  kunit_try_run_case+0x170/0x3f0
[   20.316394]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.316580]  kthread+0x328/0x630
[   20.316698]  ret_from_fork+0x10/0x20
[   20.316867] 
[   20.316958] Freed by task 259:
[   20.317041]  kasan_save_stack+0x3c/0x68
[   20.317191]  kasan_save_track+0x20/0x40
[   20.317326]  kasan_save_free_info+0x4c/0x78
[   20.317722]  __kasan_slab_free+0x6c/0x98
[   20.317841]  kfree+0x214/0x3c8
[   20.317928]  kasan_strings+0x24c/0xb00
[   20.318013]  kunit_try_run_case+0x170/0x3f0
[   20.318333]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.318495]  kthread+0x328/0x630
[   20.318579]  ret_from_fork+0x10/0x20
[   20.318694] 
[   20.318746] The buggy address belongs to the object at fff00000c7896b80
[   20.318746]  which belongs to the cache kmalloc-32 of size 32
[   20.318923] The buggy address is located 16 bytes inside of
[   20.318923]  freed 32-byte region [fff00000c7896b80, fff00000c7896ba0)
[   20.319071] 
[   20.319142] The buggy address belongs to the physical page:
[   20.319248] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107896
[   20.319366] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.319468] page_type: f5(slab)
[   20.319559] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   20.319676] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   20.319774] page dumped because: kasan: bad access detected
[   20.319848] 
[   20.319892] Memory state around the buggy address:
[   20.319967]  fff00000c7896a80: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   20.320070]  fff00000c7896b00: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   20.320171] >fff00000c7896b80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   20.320262]                          ^
[   20.320343]  fff00000c7896c00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   20.320444]  fff00000c7896c80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   20.320551] ==================================================================


[   12.931711] ==================================================================
[   12.933247] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   12.933546] Read of size 1 at addr ffff8881039b9850 by task kunit_try_catch/277
[   12.934041] 
[   12.934397] CPU: 1 UID: 0 PID: 277 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7-next-20250526 #1 PREEMPT(voluntary) 
[   12.934449] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.934462] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.934484] Call Trace:
[   12.934497]  <TASK>
[   12.934514]  dump_stack_lvl+0x73/0xb0
[   12.934543]  print_report+0xd1/0x650
[   12.934568]  ? __virt_addr_valid+0x1db/0x2d0
[   12.934591]  ? strcmp+0xb0/0xc0
[   12.934610]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.934634]  ? strcmp+0xb0/0xc0
[   12.934652]  kasan_report+0x141/0x180
[   12.934676]  ? strcmp+0xb0/0xc0
[   12.934699]  __asan_report_load1_noabort+0x18/0x20
[   12.934914]  strcmp+0xb0/0xc0
[   12.934939]  kasan_strings+0x431/0xe80
[   12.934960]  ? trace_hardirqs_on+0x37/0xe0
[   12.934999]  ? __pfx_kasan_strings+0x10/0x10
[   12.935024]  ? finish_task_switch.isra.0+0x153/0x700
[   12.935047]  ? __switch_to+0x47/0xf50
[   12.935074]  ? __schedule+0x10cc/0x2b60
[   12.935100]  ? __pfx_read_tsc+0x10/0x10
[   12.935122]  ? ktime_get_ts64+0x86/0x230
[   12.935147]  kunit_try_run_case+0x1a5/0x480
[   12.935169]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.935189]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.935214]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.935240]  ? __kthread_parkme+0x82/0x180
[   12.935259]  ? preempt_count_sub+0x50/0x80
[   12.935282]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.935302]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.935327]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.935352]  kthread+0x337/0x6f0
[   12.935371]  ? trace_preempt_on+0x20/0xc0
[   12.935402]  ? __pfx_kthread+0x10/0x10
[   12.935422]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.935445]  ? calculate_sigpending+0x7b/0xa0
[   12.935469]  ? __pfx_kthread+0x10/0x10
[   12.935491]  ret_from_fork+0x116/0x1d0
[   12.935510]  ? __pfx_kthread+0x10/0x10
[   12.935530]  ret_from_fork_asm+0x1a/0x30
[   12.935560]  </TASK>
[   12.935571] 
[   12.946186] Allocated by task 277:
[   12.946346]  kasan_save_stack+0x45/0x70
[   12.946559]  kasan_save_track+0x18/0x40
[   12.947096]  kasan_save_alloc_info+0x3b/0x50
[   12.947430]  __kasan_kmalloc+0xb7/0xc0
[   12.947582]  __kmalloc_cache_noprof+0x189/0x420
[   12.947945]  kasan_strings+0xc0/0xe80
[   12.948341]  kunit_try_run_case+0x1a5/0x480
[   12.948654]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.948900]  kthread+0x337/0x6f0
[   12.949259]  ret_from_fork+0x116/0x1d0
[   12.949479]  ret_from_fork_asm+0x1a/0x30
[   12.949802] 
[   12.949903] Freed by task 277:
[   12.950050]  kasan_save_stack+0x45/0x70
[   12.950251]  kasan_save_track+0x18/0x40
[   12.950460]  kasan_save_free_info+0x3f/0x60
[   12.950641]  __kasan_slab_free+0x56/0x70
[   12.950875]  kfree+0x222/0x3f0
[   12.951389]  kasan_strings+0x2aa/0xe80
[   12.951567]  kunit_try_run_case+0x1a5/0x480
[   12.951929]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.952294]  kthread+0x337/0x6f0
[   12.952488]  ret_from_fork+0x116/0x1d0
[   12.952819]  ret_from_fork_asm+0x1a/0x30
[   12.953204] 
[   12.953310] The buggy address belongs to the object at ffff8881039b9840
[   12.953310]  which belongs to the cache kmalloc-32 of size 32
[   12.953926] The buggy address is located 16 bytes inside of
[   12.953926]  freed 32-byte region [ffff8881039b9840, ffff8881039b9860)
[   12.954621] 
[   12.954721] The buggy address belongs to the physical page:
[   12.955134] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1039b9
[   12.955482] flags: 0x200000000000000(node=0|zone=2)
[   12.955699] page_type: f5(slab)
[   12.956236] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   12.956551] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   12.957022] page dumped because: kasan: bad access detected
[   12.957357] 
[   12.957473] Memory state around the buggy address:
[   12.957692]  ffff8881039b9700: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   12.958324]  ffff8881039b9780: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   12.958709] >ffff8881039b9800: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   12.959117]                                                  ^
[   12.959540]  ffff8881039b9880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   12.959869]  ffff8881039b9900: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   12.960419] ==================================================================