Hay
Date
June 7, 2025, 10:40 a.m.

Environment
qemu-arm64
qemu-x86_64

[   25.590410] ==================================================================
[   25.590564] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   25.590698] Read of size 1 at addr fff00000c772d090 by task kunit_try_catch/263
[   25.590834] 
[   25.590923] CPU: 1 UID: 0 PID: 263 Comm: kunit_try_catch Tainted: G    B            N  6.15.2-rc1 #1 PREEMPT 
[   25.591148] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.591220] Hardware name: linux,dummy-virt (DT)
[   25.591309] Call trace:
[   25.591372]  show_stack+0x20/0x38 (C)
[   25.592134]  dump_stack_lvl+0x8c/0xd0
[   25.592255]  print_report+0x118/0x608
[   25.592360]  kasan_report+0xdc/0x128
[   25.592454]  __asan_report_load1_noabort+0x20/0x30
[   25.592557]  strnlen+0x80/0x88
[   25.593645]  kasan_strings+0x478/0xb00
[   25.593826]  kunit_try_run_case+0x170/0x3f0
[   25.593962]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   25.594111]  kthread+0x328/0x630
[   25.594231]  ret_from_fork+0x10/0x20
[   25.594936] 
[   25.594995] Allocated by task 263:
[   25.595078]  kasan_save_stack+0x3c/0x68
[   25.595194]  kasan_save_track+0x20/0x40
[   25.595316]  kasan_save_alloc_info+0x40/0x58
[   25.595437]  __kasan_kmalloc+0xd4/0xd8
[   25.595536]  __kmalloc_cache_noprof+0x16c/0x3c0
[   25.595653]  kasan_strings+0xc8/0xb00
[   25.595753]  kunit_try_run_case+0x170/0x3f0
[   25.596341]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   25.597083]  kthread+0x328/0x630
[   25.597284]  ret_from_fork+0x10/0x20
[   25.597486] 
[   25.597544] Freed by task 263:
[   25.597831]  kasan_save_stack+0x3c/0x68
[   25.598234]  kasan_save_track+0x20/0x40
[   25.598466]  kasan_save_free_info+0x4c/0x78
[   25.599067]  __kasan_slab_free+0x6c/0x98
[   25.599195]  kfree+0x214/0x3c8
[   25.599528]  kasan_strings+0x24c/0xb00
[   25.599642]  kunit_try_run_case+0x170/0x3f0
[   25.599767]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   25.600488]  kthread+0x328/0x630
[   25.600624]  ret_from_fork+0x10/0x20
[   25.600839] 
[   25.600908] The buggy address belongs to the object at fff00000c772d080
[   25.600908]  which belongs to the cache kmalloc-32 of size 32
[   25.601600] The buggy address is located 16 bytes inside of
[   25.601600]  freed 32-byte region [fff00000c772d080, fff00000c772d0a0)
[   25.601962] 
[   25.602029] The buggy address belongs to the physical page:
[   25.602578] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10772d
[   25.602825] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   25.602986] page_type: f5(slab)
[   25.603094] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   25.603301] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   25.603660] page dumped because: kasan: bad access detected
[   25.603910] 
[   25.604226] Memory state around the buggy address:
[   25.604343]  fff00000c772cf80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.604473]  fff00000c772d000: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   25.604868] >fff00000c772d080: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   25.605190]                          ^
[   25.605312]  fff00000c772d100: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   25.605511]  fff00000c772d180: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   25.605600] ==================================================================

[   15.932918] ==================================================================
[   15.933138] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   15.933551] Read of size 1 at addr ffff8881039f3390 by task kunit_try_catch/279
[   15.933851] 
[   15.933936] CPU: 1 UID: 0 PID: 279 Comm: kunit_try_catch Tainted: G    B            N  6.15.2-rc1 #1 PREEMPT(voluntary) 
[   15.933992] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.934007] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   15.934072] Call Trace:
[   15.934099]  <TASK>
[   15.934121]  dump_stack_lvl+0x73/0xb0
[   15.934150]  print_report+0xd1/0x650
[   15.934175]  ? __virt_addr_valid+0x1db/0x2d0
[   15.934197]  ? strnlen+0x73/0x80
[   15.934215]  ? kasan_complete_mode_report_info+0x64/0x200
[   15.934238]  ? strnlen+0x73/0x80
[   15.934256]  kasan_report+0x141/0x180
[   15.934281]  ? strnlen+0x73/0x80
[   15.934303]  __asan_report_load1_noabort+0x18/0x20
[   15.934324]  strnlen+0x73/0x80
[   15.934343]  kasan_strings+0x615/0xe80
[   15.934433]  ? trace_hardirqs_on+0x37/0xe0
[   15.934482]  ? __pfx_kasan_strings+0x10/0x10
[   15.934504]  ? finish_task_switch.isra.0+0x153/0x700
[   15.934528]  ? __switch_to+0x5d9/0xf60
[   15.934548]  ? dequeue_task_fair+0x166/0x4e0
[   15.934582]  ? __schedule+0x10cc/0x2b30
[   15.934606]  ? __pfx_read_tsc+0x10/0x10
[   15.934625]  ? ktime_get_ts64+0x86/0x230
[   15.934696]  kunit_try_run_case+0x1a5/0x480
[   15.934725]  ? __pfx_kunit_try_run_case+0x10/0x10
[   15.934747]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   15.934771]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   15.934795]  ? __kthread_parkme+0x82/0x180
[   15.934817]  ? preempt_count_sub+0x50/0x80
[   15.934842]  ? __pfx_kunit_try_run_case+0x10/0x10
[   15.934867]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   15.934891]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   15.934915]  kthread+0x337/0x6f0
[   15.934933]  ? trace_preempt_on+0x20/0xc0
[   15.934957]  ? __pfx_kthread+0x10/0x10
[   15.934998]  ? _raw_spin_unlock_irq+0x47/0x80
[   15.935022]  ? calculate_sigpending+0x7b/0xa0
[   15.935045]  ? __pfx_kthread+0x10/0x10
[   15.935065]  ret_from_fork+0x41/0x80
[   15.935086]  ? __pfx_kthread+0x10/0x10
[   15.935106]  ret_from_fork_asm+0x1a/0x30
[   15.935144]  </TASK>
[   15.935162] 
[   15.943347] Allocated by task 279:
[   15.943464]  kasan_save_stack+0x45/0x70
[   15.943783]  kasan_save_track+0x18/0x40
[   15.944164]  kasan_save_alloc_info+0x3b/0x50
[   15.944384]  __kasan_kmalloc+0xb7/0xc0
[   15.944478]  __kmalloc_cache_noprof+0x189/0x420
[   15.944703]  kasan_strings+0xc0/0xe80
[   15.944981]  kunit_try_run_case+0x1a5/0x480
[   15.945240]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   15.945440]  kthread+0x337/0x6f0
[   15.945696]  ret_from_fork+0x41/0x80
[   15.945813]  ret_from_fork_asm+0x1a/0x30
[   15.945912] 
[   15.945969] Freed by task 279:
[   15.946050]  kasan_save_stack+0x45/0x70
[   15.946147]  kasan_save_track+0x18/0x40
[   15.946237]  kasan_save_free_info+0x3f/0x60
[   15.946484]  __kasan_slab_free+0x56/0x70
[   15.946758]  kfree+0x222/0x3f0
[   15.947182]  kasan_strings+0x2aa/0xe80
[   15.947466]  kunit_try_run_case+0x1a5/0x480
[   15.948100]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   15.948416]  kthread+0x337/0x6f0
[   15.948500]  ret_from_fork+0x41/0x80
[   15.948598]  ret_from_fork_asm+0x1a/0x30
[   15.948690] 
[   15.948744] The buggy address belongs to the object at ffff8881039f3380
[   15.948744]  which belongs to the cache kmalloc-32 of size 32
[   15.949412] The buggy address is located 16 bytes inside of
[   15.949412]  freed 32-byte region [ffff8881039f3380, ffff8881039f33a0)
[   15.949979] 
[   15.950037] The buggy address belongs to the physical page:
[   15.950145] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1039f3
[   15.950443] flags: 0x200000000000000(node=0|zone=2)
[   15.950772] page_type: f5(slab)
[   15.950997] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   15.951473] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   15.951711] page dumped because: kasan: bad access detected
[   15.951909] 
[   15.952002] Memory state around the buggy address:
[   15.952186]  ffff8881039f3280: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   15.952325]  ffff8881039f3300: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   15.952454] >ffff8881039f3380: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   15.952587]                          ^
[   15.952671]  ffff8881039f3400: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   15.953055]  ffff8881039f3480: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   15.953435] ==================================================================