Hay
Date
Nov. 28, 2024, 2:36 a.m.

Environment
qemu-arm64
qemu-x86_64

[   33.658537] ==================================================================
[   33.659315] BUG: KASAN: slab-use-after-free in kasan_strings+0x858/0x8f8
[   33.660088] Read of size 1 at addr fff00000c4081c10 by task kunit_try_catch/247
[   33.660857] 
[   33.661398] CPU: 1 UID: 0 PID: 247 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   33.662425] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.662923] Hardware name: linux,dummy-virt (DT)
[   33.663575] Call trace:
[   33.663930]  show_stack+0x20/0x38 (C)
[   33.664601]  dump_stack_lvl+0x8c/0xd0
[   33.665504]  print_report+0x118/0x5e0
[   33.666105]  kasan_report+0xc8/0x118
[   33.666666]  __asan_report_load1_noabort+0x20/0x30
[   33.667413]  kasan_strings+0x858/0x8f8
[   33.668043]  kunit_try_run_case+0x14c/0x3d0
[   33.668718]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.669710]  kthread+0x24c/0x2d0
[   33.670299]  ret_from_fork+0x10/0x20
[   33.670908] 
[   33.671252] Allocated by task 247:
[   33.671810]  kasan_save_stack+0x3c/0x68
[   33.672416]  kasan_save_track+0x20/0x40
[   33.673278]  kasan_save_alloc_info+0x40/0x58
[   33.673854]  __kasan_kmalloc+0xd4/0xd8
[   33.674444]  __kmalloc_cache_noprof+0x15c/0x3c0
[   33.675068]  kasan_strings+0xb4/0x8f8
[   33.675673]  kunit_try_run_case+0x14c/0x3d0
[   33.676265]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.677831]  kthread+0x24c/0x2d0
[   33.678204]  ret_from_fork+0x10/0x20
[   33.678926] 
[   33.679296] Freed by task 247:
[   33.679723]  kasan_save_stack+0x3c/0x68
[   33.680363]  kasan_save_track+0x20/0x40
[   33.680964]  kasan_save_free_info+0x4c/0x78
[   33.681538]  __kasan_slab_free+0x6c/0x98
[   33.682098]  kfree+0x114/0x3c8
[   33.682840]  kasan_strings+0x128/0x8f8
[   33.683459]  kunit_try_run_case+0x14c/0x3d0
[   33.684133]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.684802]  kthread+0x24c/0x2d0
[   33.685530]  ret_from_fork+0x10/0x20
[   33.686099] 
[   33.686496] The buggy address belongs to the object at fff00000c4081c00
[   33.686496]  which belongs to the cache kmalloc-32 of size 32
[   33.687724] The buggy address is located 16 bytes inside of
[   33.687724]  freed 32-byte region [fff00000c4081c00, fff00000c4081c20)
[   33.689234] 
[   33.689589] The buggy address belongs to the physical page:
[   33.690216] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104081
[   33.691175] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   33.691954] page_type: f5(slab)
[   33.692441] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   33.693404] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   33.694417] page dumped because: kasan: bad access detected
[   33.695065] 
[   33.695448] Memory state around the buggy address:
[   33.696046]  fff00000c4081b00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   33.697159]  fff00000c4081b80: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   33.697967] >fff00000c4081c00: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   33.699392]                          ^
[   33.699949]  fff00000c4081c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.700693]  fff00000c4081d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.701497] ==================================================================

[   24.594058] ==================================================================
[   24.595385] BUG: KASAN: slab-use-after-free in kasan_strings+0xa0f/0xb60
[   24.596132] Read of size 1 at addr ffff888102a34190 by task kunit_try_catch/267
[   24.597214] 
[   24.597408] CPU: 0 UID: 0 PID: 267 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   24.598329] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.598618] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.599466] Call Trace:
[   24.599738]  <TASK>
[   24.599994]  dump_stack_lvl+0x73/0xb0
[   24.600525]  print_report+0xd1/0x640
[   24.600988]  ? __virt_addr_valid+0x1db/0x2d0
[   24.601545]  ? kasan_complete_mode_report_info+0x64/0x200
[   24.602086]  kasan_report+0x102/0x140
[   24.602404]  ? kasan_strings+0xa0f/0xb60
[   24.602745]  ? kasan_strings+0xa0f/0xb60
[   24.603274]  __asan_report_load1_noabort+0x18/0x20
[   24.603697]  kasan_strings+0xa0f/0xb60
[   24.604053]  ? __pfx_kasan_strings+0x10/0x10
[   24.604619]  ? __schedule+0xc3e/0x2790
[   24.605197]  ? __pfx_read_tsc+0x10/0x10
[   24.605498]  ? ktime_get_ts64+0x84/0x230
[   24.605996]  kunit_try_run_case+0x1b3/0x490
[   24.606473]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.606956]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   24.607366]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.607916]  ? __kthread_parkme+0x82/0x160
[   24.608496]  ? preempt_count_sub+0x50/0x80
[   24.608800]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.609242]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.609858]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.610268]  kthread+0x257/0x310
[   24.610723]  ? __pfx_kthread+0x10/0x10
[   24.611250]  ret_from_fork+0x41/0x80
[   24.611737]  ? __pfx_kthread+0x10/0x10
[   24.612258]  ret_from_fork_asm+0x1a/0x30
[   24.612652]  </TASK>
[   24.612882] 
[   24.613176] Allocated by task 267:
[   24.613623]  kasan_save_stack+0x3d/0x60
[   24.614012]  kasan_save_track+0x18/0x40
[   24.614432]  kasan_save_alloc_info+0x3b/0x50
[   24.614733]  __kasan_kmalloc+0xb7/0xc0
[   24.615018]  __kmalloc_cache_noprof+0x184/0x410
[   24.615649]  kasan_strings+0xb3/0xb60
[   24.616144]  kunit_try_run_case+0x1b3/0x490
[   24.617762]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.618283]  kthread+0x257/0x310
[   24.618580]  ret_from_fork+0x41/0x80
[   24.618956]  ret_from_fork_asm+0x1a/0x30
[   24.619542] 
[   24.619692] Freed by task 267:
[   24.620112]  kasan_save_stack+0x3d/0x60
[   24.620566]  kasan_save_track+0x18/0x40
[   24.620879]  kasan_save_free_info+0x3f/0x60
[   24.621615]  __kasan_slab_free+0x56/0x70
[   24.621955]  kfree+0x123/0x3f0
[   24.622404]  kasan_strings+0x13a/0xb60
[   24.622854]  kunit_try_run_case+0x1b3/0x490
[   24.623282]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.623871]  kthread+0x257/0x310
[   24.624237]  ret_from_fork+0x41/0x80
[   24.624623]  ret_from_fork_asm+0x1a/0x30
[   24.624941] 
[   24.625147] The buggy address belongs to the object at ffff888102a34180
[   24.625147]  which belongs to the cache kmalloc-32 of size 32
[   24.626451] The buggy address is located 16 bytes inside of
[   24.626451]  freed 32-byte region [ffff888102a34180, ffff888102a341a0)
[   24.627768] 
[   24.627922] The buggy address belongs to the physical page:
[   24.628542] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a34
[   24.629946] flags: 0x200000000000000(node=0|zone=2)
[   24.630493] page_type: f5(slab)
[   24.630742] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   24.631615] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   24.632249] page dumped because: kasan: bad access detected
[   24.632745] 
[   24.632984] Memory state around the buggy address:
[   24.633476]  ffff888102a34080: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   24.634045]  ffff888102a34100: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   24.634749] >ffff888102a34180: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   24.635252]                          ^
[   24.635719]  ffff888102a34200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.636493]  ffff888102a34280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.636919] ==================================================================