Hay
Date
June 2, 2025, 2:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   22.053935] ==================================================================
[   22.054717] BUG: KASAN: slab-out-of-bounds in memcmp+0x198/0x1d8
[   22.055423] Read of size 1 at addr fff00000c6cfdb58 by task kunit_try_catch/244
[   22.056076] 
[   22.056434] CPU: 0 UID: 0 PID: 244 Comm: kunit_try_catch Tainted: G    B            N 6.12.32-rc1 #1
[   22.056653] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.056720] Hardware name: linux,dummy-virt (DT)
[   22.056821] Call trace:
[   22.056883]  dump_backtrace+0x9c/0x128
[   22.057019]  show_stack+0x20/0x38
[   22.057122]  dump_stack_lvl+0x8c/0xd0
[   22.057249]  print_report+0x118/0x5f0
[   22.057359]  kasan_report+0xdc/0x128
[   22.057447]  __asan_report_load1_noabort+0x20/0x30
[   22.057549]  memcmp+0x198/0x1d8
[   22.057628]  kasan_memcmp+0x170/0x310
[   22.057718]  kunit_try_run_case+0x170/0x3f0
[   22.057806]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.057910]  kthread+0x24c/0x2d0
[   22.057993]  ret_from_fork+0x10/0x20
[   22.058132] 
[   22.064253] Allocated by task 244:
[   22.064752]  kasan_save_stack+0x3c/0x68
[   22.065187]  kasan_save_track+0x20/0x40
[   22.066068]  kasan_save_alloc_info+0x40/0x58
[   22.066714]  __kasan_kmalloc+0xd4/0xd8
[   22.067650]  __kmalloc_cache_noprof+0x154/0x320
[   22.068086]  kasan_memcmp+0xbc/0x310
[   22.068383]  kunit_try_run_case+0x170/0x3f0
[   22.068647]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.068936]  kthread+0x24c/0x2d0
[   22.069160]  ret_from_fork+0x10/0x20
[   22.069419] 
[   22.069764] The buggy address belongs to the object at fff00000c6cfdb40
[   22.069764]  which belongs to the cache kmalloc-32 of size 32
[   22.070995] The buggy address is located 0 bytes to the right of
[   22.070995]  allocated 24-byte region [fff00000c6cfdb40, fff00000c6cfdb58)
[   22.072528] 
[   22.072957] The buggy address belongs to the physical page:
[   22.073316] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106cfd
[   22.074002] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   22.074741] page_type: f5(slab)
[   22.075175] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   22.075849] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   22.076935] page dumped because: kasan: bad access detected
[   22.077664] 
[   22.077961] Memory state around the buggy address:
[   22.078492]  fff00000c6cfda00: 00 00 07 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   22.079605]  fff00000c6cfda80: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   22.080186] >fff00000c6cfdb00: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   22.080866]                                                     ^
[   22.081465]  fff00000c6cfdb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.082085]  fff00000c6cfdc00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.082723] ==================================================================

[   14.005336] ==================================================================
[   14.005714] BUG: KASAN: slab-out-of-bounds in memcmp+0x1b4/0x1d0
[   14.005966] Read of size 1 at addr ffff888102632798 by task kunit_try_catch/262
[   14.006150] 
[   14.006214] CPU: 0 UID: 0 PID: 262 Comm: kunit_try_catch Tainted: G    B            N 6.12.32-rc1 #1
[   14.006256] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.006268] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.006289] Call Trace:
[   14.006301]  <TASK>
[   14.006317]  dump_stack_lvl+0x73/0xb0
[   14.006558]  print_report+0xd1/0x640
[   14.006586]  ? __virt_addr_valid+0x1db/0x2d0
[   14.006611]  ? memcmp+0x1b4/0x1d0
[   14.006631]  ? kasan_complete_mode_report_info+0x2a/0x200
[   14.006653]  ? memcmp+0x1b4/0x1d0
[   14.006688]  kasan_report+0x140/0x180
[   14.006712]  ? memcmp+0x1b4/0x1d0
[   14.006737]  __asan_report_load1_noabort+0x18/0x20
[   14.006758]  memcmp+0x1b4/0x1d0
[   14.006780]  kasan_memcmp+0x190/0x390
[   14.006802]  ? __pfx_kasan_memcmp+0x10/0x10
[   14.006822]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   14.006851]  ? __pfx_kasan_memcmp+0x10/0x10
[   14.006877]  kunit_try_run_case+0x1a6/0x480
[   14.006900]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.006919]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   14.006939]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.006963]  ? __kthread_parkme+0x82/0x160
[   14.006983]  ? preempt_count_sub+0x50/0x80
[   14.007006]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.007025]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.007050]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.007074]  kthread+0x257/0x310
[   14.007092]  ? __pfx_kthread+0x10/0x10
[   14.007111]  ret_from_fork+0x41/0x80
[   14.007131]  ? __pfx_kthread+0x10/0x10
[   14.007149]  ret_from_fork_asm+0x1a/0x30
[   14.007179]  </TASK>
[   14.007191] 
[   14.014508] Allocated by task 262:
[   14.015178]  kasan_save_stack+0x45/0x70
[   14.015434]  kasan_save_track+0x18/0x40
[   14.016329]  kasan_save_alloc_info+0x3b/0x50
[   14.016611]  __kasan_kmalloc+0xb7/0xc0
[   14.016789]  __kmalloc_cache_noprof+0x168/0x350
[   14.017015]  kasan_memcmp+0xb8/0x390
[   14.017185]  kunit_try_run_case+0x1a6/0x480
[   14.017312]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.017434]  kthread+0x257/0x310
[   14.017605]  ret_from_fork+0x41/0x80
[   14.017784]  ret_from_fork_asm+0x1a/0x30
[   14.018008] 
[   14.018131] The buggy address belongs to the object at ffff888102632780
[   14.018131]  which belongs to the cache kmalloc-32 of size 32
[   14.018502] The buggy address is located 0 bytes to the right of
[   14.018502]  allocated 24-byte region [ffff888102632780, ffff888102632798)
[   14.018798] 
[   14.018853] The buggy address belongs to the physical page:
[   14.018993] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102632
[   14.019385] flags: 0x200000000000000(node=0|zone=2)
[   14.019603] page_type: f5(slab)
[   14.019757] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.020106] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   14.020602] page dumped because: kasan: bad access detected
[   14.020795] 
[   14.020913] Memory state around the buggy address:
[   14.021072]  ffff888102632680: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.021358]  ffff888102632700: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   14.021580] >ffff888102632780: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.021803]                             ^
[   14.022026]  ffff888102632800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.022363]  ffff888102632880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.022589] ==================================================================