Hay
Date
July 2, 2025, 11:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   20.421956] ==================================================================
[   20.422317] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   20.422477] Read of size 1 at addr fff00000c58a9390 by task kunit_try_catch/259
[   20.422536] 
[   20.422958] CPU: 0 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   20.423200] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.423434] Hardware name: linux,dummy-virt (DT)
[   20.423528] Call trace:
[   20.423567]  show_stack+0x20/0x38 (C)
[   20.423661]  dump_stack_lvl+0x8c/0xd0
[   20.423716]  print_report+0x118/0x608
[   20.423767]  kasan_report+0xdc/0x128
[   20.424160]  __asan_report_load1_noabort+0x20/0x30
[   20.424239]  strcmp+0xc0/0xc8
[   20.424284]  kasan_strings+0x340/0xb00
[   20.424707]  kunit_try_run_case+0x170/0x3f0
[   20.424788]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.425057]  kthread+0x328/0x630
[   20.425149]  ret_from_fork+0x10/0x20
[   20.425218] 
[   20.425475] Allocated by task 259:
[   20.425566]  kasan_save_stack+0x3c/0x68
[   20.425814]  kasan_save_track+0x20/0x40
[   20.425901]  kasan_save_alloc_info+0x40/0x58
[   20.425992]  __kasan_kmalloc+0xd4/0xd8
[   20.426088]  __kmalloc_cache_noprof+0x16c/0x3c0
[   20.426133]  kasan_strings+0xc8/0xb00
[   20.426325]  kunit_try_run_case+0x170/0x3f0
[   20.426443]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.427026]  kthread+0x328/0x630
[   20.427222]  ret_from_fork+0x10/0x20
[   20.427293] 
[   20.427352] Freed by task 259:
[   20.427486]  kasan_save_stack+0x3c/0x68
[   20.427551]  kasan_save_track+0x20/0x40
[   20.427885]  kasan_save_free_info+0x4c/0x78
[   20.428075]  __kasan_slab_free+0x6c/0x98
[   20.428240]  kfree+0x214/0x3c8
[   20.428286]  kasan_strings+0x24c/0xb00
[   20.428380]  kunit_try_run_case+0x170/0x3f0
[   20.428543]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.428624]  kthread+0x328/0x630
[   20.428660]  ret_from_fork+0x10/0x20
[   20.428710] 
[   20.428755] The buggy address belongs to the object at fff00000c58a9380
[   20.428755]  which belongs to the cache kmalloc-32 of size 32
[   20.429176] The buggy address is located 16 bytes inside of
[   20.429176]  freed 32-byte region [fff00000c58a9380, fff00000c58a93a0)
[   20.429485] 
[   20.429724] The buggy address belongs to the physical page:
[   20.429787] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1058a9
[   20.430159] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.430239] page_type: f5(slab)
[   20.430513] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   20.430801] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   20.430868] page dumped because: kasan: bad access detected
[   20.431038] 
[   20.431187] Memory state around the buggy address:
[   20.431285]  fff00000c58a9280: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   20.431639]  fff00000c58a9300: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   20.431710] >fff00000c58a9380: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   20.431808]                          ^
[   20.431862]  fff00000c58a9400: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   20.431926]  fff00000c58a9480: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   20.432144] ==================================================================

[   13.363427] ==================================================================
[   13.364512] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   13.365063] Read of size 1 at addr ffff888103988590 by task kunit_try_catch/278
[   13.365334] 
[   13.365464] CPU: 1 UID: 0 PID: 278 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.365516] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.365530] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.365552] Call Trace:
[   13.365563]  <TASK>
[   13.365581]  dump_stack_lvl+0x73/0xb0
[   13.365783]  print_report+0xd1/0x650
[   13.365817]  ? __virt_addr_valid+0x1db/0x2d0
[   13.365842]  ? strcmp+0xb0/0xc0
[   13.365862]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.365884]  ? strcmp+0xb0/0xc0
[   13.365904]  kasan_report+0x141/0x180
[   13.365926]  ? strcmp+0xb0/0xc0
[   13.365959]  __asan_report_load1_noabort+0x18/0x20
[   13.365982]  strcmp+0xb0/0xc0
[   13.366004]  kasan_strings+0x431/0xe80
[   13.366024]  ? trace_hardirqs_on+0x37/0xe0
[   13.366048]  ? __pfx_kasan_strings+0x10/0x10
[   13.366069]  ? finish_task_switch.isra.0+0x153/0x700
[   13.366091]  ? __switch_to+0x47/0xf50
[   13.366117]  ? __schedule+0x10cc/0x2b60
[   13.366139]  ? __pfx_read_tsc+0x10/0x10
[   13.366159]  ? ktime_get_ts64+0x86/0x230
[   13.366183]  kunit_try_run_case+0x1a5/0x480
[   13.366210]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.366231]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.366254]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.366276]  ? __kthread_parkme+0x82/0x180
[   13.366299]  ? preempt_count_sub+0x50/0x80
[   13.366321]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.366344]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.366382]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.366405]  kthread+0x337/0x6f0
[   13.366424]  ? trace_preempt_on+0x20/0xc0
[   13.366445]  ? __pfx_kthread+0x10/0x10
[   13.366466]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.366485]  ? calculate_sigpending+0x7b/0xa0
[   13.366508]  ? __pfx_kthread+0x10/0x10
[   13.366529]  ret_from_fork+0x116/0x1d0
[   13.366546]  ? __pfx_kthread+0x10/0x10
[   13.366565]  ret_from_fork_asm+0x1a/0x30
[   13.366608]  </TASK>
[   13.366620] 
[   13.374184] Allocated by task 278:
[   13.374322]  kasan_save_stack+0x45/0x70
[   13.374885]  kasan_save_track+0x18/0x40
[   13.375099]  kasan_save_alloc_info+0x3b/0x50
[   13.375315]  __kasan_kmalloc+0xb7/0xc0
[   13.375527]  __kmalloc_cache_noprof+0x189/0x420
[   13.375955]  kasan_strings+0xc0/0xe80
[   13.376092]  kunit_try_run_case+0x1a5/0x480
[   13.376262]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.376535]  kthread+0x337/0x6f0
[   13.376715]  ret_from_fork+0x116/0x1d0
[   13.376989]  ret_from_fork_asm+0x1a/0x30
[   13.377169] 
[   13.377251] Freed by task 278:
[   13.377402]  kasan_save_stack+0x45/0x70
[   13.377540]  kasan_save_track+0x18/0x40
[   13.377674]  kasan_save_free_info+0x3f/0x60
[   13.377822]  __kasan_slab_free+0x56/0x70
[   13.378006]  kfree+0x222/0x3f0
[   13.378168]  kasan_strings+0x2aa/0xe80
[   13.378423]  kunit_try_run_case+0x1a5/0x480
[   13.378998]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.379279]  kthread+0x337/0x6f0
[   13.379416]  ret_from_fork+0x116/0x1d0
[   13.379548]  ret_from_fork_asm+0x1a/0x30
[   13.379863] 
[   13.379962] The buggy address belongs to the object at ffff888103988580
[   13.379962]  which belongs to the cache kmalloc-32 of size 32
[   13.380511] The buggy address is located 16 bytes inside of
[   13.380511]  freed 32-byte region [ffff888103988580, ffff8881039885a0)
[   13.381018] 
[   13.381095] The buggy address belongs to the physical page:
[   13.381297] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103988
[   13.381660] flags: 0x200000000000000(node=0|zone=2)
[   13.381994] page_type: f5(slab)
[   13.382173] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.382493] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.382719] page dumped because: kasan: bad access detected
[   13.382920] 
[   13.383039] Memory state around the buggy address:
[   13.383409]  ffff888103988480: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.383724]  ffff888103988500: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   13.384093] >ffff888103988580: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.384370]                          ^
[   13.384529]  ffff888103988600: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.384871]  ffff888103988680: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.385130] ==================================================================