Hay
Date
July 1, 2025, 12:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   19.721123] ==================================================================
[   19.721329] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   19.721518] Read of size 1 at addr fff00000c79f3950 by task kunit_try_catch/259
[   19.721578] 
[   19.721612] CPU: 0 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   19.722057] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.722181] Hardware name: linux,dummy-virt (DT)
[   19.722375] Call trace:
[   19.722411]  show_stack+0x20/0x38 (C)
[   19.722482]  dump_stack_lvl+0x8c/0xd0
[   19.722696]  print_report+0x118/0x608
[   19.722889]  kasan_report+0xdc/0x128
[   19.723013]  __asan_report_load1_noabort+0x20/0x30
[   19.723071]  strnlen+0x80/0x88
[   19.723294]  kasan_strings+0x478/0xb00
[   19.723347]  kunit_try_run_case+0x170/0x3f0
[   19.723404]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.723608]  kthread+0x328/0x630
[   19.723816]  ret_from_fork+0x10/0x20
[   19.724159] 
[   19.724295] Allocated by task 259:
[   19.724352]  kasan_save_stack+0x3c/0x68
[   19.724581]  kasan_save_track+0x20/0x40
[   19.725051]  kasan_save_alloc_info+0x40/0x58
[   19.725125]  __kasan_kmalloc+0xd4/0xd8
[   19.725181]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.725225]  kasan_strings+0xc8/0xb00
[   19.725305]  kunit_try_run_case+0x170/0x3f0
[   19.725368]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.725417]  kthread+0x328/0x630
[   19.725463]  ret_from_fork+0x10/0x20
[   19.725512] 
[   19.725541] Freed by task 259:
[   19.725592]  kasan_save_stack+0x3c/0x68
[   19.725642]  kasan_save_track+0x20/0x40
[   19.725690]  kasan_save_free_info+0x4c/0x78
[   19.725733]  __kasan_slab_free+0x6c/0x98
[   19.725774]  kfree+0x214/0x3c8
[   19.725810]  kasan_strings+0x24c/0xb00
[   19.725848]  kunit_try_run_case+0x170/0x3f0
[   19.725897]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.725953]  kthread+0x328/0x630
[   19.725996]  ret_from_fork+0x10/0x20
[   19.726046] 
[   19.726077] The buggy address belongs to the object at fff00000c79f3940
[   19.726077]  which belongs to the cache kmalloc-32 of size 32
[   19.726160] The buggy address is located 16 bytes inside of
[   19.726160]  freed 32-byte region [fff00000c79f3940, fff00000c79f3960)
[   19.726225] 
[   19.726253] The buggy address belongs to the physical page:
[   19.726303] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1079f3
[   19.726375] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.726440] page_type: f5(slab)
[   19.726488] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   19.726541] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   19.726594] page dumped because: kasan: bad access detected
[   19.726639] 
[   19.726660] Memory state around the buggy address:
[   19.726701]  fff00000c79f3800: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.726762]  fff00000c79f3880: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   19.726814] >fff00000c79f3900: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   19.726867]                                                  ^
[   19.726907]  fff00000c79f3980: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   19.726953]  fff00000c79f3a00: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   19.727296] ==================================================================

[   13.397066] ==================================================================
[   13.397650] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   13.397938] Read of size 1 at addr ffff888103124410 by task kunit_try_catch/276
[   13.398355] 
[   13.398460] CPU: 0 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.398504] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.398517] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.398537] Call Trace:
[   13.398551]  <TASK>
[   13.398567]  dump_stack_lvl+0x73/0xb0
[   13.398591]  print_report+0xd1/0x650
[   13.398612]  ? __virt_addr_valid+0x1db/0x2d0
[   13.398634]  ? strnlen+0x73/0x80
[   13.398650]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.398671]  ? strnlen+0x73/0x80
[   13.398689]  kasan_report+0x141/0x180
[   13.398709]  ? strnlen+0x73/0x80
[   13.398730]  __asan_report_load1_noabort+0x18/0x20
[   13.398754]  strnlen+0x73/0x80
[   13.398771]  kasan_strings+0x615/0xe80
[   13.398790]  ? trace_hardirqs_on+0x37/0xe0
[   13.398811]  ? __pfx_kasan_strings+0x10/0x10
[   13.398831]  ? finish_task_switch.isra.0+0x153/0x700
[   13.398851]  ? __switch_to+0x47/0xf50
[   13.398874]  ? __schedule+0x10cc/0x2b60
[   13.398895]  ? __pfx_read_tsc+0x10/0x10
[   13.398915]  ? ktime_get_ts64+0x86/0x230
[   13.398937]  kunit_try_run_case+0x1a5/0x480
[   13.398960]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.398982]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.399003]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.399036]  ? __kthread_parkme+0x82/0x180
[   13.399059]  ? preempt_count_sub+0x50/0x80
[   13.399081]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.399104]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.399126]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.399149]  kthread+0x337/0x6f0
[   13.399167]  ? trace_preempt_on+0x20/0xc0
[   13.399188]  ? __pfx_kthread+0x10/0x10
[   13.399208]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.399227]  ? calculate_sigpending+0x7b/0xa0
[   13.399249]  ? __pfx_kthread+0x10/0x10
[   13.399270]  ret_from_fork+0x116/0x1d0
[   13.399286]  ? __pfx_kthread+0x10/0x10
[   13.399305]  ret_from_fork_asm+0x1a/0x30
[   13.399335]  </TASK>
[   13.399345] 
[   13.406480] Allocated by task 276:
[   13.406657]  kasan_save_stack+0x45/0x70
[   13.406814]  kasan_save_track+0x18/0x40
[   13.406997]  kasan_save_alloc_info+0x3b/0x50
[   13.407256]  __kasan_kmalloc+0xb7/0xc0
[   13.407431]  __kmalloc_cache_noprof+0x189/0x420
[   13.407605]  kasan_strings+0xc0/0xe80
[   13.407737]  kunit_try_run_case+0x1a5/0x480
[   13.407879]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.408070]  kthread+0x337/0x6f0
[   13.408247]  ret_from_fork+0x116/0x1d0
[   13.408433]  ret_from_fork_asm+0x1a/0x30
[   13.408625] 
[   13.408715] Freed by task 276:
[   13.408864]  kasan_save_stack+0x45/0x70
[   13.408998]  kasan_save_track+0x18/0x40
[   13.409247]  kasan_save_free_info+0x3f/0x60
[   13.409454]  __kasan_slab_free+0x56/0x70
[   13.409605]  kfree+0x222/0x3f0
[   13.409721]  kasan_strings+0x2aa/0xe80
[   13.409851]  kunit_try_run_case+0x1a5/0x480
[   13.410074]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.410557]  kthread+0x337/0x6f0
[   13.410723]  ret_from_fork+0x116/0x1d0
[   13.410882]  ret_from_fork_asm+0x1a/0x30
[   13.411065] 
[   13.411143] The buggy address belongs to the object at ffff888103124400
[   13.411143]  which belongs to the cache kmalloc-32 of size 32
[   13.411642] The buggy address is located 16 bytes inside of
[   13.411642]  freed 32-byte region [ffff888103124400, ffff888103124420)
[   13.412089] 
[   13.412172] The buggy address belongs to the physical page:
[   13.412344] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103124
[   13.412581] flags: 0x200000000000000(node=0|zone=2)
[   13.412740] page_type: f5(slab)
[   13.412858] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.413095] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.413318] page dumped because: kasan: bad access detected
[   13.413486] 
[   13.413555] Memory state around the buggy address:
[   13.413707]  ffff888103124300: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.414202]  ffff888103124380: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.414516] >ffff888103124400: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.414829]                          ^
[   13.415010]  ffff888103124480: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.415336]  ffff888103124500: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.415645] ==================================================================