Hay
Date
May 13, 2025, 12:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   21.444366] ==================================================================
[   21.444430] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   21.444509] Read of size 1 at addr fff00000c7794c90 by task kunit_try_catch/259
[   21.444566] 
[   21.444619] CPU: 1 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250513 #1 PREEMPT 
[   21.444721] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.444754] Hardware name: linux,dummy-virt (DT)
[   21.444796] Call trace:
[   21.444827]  show_stack+0x20/0x38 (C)
[   21.444890]  dump_stack_lvl+0x8c/0xd0
[   21.444941]  print_report+0x118/0x608
[   21.445011]  kasan_report+0xdc/0x128
[   21.445065]  __asan_report_load1_noabort+0x20/0x30
[   21.445120]  strcmp+0xc0/0xc8
[   21.445166]  kasan_strings+0x340/0xb00
[   21.445215]  kunit_try_run_case+0x170/0x3f0
[   21.445268]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.445326]  kthread+0x328/0x630
[   21.445837]  ret_from_fork+0x10/0x20
[   21.445940] 
[   21.445984] Allocated by task 259:
[   21.446024]  kasan_save_stack+0x3c/0x68
[   21.446079]  kasan_save_track+0x20/0x40
[   21.446127]  kasan_save_alloc_info+0x40/0x58
[   21.446177]  __kasan_kmalloc+0xd4/0xd8
[   21.446222]  __kmalloc_cache_noprof+0x15c/0x3c0
[   21.446269]  kasan_strings+0xc8/0xb00
[   21.446689]  kunit_try_run_case+0x170/0x3f0
[   21.446812]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.446902]  kthread+0x328/0x630
[   21.446944]  ret_from_fork+0x10/0x20
[   21.447011] 
[   21.447038] Freed by task 259:
[   21.447104]  kasan_save_stack+0x3c/0x68
[   21.447170]  kasan_save_track+0x20/0x40
[   21.447265]  kasan_save_free_info+0x4c/0x78
[   21.447306]  __kasan_slab_free+0x6c/0x98
[   21.447348]  kfree+0x214/0x3c8
[   21.447382]  kasan_strings+0x24c/0xb00
[   21.447422]  kunit_try_run_case+0x170/0x3f0
[   21.447460]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.447517]  kthread+0x328/0x630
[   21.447627]  ret_from_fork+0x10/0x20
[   21.447672] 
[   21.447732] The buggy address belongs to the object at fff00000c7794c80
[   21.447732]  which belongs to the cache kmalloc-32 of size 32
[   21.447817] The buggy address is located 16 bytes inside of
[   21.447817]  freed 32-byte region [fff00000c7794c80, fff00000c7794ca0)
[   21.447944] 
[   21.447992] The buggy address belongs to the physical page:
[   21.448106] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107794
[   21.448177] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   21.448263] page_type: f5(slab)
[   21.448386] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   21.448451] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   21.448521] page dumped because: kasan: bad access detected
[   21.448604] 
[   21.448659] Memory state around the buggy address:
[   21.448711]  fff00000c7794b80: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   21.448809]  fff00000c7794c00: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   21.448912] >fff00000c7794c80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   21.449527]                          ^
[   21.449671]  fff00000c7794d00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   21.449896]  fff00000c7794d80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   21.449950] ==================================================================

[   13.047518] ==================================================================
[   13.048448] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   13.048798] Read of size 1 at addr ffff8881029e6650 by task kunit_try_catch/276
[   13.049114] 
[   13.049281] CPU: 0 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250513 #1 PREEMPT(voluntary) 
[   13.049342] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.049355] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.049387] Call Trace:
[   13.049401]  <TASK>
[   13.049417]  dump_stack_lvl+0x73/0xb0
[   13.049446]  print_report+0xd1/0x650
[   13.049472]  ? __virt_addr_valid+0x1db/0x2d0
[   13.049510]  ? strcmp+0xb0/0xc0
[   13.049547]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.049572]  ? strcmp+0xb0/0xc0
[   13.049593]  kasan_report+0x141/0x180
[   13.049669]  ? strcmp+0xb0/0xc0
[   13.049718]  __asan_report_load1_noabort+0x18/0x20
[   13.049741]  strcmp+0xb0/0xc0
[   13.049764]  kasan_strings+0x431/0xe80
[   13.049794]  ? trace_hardirqs_on+0x37/0xe0
[   13.049820]  ? __pfx_kasan_strings+0x10/0x10
[   13.049841]  ? finish_task_switch.isra.0+0x153/0x700
[   13.049864]  ? __switch_to+0x47/0xf50
[   13.049892]  ? __schedule+0x10cc/0x2b60
[   13.049915]  ? __pfx_read_tsc+0x10/0x10
[   13.049937]  ? ktime_get_ts64+0x86/0x230
[   13.049962]  kunit_try_run_case+0x1a5/0x480
[   13.049987]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.050018]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.050042]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.050063]  ? __kthread_parkme+0x82/0x180
[   13.050094]  ? preempt_count_sub+0x50/0x80
[   13.050118]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.050143]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.050165]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.050198]  kthread+0x337/0x6f0
[   13.050218]  ? trace_preempt_on+0x20/0xc0
[   13.050249]  ? __pfx_kthread+0x10/0x10
[   13.050271]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.050291]  ? calculate_sigpending+0x7b/0xa0
[   13.050327]  ? __pfx_kthread+0x10/0x10
[   13.050348]  ret_from_fork+0x116/0x1d0
[   13.050367]  ? __pfx_kthread+0x10/0x10
[   13.050387]  ret_from_fork_asm+0x1a/0x30
[   13.050419]  </TASK>
[   13.050431] 
[   13.058970] Allocated by task 276:
[   13.059173]  kasan_save_stack+0x45/0x70
[   13.059373]  kasan_save_track+0x18/0x40
[   13.059560]  kasan_save_alloc_info+0x3b/0x50
[   13.059896]  __kasan_kmalloc+0xb7/0xc0
[   13.060029]  __kmalloc_cache_noprof+0x189/0x420
[   13.060342]  kasan_strings+0xc0/0xe80
[   13.060569]  kunit_try_run_case+0x1a5/0x480
[   13.060810]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.061018]  kthread+0x337/0x6f0
[   13.061195]  ret_from_fork+0x116/0x1d0
[   13.061366]  ret_from_fork_asm+0x1a/0x30
[   13.061665] 
[   13.061747] Freed by task 276:
[   13.061914]  kasan_save_stack+0x45/0x70
[   13.062097]  kasan_save_track+0x18/0x40
[   13.062306]  kasan_save_free_info+0x3f/0x60
[   13.062501]  __kasan_slab_free+0x56/0x70
[   13.062910]  kfree+0x222/0x3f0
[   13.063046]  kasan_strings+0x2aa/0xe80
[   13.063218]  kunit_try_run_case+0x1a5/0x480
[   13.063530]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.063868]  kthread+0x337/0x6f0
[   13.063987]  ret_from_fork+0x116/0x1d0
[   13.064112]  ret_from_fork_asm+0x1a/0x30
[   13.064244] 
[   13.064335] The buggy address belongs to the object at ffff8881029e6640
[   13.064335]  which belongs to the cache kmalloc-32 of size 32
[   13.065049] The buggy address is located 16 bytes inside of
[   13.065049]  freed 32-byte region [ffff8881029e6640, ffff8881029e6660)
[   13.065572] 
[   13.065735] The buggy address belongs to the physical page:
[   13.065965] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1029e6
[   13.066208] flags: 0x200000000000000(node=0|zone=2)
[   13.066396] page_type: f5(slab)
[   13.066586] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.066943] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.067283] page dumped because: kasan: bad access detected
[   13.067580] 
[   13.067719] Memory state around the buggy address:
[   13.067964]  ffff8881029e6500: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.068289]  ffff8881029e6580: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.068589] >ffff8881029e6600: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.068913]                                                  ^
[   13.069159]  ffff8881029e6680: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.069509]  ffff8881029e6700: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.069936] ==================================================================