Hay
Date
July 5, 2025, 11:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   20.475633] ==================================================================
[   20.476076] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   20.476163] Read of size 1 at addr fff00000c78cc650 by task kunit_try_catch/259
[   20.476216] 
[   20.476247] CPU: 0 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   20.476741] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.476785] Hardware name: linux,dummy-virt (DT)
[   20.476817] Call trace:
[   20.476896]  show_stack+0x20/0x38 (C)
[   20.477087]  dump_stack_lvl+0x8c/0xd0
[   20.477160]  print_report+0x118/0x608
[   20.477294]  kasan_report+0xdc/0x128
[   20.477392]  __asan_report_load1_noabort+0x20/0x30
[   20.477445]  strnlen+0x80/0x88
[   20.477489]  kasan_strings+0x478/0xb00
[   20.477554]  kunit_try_run_case+0x170/0x3f0
[   20.477630]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.477703]  kthread+0x328/0x630
[   20.477847]  ret_from_fork+0x10/0x20
[   20.477944] 
[   20.477998] Allocated by task 259:
[   20.478047]  kasan_save_stack+0x3c/0x68
[   20.478140]  kasan_save_track+0x20/0x40
[   20.478188]  kasan_save_alloc_info+0x40/0x58
[   20.478230]  __kasan_kmalloc+0xd4/0xd8
[   20.478312]  __kmalloc_cache_noprof+0x16c/0x3c0
[   20.478359]  kasan_strings+0xc8/0xb00
[   20.479197]  kunit_try_run_case+0x170/0x3f0
[   20.479406]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.479573]  kthread+0x328/0x630
[   20.479673]  ret_from_fork+0x10/0x20
[   20.479834] 
[   20.479860] Freed by task 259:
[   20.480181]  kasan_save_stack+0x3c/0x68
[   20.480310]  kasan_save_track+0x20/0x40
[   20.480376]  kasan_save_free_info+0x4c/0x78
[   20.480418]  __kasan_slab_free+0x6c/0x98
[   20.480458]  kfree+0x214/0x3c8
[   20.480493]  kasan_strings+0x24c/0xb00
[   20.480560]  kunit_try_run_case+0x170/0x3f0
[   20.480599]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.480684]  kthread+0x328/0x630
[   20.480967]  ret_from_fork+0x10/0x20
[   20.481015] 
[   20.481036] The buggy address belongs to the object at fff00000c78cc640
[   20.481036]  which belongs to the cache kmalloc-32 of size 32
[   20.481258] The buggy address is located 16 bytes inside of
[   20.481258]  freed 32-byte region [fff00000c78cc640, fff00000c78cc660)
[   20.481600] 
[   20.481624] The buggy address belongs to the physical page:
[   20.481658] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078cc
[   20.481712] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.482008] page_type: f5(slab)
[   20.482179] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   20.482238] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   20.482366] page dumped because: kasan: bad access detected
[   20.482462] 
[   20.482517] Memory state around the buggy address:
[   20.482567]  fff00000c78cc500: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   20.482613]  fff00000c78cc580: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   20.482657] >fff00000c78cc600: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   20.482915]                                                  ^
[   20.482964]  fff00000c78cc680: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   20.483049]  fff00000c78cc700: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   20.483116] ==================================================================

[   15.794687] ==================================================================
[   15.795112] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   15.795456] Read of size 1 at addr ffff888102a0d790 by task kunit_try_catch/277
[   15.795964] 
[   15.796079] CPU: 1 UID: 0 PID: 277 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   15.796131] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.796146] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   15.796173] Call Trace:
[   15.796196]  <TASK>
[   15.796216]  dump_stack_lvl+0x73/0xb0
[   15.796252]  print_report+0xd1/0x650
[   15.796279]  ? __virt_addr_valid+0x1db/0x2d0
[   15.796305]  ? strnlen+0x73/0x80
[   15.796326]  ? kasan_complete_mode_report_info+0x64/0x200
[   15.796351]  ? strnlen+0x73/0x80
[   15.796372]  kasan_report+0x141/0x180
[   15.796398]  ? strnlen+0x73/0x80
[   15.796423]  __asan_report_load1_noabort+0x18/0x20
[   15.796451]  strnlen+0x73/0x80
[   15.796472]  kasan_strings+0x615/0xe80
[   15.796496]  ? trace_hardirqs_on+0x37/0xe0
[   15.796523]  ? __pfx_kasan_strings+0x10/0x10
[   15.796599]  ? finish_task_switch.isra.0+0x153/0x700
[   15.796628]  ? __switch_to+0x47/0xf50
[   15.796658]  ? __schedule+0x10cc/0x2b60
[   15.796685]  ? __pfx_read_tsc+0x10/0x10
[   15.796710]  ? ktime_get_ts64+0x86/0x230
[   15.796738]  kunit_try_run_case+0x1a5/0x480
[   15.796766]  ? __pfx_kunit_try_run_case+0x10/0x10
[   15.796804]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   15.796832]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   15.796859]  ? __kthread_parkme+0x82/0x180
[   15.796881]  ? preempt_count_sub+0x50/0x80
[   15.796908]  ? __pfx_kunit_try_run_case+0x10/0x10
[   15.796935]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   15.796961]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   15.796988]  kthread+0x337/0x6f0
[   15.797011]  ? trace_preempt_on+0x20/0xc0
[   15.797036]  ? __pfx_kthread+0x10/0x10
[   15.797060]  ? _raw_spin_unlock_irq+0x47/0x80
[   15.797086]  ? calculate_sigpending+0x7b/0xa0
[   15.797114]  ? __pfx_kthread+0x10/0x10
[   15.797140]  ret_from_fork+0x116/0x1d0
[   15.797161]  ? __pfx_kthread+0x10/0x10
[   15.797185]  ret_from_fork_asm+0x1a/0x30
[   15.797222]  </TASK>
[   15.797236] 
[   15.807342] Allocated by task 277:
[   15.807573]  kasan_save_stack+0x45/0x70
[   15.807817]  kasan_save_track+0x18/0x40
[   15.808000]  kasan_save_alloc_info+0x3b/0x50
[   15.808344]  __kasan_kmalloc+0xb7/0xc0
[   15.808522]  __kmalloc_cache_noprof+0x189/0x420
[   15.808775]  kasan_strings+0xc0/0xe80
[   15.808943]  kunit_try_run_case+0x1a5/0x480
[   15.809328]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   15.809646]  kthread+0x337/0x6f0
[   15.809864]  ret_from_fork+0x116/0x1d0
[   15.810085]  ret_from_fork_asm+0x1a/0x30
[   15.810358] 
[   15.810475] Freed by task 277:
[   15.810652]  kasan_save_stack+0x45/0x70
[   15.810830]  kasan_save_track+0x18/0x40
[   15.811017]  kasan_save_free_info+0x3f/0x60
[   15.811461]  __kasan_slab_free+0x56/0x70
[   15.811714]  kfree+0x222/0x3f0
[   15.811924]  kasan_strings+0x2aa/0xe80
[   15.812218]  kunit_try_run_case+0x1a5/0x480
[   15.812437]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   15.812639]  kthread+0x337/0x6f0
[   15.812779]  ret_from_fork+0x116/0x1d0
[   15.813012]  ret_from_fork_asm+0x1a/0x30
[   15.813237] 
[   15.813356] The buggy address belongs to the object at ffff888102a0d780
[   15.813356]  which belongs to the cache kmalloc-32 of size 32
[   15.814260] The buggy address is located 16 bytes inside of
[   15.814260]  freed 32-byte region [ffff888102a0d780, ffff888102a0d7a0)
[   15.814767] 
[   15.814900] The buggy address belongs to the physical page:
[   15.815169] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a0d
[   15.815536] flags: 0x200000000000000(node=0|zone=2)
[   15.815770] page_type: f5(slab)
[   15.816068] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   15.816532] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   15.816948] page dumped because: kasan: bad access detected
[   15.817216] 
[   15.817550] Memory state around the buggy address:
[   15.817779]  ffff888102a0d680: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   15.818052]  ffff888102a0d700: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   15.818429] >ffff888102a0d780: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   15.818833]                          ^
[   15.819024]  ffff888102a0d800: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   15.819490]  ffff888102a0d880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   15.819890] ==================================================================