Hay
Date
July 4, 2025, 11:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   31.976581] ==================================================================
[   31.976644] BUG: KASAN: slab-out-of-bounds in memcmp+0x198/0x1d8
[   31.976971] Read of size 1 at addr fff00000c5ad9998 by task kunit_try_catch/290
[   31.977255] 
[   31.977349] CPU: 1 UID: 0 PID: 290 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT 
[   31.977447] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.977477] Hardware name: linux,dummy-virt (DT)
[   31.977524] Call trace:
[   31.977549]  show_stack+0x20/0x38 (C)
[   31.977606]  dump_stack_lvl+0x8c/0xd0
[   31.977661]  print_report+0x118/0x608
[   31.977713]  kasan_report+0xdc/0x128
[   31.977762]  __asan_report_load1_noabort+0x20/0x30
[   31.977814]  memcmp+0x198/0x1d8
[   31.977869]  kasan_memcmp+0x16c/0x300
[   31.977929]  kunit_try_run_case+0x170/0x3f0
[   31.977980]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.978038]  kthread+0x328/0x630
[   31.978091]  ret_from_fork+0x10/0x20
[   31.978141] 
[   31.978168] Allocated by task 290:
[   31.978202]  kasan_save_stack+0x3c/0x68
[   31.978246]  kasan_save_track+0x20/0x40
[   31.978287]  kasan_save_alloc_info+0x40/0x58
[   31.978333]  __kasan_kmalloc+0xd4/0xd8
[   31.978375]  __kmalloc_cache_noprof+0x16c/0x3c0
[   31.978425]  kasan_memcmp+0xbc/0x300
[   31.978464]  kunit_try_run_case+0x170/0x3f0
[   31.978504]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.978551]  kthread+0x328/0x630
[   31.978584]  ret_from_fork+0x10/0x20
[   31.978628] 
[   31.978650] The buggy address belongs to the object at fff00000c5ad9980
[   31.978650]  which belongs to the cache kmalloc-32 of size 32
[   31.978719] The buggy address is located 0 bytes to the right of
[   31.978719]  allocated 24-byte region [fff00000c5ad9980, fff00000c5ad9998)
[   31.978794] 
[   31.978820] The buggy address belongs to the physical page:
[   31.978853] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105ad9
[   31.978929] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.979734] page_type: f5(slab)
[   31.979788] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   31.980017] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   31.980141] page dumped because: kasan: bad access detected
[   31.980323] 
[   31.980468] Memory state around the buggy address:
[   31.980505]  fff00000c5ad9880: 00 00 00 fc fc fc fc fc 00 00 00 04 fc fc fc fc
[   31.980569]  fff00000c5ad9900: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   31.980855] >fff00000c5ad9980: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.980949]                             ^
[   31.981016]  fff00000c5ad9a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.981102]  fff00000c5ad9a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.981204] ==================================================================

[   27.003072] ==================================================================
[   27.004019] BUG: KASAN: slab-out-of-bounds in memcmp+0x1b4/0x1d0
[   27.004664] Read of size 1 at addr ffff888105abc998 by task kunit_try_catch/306
[   27.005128] 
[   27.005541] CPU: 0 UID: 0 PID: 306 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT(voluntary) 
[   27.005749] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.005766] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.005794] Call Trace:
[   27.005809]  <TASK>
[   27.005832]  dump_stack_lvl+0x73/0xb0
[   27.005888]  print_report+0xd1/0x650
[   27.005917]  ? __virt_addr_valid+0x1db/0x2d0
[   27.005945]  ? memcmp+0x1b4/0x1d0
[   27.005967]  ? kasan_complete_mode_report_info+0x2a/0x200
[   27.005995]  ? memcmp+0x1b4/0x1d0
[   27.006017]  kasan_report+0x141/0x180
[   27.006040]  ? memcmp+0x1b4/0x1d0
[   27.006066]  __asan_report_load1_noabort+0x18/0x20
[   27.006092]  memcmp+0x1b4/0x1d0
[   27.006116]  kasan_memcmp+0x18f/0x390
[   27.006155]  ? trace_hardirqs_on+0x37/0xe0
[   27.006183]  ? __pfx_kasan_memcmp+0x10/0x10
[   27.006205]  ? finish_task_switch.isra.0+0x153/0x700
[   27.006230]  ? __switch_to+0x47/0xf50
[   27.006262]  ? __pfx_read_tsc+0x10/0x10
[   27.006287]  ? ktime_get_ts64+0x86/0x230
[   27.006314]  kunit_try_run_case+0x1a5/0x480
[   27.006344]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.006369]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   27.006407]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.006433]  ? __kthread_parkme+0x82/0x180
[   27.006457]  ? preempt_count_sub+0x50/0x80
[   27.006482]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.006509]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.006536]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.006562]  kthread+0x337/0x6f0
[   27.006584]  ? trace_preempt_on+0x20/0xc0
[   27.006607]  ? __pfx_kthread+0x10/0x10
[   27.006630]  ? _raw_spin_unlock_irq+0x47/0x80
[   27.006654]  ? calculate_sigpending+0x7b/0xa0
[   27.006681]  ? __pfx_kthread+0x10/0x10
[   27.006704]  ret_from_fork+0x116/0x1d0
[   27.006726]  ? __pfx_kthread+0x10/0x10
[   27.006749]  ret_from_fork_asm+0x1a/0x30
[   27.006783]  </TASK>
[   27.006797] 
[   27.023027] Allocated by task 306:
[   27.023769]  kasan_save_stack+0x45/0x70
[   27.024334]  kasan_save_track+0x18/0x40
[   27.024846]  kasan_save_alloc_info+0x3b/0x50
[   27.025247]  __kasan_kmalloc+0xb7/0xc0
[   27.025474]  __kmalloc_cache_noprof+0x189/0x420
[   27.026050]  kasan_memcmp+0xb7/0x390
[   27.026220]  kunit_try_run_case+0x1a5/0x480
[   27.026798]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.027608]  kthread+0x337/0x6f0
[   27.027815]  ret_from_fork+0x116/0x1d0
[   27.028001]  ret_from_fork_asm+0x1a/0x30
[   27.028432] 
[   27.028630] The buggy address belongs to the object at ffff888105abc980
[   27.028630]  which belongs to the cache kmalloc-32 of size 32
[   27.030098] The buggy address is located 0 bytes to the right of
[   27.030098]  allocated 24-byte region [ffff888105abc980, ffff888105abc998)
[   27.030536] 
[   27.030618] The buggy address belongs to the physical page:
[   27.030811] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105abc
[   27.031161] flags: 0x200000000000000(node=0|zone=2)
[   27.031656] page_type: f5(slab)
[   27.031845] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   27.032309] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   27.032705] page dumped because: kasan: bad access detected
[   27.032894] 
[   27.032967] Memory state around the buggy address:
[   27.033416]  ffff888105abc880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.033800]  ffff888105abc900: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   27.034102] >ffff888105abc980: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.034563]                             ^
[   27.034741]  ffff888105abca00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.035225]  ffff888105abca80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.035613] ==================================================================