Hay
Date
June 17, 2025, 6:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   19.229288] ==================================================================
[   19.229350] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   19.229411] Read of size 1 at addr fff00000c5211590 by task kunit_try_catch/268
[   19.229464] 
[   19.229502] CPU: 1 UID: 0 PID: 268 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250617 #1 PREEMPT 
[   19.229658] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.229900] Hardware name: linux,dummy-virt (DT)
[   19.230304] Call trace:
[   19.230460]  show_stack+0x20/0x38 (C)
[   19.230527]  dump_stack_lvl+0x8c/0xd0
[   19.230578]  print_report+0x118/0x608
[   19.230631]  kasan_report+0xdc/0x128
[   19.230680]  __asan_report_load1_noabort+0x20/0x30
[   19.230729]  strcmp+0xc0/0xc8
[   19.230797]  kasan_strings+0x340/0xb00
[   19.230873]  kunit_try_run_case+0x170/0x3f0
[   19.231331]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.231484]  kthread+0x328/0x630
[   19.231551]  ret_from_fork+0x10/0x20
[   19.231703] 
[   19.231732] Allocated by task 268:
[   19.231763]  kasan_save_stack+0x3c/0x68
[   19.232030]  kasan_save_track+0x20/0x40
[   19.232120]  kasan_save_alloc_info+0x40/0x58
[   19.232210]  __kasan_kmalloc+0xd4/0xd8
[   19.232253]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.232298]  kasan_strings+0xc8/0xb00
[   19.232337]  kunit_try_run_case+0x170/0x3f0
[   19.232378]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.232424]  kthread+0x328/0x630
[   19.232470]  ret_from_fork+0x10/0x20
[   19.232509] 
[   19.232531] Freed by task 268:
[   19.232660]  kasan_save_stack+0x3c/0x68
[   19.232702]  kasan_save_track+0x20/0x40
[   19.232742]  kasan_save_free_info+0x4c/0x78
[   19.232780]  __kasan_slab_free+0x6c/0x98
[   19.233280]  kfree+0x214/0x3c8
[   19.233320]  kasan_strings+0x24c/0xb00
[   19.233360]  kunit_try_run_case+0x170/0x3f0
[   19.233401]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.233852]  kthread+0x328/0x630
[   19.233954]  ret_from_fork+0x10/0x20
[   19.234056] 
[   19.234084] The buggy address belongs to the object at fff00000c5211580
[   19.234084]  which belongs to the cache kmalloc-32 of size 32
[   19.234303] The buggy address is located 16 bytes inside of
[   19.234303]  freed 32-byte region [fff00000c5211580, fff00000c52115a0)
[   19.234462] 
[   19.234494] The buggy address belongs to the physical page:
[   19.234580] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105211
[   19.234639] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.234691] page_type: f5(slab)
[   19.234735] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   19.234790] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   19.234835] page dumped because: kasan: bad access detected
[   19.234880] 
[   19.234945] Memory state around the buggy address:
[   19.234980]  fff00000c5211480: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.235061]  fff00000c5211500: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   19.235107] >fff00000c5211580: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   19.235536]                          ^
[   19.235788]  fff00000c5211600: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.235961]  fff00000c5211680: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   19.236004] ==================================================================

[   20.799113] ==================================================================
[   20.801709] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   20.802243] Read of size 1 at addr ffff88810383f710 by task kunit_try_catch/286
[   20.803059] 
[   20.803349] CPU: 1 UID: 0 PID: 286 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250617 #1 PREEMPT(voluntary) 
[   20.803648] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.803692] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   20.803753] Call Trace:
[   20.803776]  <TASK>
[   20.803800]  dump_stack_lvl+0x73/0xb0
[   20.803869]  print_report+0xd1/0x650
[   20.803944]  ? __virt_addr_valid+0x1db/0x2d0
[   20.804017]  ? strcmp+0xb0/0xc0
[   20.804109]  ? kasan_complete_mode_report_info+0x64/0x200
[   20.804211]  ? strcmp+0xb0/0xc0
[   20.804284]  kasan_report+0x141/0x180
[   20.804401]  ? strcmp+0xb0/0xc0
[   20.804486]  __asan_report_load1_noabort+0x18/0x20
[   20.804558]  strcmp+0xb0/0xc0
[   20.804630]  kasan_strings+0x431/0xe80
[   20.804701]  ? trace_hardirqs_on+0x37/0xe0
[   20.804786]  ? __pfx_kasan_strings+0x10/0x10
[   20.804876]  ? finish_task_switch.isra.0+0x153/0x700
[   20.804949]  ? __switch_to+0x47/0xf50
[   20.804990]  ? __schedule+0x10cc/0x2b60
[   20.805022]  ? __pfx_read_tsc+0x10/0x10
[   20.805052]  ? ktime_get_ts64+0x86/0x230
[   20.805087]  kunit_try_run_case+0x1a5/0x480
[   20.805122]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.805155]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   20.805183]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   20.805232]  ? __kthread_parkme+0x82/0x180
[   20.805306]  ? preempt_count_sub+0x50/0x80
[   20.805366]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.805403]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.805439]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   20.805473]  kthread+0x337/0x6f0
[   20.805502]  ? trace_preempt_on+0x20/0xc0
[   20.805534]  ? __pfx_kthread+0x10/0x10
[   20.805562]  ? _raw_spin_unlock_irq+0x47/0x80
[   20.805598]  ? calculate_sigpending+0x7b/0xa0
[   20.805635]  ? __pfx_kthread+0x10/0x10
[   20.805667]  ret_from_fork+0x116/0x1d0
[   20.805694]  ? __pfx_kthread+0x10/0x10
[   20.805724]  ret_from_fork_asm+0x1a/0x30
[   20.805767]  </TASK>
[   20.805783] 
[   20.823489] Allocated by task 286:
[   20.823888]  kasan_save_stack+0x45/0x70
[   20.824322]  kasan_save_track+0x18/0x40
[   20.824703]  kasan_save_alloc_info+0x3b/0x50
[   20.825500]  __kasan_kmalloc+0xb7/0xc0
[   20.825957]  __kmalloc_cache_noprof+0x189/0x420
[   20.826802]  kasan_strings+0xc0/0xe80
[   20.827449]  kunit_try_run_case+0x1a5/0x480
[   20.827904]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.828692]  kthread+0x337/0x6f0
[   20.829072]  ret_from_fork+0x116/0x1d0
[   20.829620]  ret_from_fork_asm+0x1a/0x30
[   20.830087] 
[   20.830326] Freed by task 286:
[   20.830649]  kasan_save_stack+0x45/0x70
[   20.831447]  kasan_save_track+0x18/0x40
[   20.832003]  kasan_save_free_info+0x3f/0x60
[   20.832443]  __kasan_slab_free+0x56/0x70
[   20.832806]  kfree+0x222/0x3f0
[   20.833164]  kasan_strings+0x2aa/0xe80
[   20.833530]  kunit_try_run_case+0x1a5/0x480
[   20.834148]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.834580]  kthread+0x337/0x6f0
[   20.834912]  ret_from_fork+0x116/0x1d0
[   20.835264]  ret_from_fork_asm+0x1a/0x30
[   20.835634] 
[   20.835818] The buggy address belongs to the object at ffff88810383f700
[   20.835818]  which belongs to the cache kmalloc-32 of size 32
[   20.838462] The buggy address is located 16 bytes inside of
[   20.838462]  freed 32-byte region [ffff88810383f700, ffff88810383f720)
[   20.840178] 
[   20.840646] The buggy address belongs to the physical page:
[   20.841193] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10383f
[   20.841455] flags: 0x200000000000000(node=0|zone=2)
[   20.841629] page_type: f5(slab)
[   20.841762] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   20.843588] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   20.844341] page dumped because: kasan: bad access detected
[   20.844789] 
[   20.844973] Memory state around the buggy address:
[   20.845403]  ffff88810383f600: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   20.846141]  ffff88810383f680: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   20.846768] >ffff88810383f700: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   20.847725]                          ^
[   20.848128]  ffff88810383f780: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   20.848794]  ffff88810383f800: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   20.849557] ==================================================================