Hay
Date
May 29, 2025, 7:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   24.669352] ==================================================================
[   24.669526] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   24.669679] Read of size 1 at addr fff00000c7876250 by task kunit_try_catch/259
[   24.669887] 
[   24.670006] CPU: 1 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT 
[   24.670279] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.670433] Hardware name: linux,dummy-virt (DT)
[   24.670525] Call trace:
[   24.670623]  show_stack+0x20/0x38 (C)
[   24.670801]  dump_stack_lvl+0x8c/0xd0
[   24.670979]  print_report+0x118/0x608
[   24.671148]  kasan_report+0xdc/0x128
[   24.671310]  __asan_report_load1_noabort+0x20/0x30
[   24.671490]  strcmp+0xc0/0xc8
[   24.671654]  kasan_strings+0x340/0xb00
[   24.671788]  kunit_try_run_case+0x170/0x3f0
[   24.671975]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.672123]  kthread+0x328/0x630
[   24.672336]  ret_from_fork+0x10/0x20
[   24.672505] 
[   24.672562] Allocated by task 259:
[   24.672634]  kasan_save_stack+0x3c/0x68
[   24.672781]  kasan_save_track+0x20/0x40
[   24.672867]  kasan_save_alloc_info+0x40/0x58
[   24.672986]  __kasan_kmalloc+0xd4/0xd8
[   24.673077]  __kmalloc_cache_noprof+0x15c/0x3c0
[   24.673201]  kasan_strings+0xc8/0xb00
[   24.673414]  kunit_try_run_case+0x170/0x3f0
[   24.673591]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.673742]  kthread+0x328/0x630
[   24.673864]  ret_from_fork+0x10/0x20
[   24.673955] 
[   24.674013] Freed by task 259:
[   24.674101]  kasan_save_stack+0x3c/0x68
[   24.674197]  kasan_save_track+0x20/0x40
[   24.674410]  kasan_save_free_info+0x4c/0x78
[   24.674513]  __kasan_slab_free+0x6c/0x98
[   24.674622]  kfree+0x214/0x3c8
[   24.674756]  kasan_strings+0x24c/0xb00
[   24.674939]  kunit_try_run_case+0x170/0x3f0
[   24.675126]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.675252]  kthread+0x328/0x630
[   24.675443]  ret_from_fork+0x10/0x20
[   24.675570] 
[   24.675632] The buggy address belongs to the object at fff00000c7876240
[   24.675632]  which belongs to the cache kmalloc-32 of size 32
[   24.675777] The buggy address is located 16 bytes inside of
[   24.675777]  freed 32-byte region [fff00000c7876240, fff00000c7876260)
[   24.675974] 
[   24.676038] The buggy address belongs to the physical page:
[   24.676137] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107876
[   24.676295] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   24.676436] page_type: f5(slab)
[   24.676601] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   24.676728] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   24.676868] page dumped because: kasan: bad access detected
[   24.677028] 
[   24.677109] Memory state around the buggy address:
[   24.677206]  fff00000c7876100: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   24.677327]  fff00000c7876180: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   24.677453] >fff00000c7876200: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   24.677563]                                                  ^
[   24.677666]  fff00000c7876280: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   24.677801]  fff00000c7876300: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   24.677911] ==================================================================


[   12.782023] ==================================================================
[   12.783111] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   12.783415] Read of size 1 at addr ffff888102fab010 by task kunit_try_catch/276
[   12.783743] 
[   12.784117] CPU: 0 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT(voluntary) 
[   12.784171] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.784184] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.784205] Call Trace:
[   12.784218]  <TASK>
[   12.784233]  dump_stack_lvl+0x73/0xb0
[   12.784260]  print_report+0xd1/0x650
[   12.784284]  ? __virt_addr_valid+0x1db/0x2d0
[   12.784307]  ? strcmp+0xb0/0xc0
[   12.784326]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.784348]  ? strcmp+0xb0/0xc0
[   12.784406]  kasan_report+0x141/0x180
[   12.784430]  ? strcmp+0xb0/0xc0
[   12.784453]  __asan_report_load1_noabort+0x18/0x20
[   12.784473]  strcmp+0xb0/0xc0
[   12.784494]  kasan_strings+0x431/0xe80
[   12.784514]  ? trace_hardirqs_on+0x37/0xe0
[   12.784566]  ? __pfx_kasan_strings+0x10/0x10
[   12.784587]  ? finish_task_switch.isra.0+0x153/0x700
[   12.784621]  ? __switch_to+0x47/0xf50
[   12.784647]  ? __schedule+0x10cc/0x2b60
[   12.784672]  ? __pfx_read_tsc+0x10/0x10
[   12.784694]  ? ktime_get_ts64+0x86/0x230
[   12.784719]  kunit_try_run_case+0x1a5/0x480
[   12.784741]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.784823]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.784849]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.784875]  ? __kthread_parkme+0x82/0x180
[   12.784896]  ? preempt_count_sub+0x50/0x80
[   12.784918]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.784939]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.784963]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.784988]  kthread+0x337/0x6f0
[   12.785008]  ? trace_preempt_on+0x20/0xc0
[   12.785030]  ? __pfx_kthread+0x10/0x10
[   12.785051]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.785074]  ? calculate_sigpending+0x7b/0xa0
[   12.785098]  ? __pfx_kthread+0x10/0x10
[   12.785120]  ret_from_fork+0x116/0x1d0
[   12.785138]  ? __pfx_kthread+0x10/0x10
[   12.785159]  ret_from_fork_asm+0x1a/0x30
[   12.785189]  </TASK>
[   12.785200] 
[   12.793948] Allocated by task 276:
[   12.794156]  kasan_save_stack+0x45/0x70
[   12.794384]  kasan_save_track+0x18/0x40
[   12.794583]  kasan_save_alloc_info+0x3b/0x50
[   12.794832]  __kasan_kmalloc+0xb7/0xc0
[   12.795117]  __kmalloc_cache_noprof+0x189/0x420
[   12.795371]  kasan_strings+0xc0/0xe80
[   12.795559]  kunit_try_run_case+0x1a5/0x480
[   12.795891]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.796169]  kthread+0x337/0x6f0
[   12.796374]  ret_from_fork+0x116/0x1d0
[   12.796580]  ret_from_fork_asm+0x1a/0x30
[   12.796849] 
[   12.796943] Freed by task 276:
[   12.797067]  kasan_save_stack+0x45/0x70
[   12.797206]  kasan_save_track+0x18/0x40
[   12.797341]  kasan_save_free_info+0x3f/0x60
[   12.797550]  __kasan_slab_free+0x56/0x70
[   12.797754]  kfree+0x222/0x3f0
[   12.797960]  kasan_strings+0x2aa/0xe80
[   12.798098]  kunit_try_run_case+0x1a5/0x480
[   12.798242]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.798424]  kthread+0x337/0x6f0
[   12.798602]  ret_from_fork+0x116/0x1d0
[   12.798836]  ret_from_fork_asm+0x1a/0x30
[   12.799062] 
[   12.799162] The buggy address belongs to the object at ffff888102fab000
[   12.799162]  which belongs to the cache kmalloc-32 of size 32
[   12.800027] The buggy address is located 16 bytes inside of
[   12.800027]  freed 32-byte region [ffff888102fab000, ffff888102fab020)
[   12.800526] 
[   12.800602] The buggy address belongs to the physical page:
[   12.800906] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102fab
[   12.801706] flags: 0x200000000000000(node=0|zone=2)
[   12.802028] page_type: f5(slab)
[   12.802203] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   12.802477] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   12.802886] page dumped because: kasan: bad access detected
[   12.803290] 
[   12.803389] Memory state around the buggy address:
[   12.803730]  ffff888102faaf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.804040]  ffff888102faaf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.804561] >ffff888102fab000: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   12.804979]                          ^
[   12.805222]  ffff888102fab080: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   12.805559]  ffff888102fab100: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   12.805964] ==================================================================