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

Environment
qemu-arm64

[  182.600304] ==================================================================
[  182.602158] BUG: KASAN: slab-use-after-free in strcmp+0x2c/0x78
[  182.604882] Read of size 1 at addr ffff0000c5f6ec10 by task kunit_try_catch/204
[  182.606840] 
[  182.607745] CPU: 0 PID: 204 Comm: kunit_try_catch Tainted: G    B            N 6.6.76-rc1 #1
[  182.609893] Hardware name: linux,dummy-virt (DT)
[  182.611278] Call trace:
[  182.612132]  dump_backtrace+0x9c/0x128
[  182.613397]  show_stack+0x20/0x38
[  182.614448]  dump_stack_lvl+0x60/0xb0
[  182.615562]  print_report+0xf8/0x5d8
[  182.616541]  kasan_report+0xc8/0x118
[  182.618446]  __asan_load1+0x60/0x70
[  182.619690]  strcmp+0x2c/0x78
[  182.620691]  kasan_strings+0x12c/0x478
[  182.622441]  kunit_try_run_case+0xf8/0x260
[  182.624097]  kunit_generic_run_threadfn_adapter+0x38/0x60
[  182.625815]  kthread+0x18c/0x1a8
[  182.627117]  ret_from_fork+0x10/0x20
[  182.628205] 
[  182.628718] Allocated by task 204:
[  182.629786]  kasan_save_stack+0x3c/0x68
[  182.630977]  kasan_set_track+0x2c/0x40
[  182.632109]  kasan_save_alloc_info+0x24/0x38
[  182.633770]  __kasan_kmalloc+0xd4/0xd8
[  182.634884]  kmalloc_trace+0x68/0x130
[  182.636053]  kasan_strings+0xa0/0x478
[  182.637906]  kunit_try_run_case+0xf8/0x260
[  182.639612]  kunit_generic_run_threadfn_adapter+0x38/0x60
[  182.641122]  kthread+0x18c/0x1a8
[  182.642557]  ret_from_fork+0x10/0x20
[  182.643683] 
[  182.644321] Freed by task 204:
[  182.645645]  kasan_save_stack+0x3c/0x68
[  182.647001]  kasan_set_track+0x2c/0x40
[  182.648256]  kasan_save_free_info+0x38/0x60
[  182.649836]  __kasan_slab_free+0x100/0x170
[  182.651317]  __kmem_cache_free+0x170/0x2e0
[  182.652511]  kfree+0x74/0x138
[  182.653516]  kasan_strings+0xbc/0x478
[  182.655791]  kunit_try_run_case+0xf8/0x260
[  182.657123]  kunit_generic_run_threadfn_adapter+0x38/0x60
[  182.658785]  kthread+0x18c/0x1a8
[  182.659810]  ret_from_fork+0x10/0x20
[  182.661042] 
[  182.662030] The buggy address belongs to the object at ffff0000c5f6ec00
[  182.662030]  which belongs to the cache kmalloc-32 of size 32
[  182.665541] The buggy address is located 16 bytes inside of
[  182.665541]  freed 32-byte region [ffff0000c5f6ec00, ffff0000c5f6ec20)
[  182.667448] 
[  182.667976] The buggy address belongs to the physical page:
[  182.669347] page:00000000e8269612 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105f6e
[  182.672014] flags: 0xbfffc0000000800(slab|node=0|zone=2|lastcpupid=0xffff)
[  182.674021] page_type: 0xffffffff()
[  182.675457] raw: 0bfffc0000000800 ffff0000c0001500 dead000000000122 0000000000000000
[  182.677420] raw: 0000000000000000 0000000080400040 00000001ffffffff 0000000000000000
[  182.680422] page dumped because: kasan: bad access detected
[  182.682133] 
[  182.682659] Memory state around the buggy address:
[  182.683938]  ffff0000c5f6eb00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[  182.685888]  ffff0000c5f6eb80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[  182.687619] >ffff0000c5f6ec00: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[  182.689219]                          ^
[  182.691001]  ffff0000c5f6ec80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[  182.692997]  ffff0000c5f6ed00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[  182.694611] ==================================================================