Hay
Date
Feb. 5, 2025, 2:09 p.m.

Environment
qemu-armv7
qemu-x86_64

[  147.208477] ==================================================================
[  147.209227] BUG: KASAN: slab-use-after-free in strlen+0xc/0x44
[  147.209858] Read of size 1 at addr c8fba210 by task kunit_try_catch/199
[  147.210574] 
[  147.210861] CPU: 1 PID: 199 Comm: kunit_try_catch Tainted: G    B            N 6.6.76-rc1 #1
[  147.211718] Hardware name: Generic DT based system
[  147.212331]  unwind_backtrace from show_stack+0x18/0x1c
[  147.213038]  show_stack from dump_stack_lvl+0x58/0x70
[  147.213730]  dump_stack_lvl from print_report+0x164/0x51c
[  147.214405]  print_report from kasan_report+0xc8/0x104
[  147.215081]  kasan_report from strlen+0xc/0x44
[  147.215671]  strlen from kasan_strings+0x1a8/0x4ec
[  147.216732]  kasan_strings from kunit_try_run_case+0x11c/0x2e4
[  147.217579]  kunit_try_run_case from kunit_generic_run_threadfn_adapter+0x2c/0x48
[  147.218572]  kunit_generic_run_threadfn_adapter from kthread+0x184/0x1a8
[  147.219023]  kthread from ret_from_fork+0x14/0x30
[  147.219675] Exception stack(0xfa0fbfb0 to 0xfa0fbff8)
[  147.220200] bfa0:                                     00000000 00000000 00000000 00000000
[  147.221284] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  147.222402] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
[  147.223216] 
[  147.223502] Allocated by task 199:
[  147.223955]  kasan_set_track+0x3c/0x5c
[  147.224531]  __kasan_kmalloc+0x8c/0x94
[  147.225034]  kasan_strings+0xa0/0x4ec
[  147.225638]  kunit_try_run_case+0x11c/0x2e4
[  147.226665]  kunit_generic_run_threadfn_adapter+0x2c/0x48
[  147.227433]  kthread+0x184/0x1a8
[  147.227849]  ret_from_fork+0x14/0x30
[  147.228395] 
[  147.228626] Freed by task 199:
[  147.229155]  kasan_set_track+0x3c/0x5c
[  147.229699]  kasan_save_free_info+0x30/0x3c
[  147.230387]  __kasan_slab_free+0xdc/0x124
[  147.230913]  __kmem_cache_free+0x140/0x2a8
[  147.231610]  kasan_strings+0xbc/0x4ec
[  147.232141]  kunit_try_run_case+0x11c/0x2e4
[  147.232672]  kunit_generic_run_threadfn_adapter+0x2c/0x48
[  147.233565]  kthread+0x184/0x1a8
[  147.233975]  ret_from_fork+0x14/0x30
[  147.234536] 
[  147.234831] The buggy address belongs to the object at c8fba200
[  147.234831]  which belongs to the cache kmalloc-64 of size 64
[  147.236478] The buggy address is located 16 bytes inside of
[  147.236478]  freed 64-byte region [c8fba200, c8fba240)
[  147.238011] 
[  147.238223] The buggy address belongs to the physical page:
[  147.238912] page:3fba6f39 refcount:1 mapcount:0 mapping:00000000 index:0x0 pfn:0x48fba
[  147.239742] flags: 0x800(slab|zone=0)
[  147.240393] page_type: 0xffffffff()
[  147.240820] raw: 00000800 c4801200 00000122 00000000 00000000 80200020 ffffffff 00000001
[  147.241776] raw: 00000000
[  147.242304] page dumped because: kasan: bad access detected
[  147.242917] 
[  147.243146] Memory state around the buggy address:
[  147.243858]  c8fba100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[  147.244676]  c8fba180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[  147.245348] >c8fba200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[  147.246604]                  ^
[  147.247091]  c8fba280: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
[  147.247871]  c8fba300: 00 00 00 00 04 fc fc fc fc fc fc fc fc fc fc fc
[  147.248484] ==================================================================


[   50.479983] ==================================================================
[   50.480900] BUG: KASAN: slab-use-after-free in strlen+0x13/0x50
[   50.481849] Read of size 1 at addr ffff8881028cedd0 by task kunit_try_catch/222
[   50.482583] 
[   50.483157] CPU: 1 PID: 222 Comm: kunit_try_catch Tainted: G    B            N 6.6.76-rc1 #1
[   50.484612] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   50.485587] Call Trace:
[   50.486003]  <TASK>
[   50.486545]  dump_stack_lvl+0x4e/0x90
[   50.487277]  print_report+0xd2/0x660
[   50.487843]  ? __virt_addr_valid+0x156/0x1e0
[   50.488578]  ? kasan_complete_mode_report_info+0x64/0x200
[   50.489375]  kasan_report+0xff/0x140
[   50.489665]  ? strlen+0x13/0x50
[   50.490077]  ? strlen+0x13/0x50
[   50.490584]  __asan_load1+0x66/0x70
[   50.491176]  strlen+0x13/0x50
[   50.491926]  kasan_strings+0x1dc/0x510
[   50.492495]  ? __pfx_kasan_strings+0x10/0x10
[   50.493188]  ? __schedule+0x70b/0x1190
[   50.493921]  ? ktime_get_ts64+0x118/0x140
[   50.495035]  kunit_try_run_case+0x126/0x290
[   50.495817]  ? __pfx_kunit_try_run_case+0x10/0x10
[   50.496590]  ? __kasan_check_write+0x18/0x20
[   50.497413]  ? trace_preempt_on+0x20/0xa0
[   50.498261]  ? __kthread_parkme+0x4f/0xd0
[   50.498960]  ? preempt_count_sub+0x50/0x80
[   50.499502]  ? __pfx_kunit_try_run_case+0x10/0x10
[   50.500575]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   50.501392]  kunit_generic_run_threadfn_adapter+0x33/0x50
[   50.502107]  kthread+0x19e/0x1e0
[   50.502560]  ? __pfx_kthread+0x10/0x10
[   50.503185]  ret_from_fork+0x41/0x70
[   50.503911]  ? __pfx_kthread+0x10/0x10
[   50.504545]  ret_from_fork_asm+0x1b/0x30
[   50.505174]  </TASK>
[   50.505519] 
[   50.505843] Allocated by task 222:
[   50.506822]  kasan_save_stack+0x3c/0x60
[   50.507538]  kasan_set_track+0x29/0x40
[   50.508246]  kasan_save_alloc_info+0x22/0x30
[   50.508877]  __kasan_kmalloc+0xb7/0xc0
[   50.509346]  kmalloc_trace+0x4c/0xb0
[   50.509899]  kasan_strings+0x9f/0x510
[   50.510410]  kunit_try_run_case+0x126/0x290
[   50.511284]  kunit_generic_run_threadfn_adapter+0x33/0x50
[   50.512465]  kthread+0x19e/0x1e0
[   50.512944]  ret_from_fork+0x41/0x70
[   50.513574]  ret_from_fork_asm+0x1b/0x30
[   50.514332] 
[   50.514758] Freed by task 222:
[   50.515170]  kasan_save_stack+0x3c/0x60
[   50.515711]  kasan_set_track+0x29/0x40
[   50.516174]  kasan_save_free_info+0x2f/0x50
[   50.516914]  ____kasan_slab_free+0x172/0x1d0
[   50.518108]  __kasan_slab_free+0x16/0x20
[   50.519348]  __kmem_cache_free+0x190/0x310
[   50.519852]  kfree+0x7c/0x120
[   50.520497]  kasan_strings+0xc3/0x510
[   50.521281]  kunit_try_run_case+0x126/0x290
[   50.522215]  kunit_generic_run_threadfn_adapter+0x33/0x50
[   50.523485]  kthread+0x19e/0x1e0
[   50.524302]  ret_from_fork+0x41/0x70
[   50.524801]  ret_from_fork_asm+0x1b/0x30
[   50.525623] 
[   50.526118] The buggy address belongs to the object at ffff8881028cedc0
[   50.526118]  which belongs to the cache kmalloc-32 of size 32
[   50.527423] The buggy address is located 16 bytes inside of
[   50.527423]  freed 32-byte region [ffff8881028cedc0, ffff8881028cede0)
[   50.528991] 
[   50.529423] The buggy address belongs to the physical page:
[   50.530323] page:(____ptrval____) refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1028ce
[   50.531333] flags: 0x200000000000800(slab|node=0|zone=2)
[   50.532017] page_type: 0xffffffff()
[   50.532685] raw: 0200000000000800 ffff888100041500 dead000000000122 0000000000000000
[   50.533941] raw: 0000000000000000 0000000080400040 00000001ffffffff 0000000000000000
[   50.534704] page dumped because: kasan: bad access detected
[   50.535459] 
[   50.535704] Memory state around the buggy address:
[   50.536402]  ffff8881028cec80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   50.537604]  ffff8881028ced00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   50.538753] >ffff8881028ced80: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   50.539654]                                                  ^
[   50.540440]  ffff8881028cee00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   50.541319]  ffff8881028cee80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   50.542525] ==================================================================