Hay
Date
July 23, 2025, 3:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   32.813094] ==================================================================
[   32.813151] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   32.813206] Read of size 1 at addr fff00000c9c2cc50 by task kunit_try_catch/292
[   32.813258] 
[   32.813293] CPU: 1 UID: 0 PID: 292 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250723 #1 PREEMPT 
[   32.813401] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   32.813434] Hardware name: linux,dummy-virt (DT)
[   32.813478] Call trace:
[   32.813514]  show_stack+0x20/0x38 (C)
[   32.813580]  dump_stack_lvl+0x8c/0xd0
[   32.813637]  print_report+0x118/0x5e8
[   32.813683]  kasan_report+0xdc/0x128
[   32.813733]  __asan_report_load1_noabort+0x20/0x30
[   32.813791]  strcmp+0xc0/0xc8
[   32.813837]  kasan_strings+0x340/0xb00
[   32.813891]  kunit_try_run_case+0x170/0x3f0
[   32.813955]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.814008]  kthread+0x328/0x630
[   32.814050]  ret_from_fork+0x10/0x20
[   32.814099] 
[   32.814119] Allocated by task 292:
[   32.814149]  kasan_save_stack+0x3c/0x68
[   32.814190]  kasan_save_track+0x20/0x40
[   32.814227]  kasan_save_alloc_info+0x40/0x58
[   32.814267]  __kasan_kmalloc+0xd4/0xd8
[   32.814318]  __kmalloc_cache_noprof+0x16c/0x3c0
[   32.814365]  kasan_strings+0xc8/0xb00
[   32.814404]  kunit_try_run_case+0x170/0x3f0
[   32.814442]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.814515]  kthread+0x328/0x630
[   32.814550]  ret_from_fork+0x10/0x20
[   32.814588] 
[   32.814914] Freed by task 292:
[   32.814943]  kasan_save_stack+0x3c/0x68
[   32.814980]  kasan_save_track+0x20/0x40
[   32.815017]  kasan_save_free_info+0x4c/0x78
[   32.815056]  __kasan_slab_free+0x6c/0x98
[   32.815093]  kfree+0x214/0x3c8
[   32.815129]  kasan_strings+0x24c/0xb00
[   32.815169]  kunit_try_run_case+0x170/0x3f0
[   32.815207]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.815250]  kthread+0x328/0x630
[   32.815285]  ret_from_fork+0x10/0x20
[   32.815323] 
[   32.815344] The buggy address belongs to the object at fff00000c9c2cc40
[   32.815344]  which belongs to the cache kmalloc-32 of size 32
[   32.815427] The buggy address is located 16 bytes inside of
[   32.815427]  freed 32-byte region [fff00000c9c2cc40, fff00000c9c2cc60)
[   32.815520] 
[   32.815567] The buggy address belongs to the physical page:
[   32.815614] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109c2c
[   32.815702] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.815765] page_type: f5(slab)
[   32.815841] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   32.815972] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   32.816062] page dumped because: kasan: bad access detected
[   32.816148] 
[   32.816168] Memory state around the buggy address:
[   32.816219]  fff00000c9c2cb00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   32.816550]  fff00000c9c2cb80: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   32.816631] >fff00000c9c2cc00: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   32.816754]                                                  ^
[   32.816823]  fff00000c9c2cc80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   32.816946]  fff00000c9c2cd00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   32.817045] ==================================================================

[   27.205689] ==================================================================
[   27.207192] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   27.207410] Read of size 1 at addr ffff8881060ae110 by task kunit_try_catch/308
[   27.207930] 
[   27.208382] CPU: 1 UID: 0 PID: 308 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250723 #1 PREEMPT(voluntary) 
[   27.208563] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.208583] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.208608] Call Trace:
[   27.208635]  <TASK>
[   27.208655]  dump_stack_lvl+0x73/0xb0
[   27.208695]  print_report+0xd1/0x640
[   27.208720]  ? __virt_addr_valid+0x1db/0x2d0
[   27.208745]  ? strcmp+0xb0/0xc0
[   27.208766]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.208794]  ? strcmp+0xb0/0xc0
[   27.208814]  kasan_report+0x141/0x180
[   27.208835]  ? strcmp+0xb0/0xc0
[   27.208860]  __asan_report_load1_noabort+0x18/0x20
[   27.208886]  strcmp+0xb0/0xc0
[   27.208906]  kasan_strings+0x431/0xe80
[   27.208927]  ? trace_hardirqs_on+0x37/0xe0
[   27.208984]  ? __pfx_kasan_strings+0x10/0x10
[   27.209006]  ? finish_task_switch.isra.0+0x153/0x700
[   27.209027]  ? __switch_to+0x47/0xf80
[   27.209056]  ? __schedule+0x10da/0x2b60
[   27.209080]  ? __pfx_read_tsc+0x10/0x10
[   27.209103]  ? ktime_get_ts64+0x86/0x230
[   27.209128]  kunit_try_run_case+0x1a5/0x480
[   27.209165]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.209187]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   27.209213]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.209238]  ? __kthread_parkme+0x82/0x180
[   27.209258]  ? preempt_count_sub+0x50/0x80
[   27.209281]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.209304]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.209328]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.209351]  kthread+0x337/0x6f0
[   27.209380]  ? trace_preempt_on+0x20/0xc0
[   27.209402]  ? __pfx_kthread+0x10/0x10
[   27.209423]  ? _raw_spin_unlock_irq+0x47/0x80
[   27.209448]  ? calculate_sigpending+0x7b/0xa0
[   27.209472]  ? __pfx_kthread+0x10/0x10
[   27.209493]  ret_from_fork+0x116/0x1d0
[   27.209513]  ? __pfx_kthread+0x10/0x10
[   27.209533]  ret_from_fork_asm+0x1a/0x30
[   27.209565]  </TASK>
[   27.209577] 
[   27.226267] Allocated by task 308:
[   27.226642]  kasan_save_stack+0x45/0x70
[   27.227070]  kasan_save_track+0x18/0x40
[   27.227558]  kasan_save_alloc_info+0x3b/0x50
[   27.228000]  __kasan_kmalloc+0xb7/0xc0
[   27.228138]  __kmalloc_cache_noprof+0x189/0x420
[   27.228303]  kasan_strings+0xc0/0xe80
[   27.228641]  kunit_try_run_case+0x1a5/0x480
[   27.229071]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.229610]  kthread+0x337/0x6f0
[   27.230110]  ret_from_fork+0x116/0x1d0
[   27.230540]  ret_from_fork_asm+0x1a/0x30
[   27.230780] 
[   27.230847] Freed by task 308:
[   27.230958]  kasan_save_stack+0x45/0x70
[   27.231176]  kasan_save_track+0x18/0x40
[   27.231652]  kasan_save_free_info+0x3f/0x60
[   27.232073]  __kasan_slab_free+0x56/0x70
[   27.232439]  kfree+0x222/0x3f0
[   27.232786]  kasan_strings+0x2aa/0xe80
[   27.233226]  kunit_try_run_case+0x1a5/0x480
[   27.233370]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.234100]  kthread+0x337/0x6f0
[   27.234441]  ret_from_fork+0x116/0x1d0
[   27.234891]  ret_from_fork_asm+0x1a/0x30
[   27.235221] 
[   27.235322] The buggy address belongs to the object at ffff8881060ae100
[   27.235322]  which belongs to the cache kmalloc-32 of size 32
[   27.236321] The buggy address is located 16 bytes inside of
[   27.236321]  freed 32-byte region [ffff8881060ae100, ffff8881060ae120)
[   27.237099] 
[   27.237266] The buggy address belongs to the physical page:
[   27.237654] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1060ae
[   27.238159] flags: 0x200000000000000(node=0|zone=2)
[   27.238337] page_type: f5(slab)
[   27.238649] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   27.239401] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   27.240220] page dumped because: kasan: bad access detected
[   27.240734] 
[   27.240884] Memory state around the buggy address:
[   27.241109]  ffff8881060ae000: 00 00 00 04 fc fc fc fc 00 00 07 fc fc fc fc fc
[   27.241915]  ffff8881060ae080: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   27.242307] >ffff8881060ae100: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.242644]                          ^
[   27.243009]  ffff8881060ae180: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   27.243799]  ffff8881060ae200: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.244461] ==================================================================