Hay
Date
April 20, 2025, 11:09 p.m.

Environment
qemu-x86_64
rk3399-rock-pi-4b

[   13.482953] ==================================================================
[   13.483249] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   13.483459] Read of size 1 at addr ffff888102757490 by task kunit_try_catch/279
[   13.483973] 
[   13.484099] CPU: 0 UID: 0 PID: 279 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc3 #1 PREEMPT(voluntary) 
[   13.484145] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.484157] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.484178] Call Trace:
[   13.484192]  <TASK>
[   13.484208]  dump_stack_lvl+0x73/0xb0
[   13.484233]  print_report+0xd1/0x650
[   13.484270]  ? __virt_addr_valid+0x1db/0x2d0
[   13.484292]  ? strnlen+0x73/0x80
[   13.484310]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.484345]  ? strnlen+0x73/0x80
[   13.484365]  kasan_report+0x141/0x180
[   13.484387]  ? strnlen+0x73/0x80
[   13.484457]  __asan_report_load1_noabort+0x18/0x20
[   13.484482]  strnlen+0x73/0x80
[   13.484501]  kasan_strings+0x615/0xe80
[   13.484522]  ? trace_hardirqs_on+0x37/0xe0
[   13.484544]  ? __pfx_kasan_strings+0x10/0x10
[   13.484564]  ? finish_task_switch.isra.0+0x153/0x700
[   13.484586]  ? __switch_to+0x5d9/0xf60
[   13.484606]  ? dequeue_task_fair+0x156/0x4e0
[   13.484631]  ? __schedule+0x10cc/0x2b30
[   13.484654]  ? __pfx_read_tsc+0x10/0x10
[   13.484673]  ? ktime_get_ts64+0x86/0x230
[   13.484697]  kunit_try_run_case+0x1a5/0x480
[   13.484720]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.484741]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.484764]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.484788]  ? __kthread_parkme+0x82/0x180
[   13.484809]  ? preempt_count_sub+0x50/0x80
[   13.484833]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.484855]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.484878]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.484900]  kthread+0x337/0x6f0
[   13.484920]  ? trace_preempt_on+0x20/0xc0
[   13.484942]  ? __pfx_kthread+0x10/0x10
[   13.484963]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.484985]  ? calculate_sigpending+0x7b/0xa0
[   13.485005]  ? __pfx_kthread+0x10/0x10
[   13.485027]  ret_from_fork+0x41/0x80
[   13.485047]  ? __pfx_kthread+0x10/0x10
[   13.485069]  ret_from_fork_asm+0x1a/0x30
[   13.485100]  </TASK>
[   13.485111] 
[   13.493526] Allocated by task 279:
[   13.493785]  kasan_save_stack+0x45/0x70
[   13.493968]  kasan_save_track+0x18/0x40
[   13.494101]  kasan_save_alloc_info+0x3b/0x50
[   13.494243]  __kasan_kmalloc+0xb7/0xc0
[   13.494634]  __kmalloc_cache_noprof+0x189/0x420
[   13.494861]  kasan_strings+0xc0/0xe80
[   13.495049]  kunit_try_run_case+0x1a5/0x480
[   13.495293]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.495553]  kthread+0x337/0x6f0
[   13.495678]  ret_from_fork+0x41/0x80
[   13.495808]  ret_from_fork_asm+0x1a/0x30
[   13.495944] 
[   13.496013] Freed by task 279:
[   13.496162]  kasan_save_stack+0x45/0x70
[   13.496361]  kasan_save_track+0x18/0x40
[   13.496604]  kasan_save_free_info+0x3f/0x60
[   13.496814]  __kasan_slab_free+0x56/0x70
[   13.496979]  kfree+0x222/0x3f0
[   13.497090]  kasan_strings+0x2aa/0xe80
[   13.497384]  kunit_try_run_case+0x1a5/0x480
[   13.497750]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.498010]  kthread+0x337/0x6f0
[   13.498150]  ret_from_fork+0x41/0x80
[   13.498357]  ret_from_fork_asm+0x1a/0x30
[   13.498493] 
[   13.498562] The buggy address belongs to the object at ffff888102757480
[   13.498562]  which belongs to the cache kmalloc-32 of size 32
[   13.499309] The buggy address is located 16 bytes inside of
[   13.499309]  freed 32-byte region [ffff888102757480, ffff8881027574a0)
[   13.500565] 
[   13.500921] The buggy address belongs to the physical page:
[   13.501540] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102757
[   13.501855] flags: 0x200000000000000(node=0|zone=2)
[   13.502102] page_type: f5(slab)
[   13.502461] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.502918] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.503318] page dumped because: kasan: bad access detected
[   13.503929] 
[   13.504028] Memory state around the buggy address:
[   13.504538]  ffff888102757380: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.504952]  ffff888102757400: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.505361] >ffff888102757480: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.505904]                          ^
[   13.506079]  ffff888102757500: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.506726]  ffff888102757580: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.507006] ==================================================================

[   23.568931] ==================================================================
[   23.569608] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   23.570173] Read of size 1 at addr ffff0000101e8f90 by task kunit_try_catch/313
[   23.570839] 
[   23.570994] CPU: 4 UID: 0 PID: 313 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc3 #1 PREEMPT 
[   23.571032] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.571043] Hardware name: Radxa ROCK Pi 4B (DT)
[   23.571056] Call trace:
[   23.571064]  show_stack+0x20/0x38 (C)
[   23.571089]  dump_stack_lvl+0x8c/0xd0
[   23.571110]  print_report+0x118/0x608
[   23.571131]  kasan_report+0xdc/0x128
[   23.571150]  __asan_report_load1_noabort+0x20/0x30
[   23.571173]  strnlen+0x80/0x88
[   23.571194]  kasan_strings+0x478/0xb00
[   23.571218]  kunit_try_run_case+0x170/0x3f0
[   23.571242]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.571268]  kthread+0x328/0x630
[   23.571292]  ret_from_fork+0x10/0x20
[   23.571313] 
[   23.577081] Allocated by task 313:
[   23.577398]  kasan_save_stack+0x3c/0x68
[   23.577762]  kasan_save_track+0x20/0x40
[   23.578121]  kasan_save_alloc_info+0x40/0x58
[   23.578521]  __kasan_kmalloc+0xd4/0xd8
[   23.578873]  __kmalloc_cache_noprof+0x15c/0x3c0
[   23.579299]  kasan_strings+0xc8/0xb00
[   23.579646]  kunit_try_run_case+0x170/0x3f0
[   23.580039]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.580549]  kthread+0x328/0x630
[   23.580858]  ret_from_fork+0x10/0x20
[   23.581196] 
[   23.581343] Freed by task 313:
[   23.581629]  kasan_save_stack+0x3c/0x68
[   23.581987]  kasan_save_track+0x20/0x40
[   23.582346]  kasan_save_free_info+0x4c/0x78
[   23.582737]  __kasan_slab_free+0x6c/0x98
[   23.583104]  kfree+0x214/0x3c8
[   23.583399]  kasan_strings+0x24c/0xb00
[   23.583753]  kunit_try_run_case+0x170/0x3f0
[   23.584145]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.584654]  kthread+0x328/0x630
[   23.584964]  ret_from_fork+0x10/0x20
[   23.585300] 
[   23.585447] The buggy address belongs to the object at ffff0000101e8f80
[   23.585447]  which belongs to the cache kmalloc-32 of size 32
[   23.586549] The buggy address is located 16 bytes inside of
[   23.586549]  freed 32-byte region [ffff0000101e8f80, ffff0000101e8fa0)
[   23.587631] 
[   23.587777] The buggy address belongs to the physical page:
[   23.588283] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101e8
[   23.589002] flags: 0x3fffe0000000000(node=0|zone=0|lastcpupid=0x1ffff)
[   23.589601] page_type: f5(slab)
[   23.589902] raw: 03fffe0000000000 ffff000000402780 dead000000000122 0000000000000000
[   23.590602] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   23.591298] page dumped because: kasan: bad access detected
[   23.591802] 
[   23.591947] Memory state around the buggy address:
[   23.592385]  ffff0000101e8e80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   23.593038]  ffff0000101e8f00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   23.593691] >ffff0000101e8f80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   23.594340]                          ^
[   23.594687]  ffff0000101e9000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   23.595340]  ffff0000101e9080: fb fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb
[   23.595989] ==================================================================