Hay
Date
June 18, 2025, 6:43 a.m.

Environment
qemu-arm64
qemu-x86_64

[   23.324721] ==================================================================
[   23.324843] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   23.324977] Read of size 1 at addr fff00000c605c810 by task kunit_try_catch/269
[   23.325109] 
[   23.325195] CPU: 0 UID: 0 PID: 269 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc2-next-20250618 #1 PREEMPT 
[   23.325487] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   23.325566] Hardware name: linux,dummy-virt (DT)
[   23.325641] Call trace:
[   23.325703]  show_stack+0x20/0x38 (C)
[   23.325841]  dump_stack_lvl+0x8c/0xd0
[   23.325963]  print_report+0x118/0x608
[   23.326138]  kasan_report+0xdc/0x128
[   23.326278]  __asan_report_load1_noabort+0x20/0x30
[   23.326421]  strnlen+0x80/0x88
[   23.326573]  kasan_strings+0x478/0xb00
[   23.326729]  kunit_try_run_case+0x170/0x3f0
[   23.326889]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.327083]  kthread+0x328/0x630
[   23.327187]  ret_from_fork+0x10/0x20
[   23.327308] 
[   23.327352] Allocated by task 269:
[   23.327420]  kasan_save_stack+0x3c/0x68
[   23.327525]  kasan_save_track+0x20/0x40
[   23.327623]  kasan_save_alloc_info+0x40/0x58
[   23.327720]  __kasan_kmalloc+0xd4/0xd8
[   23.327798]  __kmalloc_cache_noprof+0x16c/0x3c0
[   23.327890]  kasan_strings+0xc8/0xb00
[   23.328032]  kunit_try_run_case+0x170/0x3f0
[   23.328208]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.328361]  kthread+0x328/0x630
[   23.328452]  ret_from_fork+0x10/0x20
[   23.328553] 
[   23.328607] Freed by task 269:
[   23.328678]  kasan_save_stack+0x3c/0x68
[   23.328784]  kasan_save_track+0x20/0x40
[   23.328914]  kasan_save_free_info+0x4c/0x78
[   23.329029]  __kasan_slab_free+0x6c/0x98
[   23.329134]  kfree+0x214/0x3c8
[   23.329223]  kasan_strings+0x24c/0xb00
[   23.329314]  kunit_try_run_case+0x170/0x3f0
[   23.329422]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.329537]  kthread+0x328/0x630
[   23.329626]  ret_from_fork+0x10/0x20
[   23.329722] 
[   23.329782] The buggy address belongs to the object at fff00000c605c800
[   23.329782]  which belongs to the cache kmalloc-32 of size 32
[   23.329921] The buggy address is located 16 bytes inside of
[   23.329921]  freed 32-byte region [fff00000c605c800, fff00000c605c820)
[   23.330100] 
[   23.330151] The buggy address belongs to the physical page:
[   23.330222] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10605c
[   23.330353] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   23.330472] page_type: f5(slab)
[   23.330574] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   23.330707] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   23.330814] page dumped because: kasan: bad access detected
[   23.330894] 
[   23.330935] Memory state around the buggy address:
[   23.331002]  fff00000c605c700: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   23.331098]  fff00000c605c780: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   23.331221] >fff00000c605c800: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   23.331343]                          ^
[   23.331427]  fff00000c605c880: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   23.331610]  fff00000c605c900: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   23.331770] ==================================================================

[   13.157599] ==================================================================
[   13.157973] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   13.158388] Read of size 1 at addr ffff88810262ad90 by task kunit_try_catch/285
[   13.158943] 
[   13.159130] CPU: 0 UID: 0 PID: 285 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250618 #1 PREEMPT(voluntary) 
[   13.159310] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.159327] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.159349] Call Trace:
[   13.159364]  <TASK>
[   13.159379]  dump_stack_lvl+0x73/0xb0
[   13.159409]  print_report+0xd1/0x650
[   13.159462]  ? __virt_addr_valid+0x1db/0x2d0
[   13.159486]  ? strnlen+0x73/0x80
[   13.159506]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.159531]  ? strnlen+0x73/0x80
[   13.159551]  kasan_report+0x141/0x180
[   13.159572]  ? strnlen+0x73/0x80
[   13.159596]  __asan_report_load1_noabort+0x18/0x20
[   13.159619]  strnlen+0x73/0x80
[   13.159640]  kasan_strings+0x615/0xe80
[   13.159659]  ? trace_hardirqs_on+0x37/0xe0
[   13.159680]  ? __pfx_kasan_strings+0x10/0x10
[   13.159700]  ? finish_task_switch.isra.0+0x153/0x700
[   13.159721]  ? __switch_to+0x47/0xf50
[   13.159744]  ? __schedule+0x10cc/0x2b60
[   13.159767]  ? __pfx_read_tsc+0x10/0x10
[   13.159787]  ? ktime_get_ts64+0x86/0x230
[   13.159812]  kunit_try_run_case+0x1a5/0x480
[   13.159834]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.159856]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.159878]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.159900]  ? __kthread_parkme+0x82/0x180
[   13.159920]  ? preempt_count_sub+0x50/0x80
[   13.159942]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.159964]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.159986]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.160009]  kthread+0x337/0x6f0
[   13.160028]  ? trace_preempt_on+0x20/0xc0
[   13.160049]  ? __pfx_kthread+0x10/0x10
[   13.160069]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.160088]  ? calculate_sigpending+0x7b/0xa0
[   13.160111]  ? __pfx_kthread+0x10/0x10
[   13.160131]  ret_from_fork+0x116/0x1d0
[   13.160149]  ? __pfx_kthread+0x10/0x10
[   13.160192]  ret_from_fork_asm+0x1a/0x30
[   13.160231]  </TASK>
[   13.160242] 
[   13.167301] Allocated by task 285:
[   13.167477]  kasan_save_stack+0x45/0x70
[   13.167620]  kasan_save_track+0x18/0x40
[   13.167747]  kasan_save_alloc_info+0x3b/0x50
[   13.167888]  __kasan_kmalloc+0xb7/0xc0
[   13.168030]  __kmalloc_cache_noprof+0x189/0x420
[   13.168276]  kasan_strings+0xc0/0xe80
[   13.168454]  kunit_try_run_case+0x1a5/0x480
[   13.168660]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.168902]  kthread+0x337/0x6f0
[   13.169057]  ret_from_fork+0x116/0x1d0
[   13.169273]  ret_from_fork_asm+0x1a/0x30
[   13.169463] 
[   13.169548] Freed by task 285:
[   13.169674]  kasan_save_stack+0x45/0x70
[   13.169854]  kasan_save_track+0x18/0x40
[   13.170012]  kasan_save_free_info+0x3f/0x60
[   13.170233]  __kasan_slab_free+0x56/0x70
[   13.170405]  kfree+0x222/0x3f0
[   13.170550]  kasan_strings+0x2aa/0xe80
[   13.170699]  kunit_try_run_case+0x1a5/0x480
[   13.170889]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.171097]  kthread+0x337/0x6f0
[   13.171287]  ret_from_fork+0x116/0x1d0
[   13.171436]  ret_from_fork_asm+0x1a/0x30
[   13.171616] 
[   13.171689] The buggy address belongs to the object at ffff88810262ad80
[   13.171689]  which belongs to the cache kmalloc-32 of size 32
[   13.172138] The buggy address is located 16 bytes inside of
[   13.172138]  freed 32-byte region [ffff88810262ad80, ffff88810262ada0)
[   13.172501] 
[   13.172565] The buggy address belongs to the physical page:
[   13.172736] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10262a
[   13.173012] flags: 0x200000000000000(node=0|zone=2)
[   13.173271] page_type: f5(slab)
[   13.173426] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.173749] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.174039] page dumped because: kasan: bad access detected
[   13.174234] 
[   13.174296] Memory state around the buggy address:
[   13.174444]  ffff88810262ac80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.174654]  ffff88810262ad00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.174869] >ffff88810262ad80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.175194]                          ^
[   13.175384]  ffff88810262ae00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.175697]  ffff88810262ae80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.176011] ==================================================================