Hay
Date
June 17, 2025, 6:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   19.208822] ==================================================================
[   19.208886] BUG: KASAN: slab-out-of-bounds in memcmp+0x198/0x1d8
[   19.208963] Read of size 1 at addr fff00000c52113d8 by task kunit_try_catch/266
[   19.209021] 
[   19.209060] CPU: 1 UID: 0 PID: 266 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250617 #1 PREEMPT 
[   19.209153] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.209183] Hardware name: linux,dummy-virt (DT)
[   19.209229] Call trace:
[   19.209253]  show_stack+0x20/0x38 (C)
[   19.209332]  dump_stack_lvl+0x8c/0xd0
[   19.209392]  print_report+0x118/0x608
[   19.209480]  kasan_report+0xdc/0x128
[   19.209529]  __asan_report_load1_noabort+0x20/0x30
[   19.209588]  memcmp+0x198/0x1d8
[   19.209642]  kasan_memcmp+0x16c/0x300
[   19.209856]  kunit_try_run_case+0x170/0x3f0
[   19.209945]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.210180]  kthread+0x328/0x630
[   19.210329]  ret_from_fork+0x10/0x20
[   19.210378] 
[   19.210404] Allocated by task 266:
[   19.210526]  kasan_save_stack+0x3c/0x68
[   19.210594]  kasan_save_track+0x20/0x40
[   19.210722]  kasan_save_alloc_info+0x40/0x58
[   19.210800]  __kasan_kmalloc+0xd4/0xd8
[   19.210839]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.210884]  kasan_memcmp+0xbc/0x300
[   19.210921]  kunit_try_run_case+0x170/0x3f0
[   19.211425]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.211708]  kthread+0x328/0x630
[   19.211744]  ret_from_fork+0x10/0x20
[   19.211898] 
[   19.211972] The buggy address belongs to the object at fff00000c52113c0
[   19.211972]  which belongs to the cache kmalloc-32 of size 32
[   19.212288] The buggy address is located 0 bytes to the right of
[   19.212288]  allocated 24-byte region [fff00000c52113c0, fff00000c52113d8)
[   19.212356] 
[   19.212382] The buggy address belongs to the physical page:
[   19.212414] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105211
[   19.212742] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.212909] page_type: f5(slab)
[   19.213060] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   19.213170] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   19.213221] page dumped because: kasan: bad access detected
[   19.213343] 
[   19.213365] Memory state around the buggy address:
[   19.213398]  fff00000c5211280: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.213507]  fff00000c5211300: 00 00 00 04 fc fc fc fc 00 00 07 fc fc fc fc fc
[   19.213555] >fff00000c5211380: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.213602]                                                     ^
[   19.213700]  fff00000c5211400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.213907]  fff00000c5211480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.214291] ==================================================================

[   20.748400] ==================================================================
[   20.749136] BUG: KASAN: slab-out-of-bounds in memcmp+0x1b4/0x1d0
[   20.749598] Read of size 1 at addr ffff88810383f5d8 by task kunit_try_catch/284
[   20.750307] 
[   20.750723] CPU: 1 UID: 0 PID: 284 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250617 #1 PREEMPT(voluntary) 
[   20.750872] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.750915] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   20.750975] Call Trace:
[   20.751013]  <TASK>
[   20.751059]  dump_stack_lvl+0x73/0xb0
[   20.751138]  print_report+0xd1/0x650
[   20.751212]  ? __virt_addr_valid+0x1db/0x2d0
[   20.751285]  ? memcmp+0x1b4/0x1d0
[   20.751351]  ? kasan_complete_mode_report_info+0x2a/0x200
[   20.751421]  ? memcmp+0x1b4/0x1d0
[   20.751492]  kasan_report+0x141/0x180
[   20.751580]  ? memcmp+0x1b4/0x1d0
[   20.751658]  __asan_report_load1_noabort+0x18/0x20
[   20.751739]  memcmp+0x1b4/0x1d0
[   20.751811]  kasan_memcmp+0x18f/0x390
[   20.751905]  ? trace_hardirqs_on+0x37/0xe0
[   20.751982]  ? __pfx_kasan_memcmp+0x10/0x10
[   20.752047]  ? finish_task_switch.isra.0+0x153/0x700
[   20.752096]  ? __switch_to+0x47/0xf50
[   20.752139]  ? __pfx_read_tsc+0x10/0x10
[   20.752171]  ? ktime_get_ts64+0x86/0x230
[   20.752207]  kunit_try_run_case+0x1a5/0x480
[   20.752305]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.752375]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   20.752410]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   20.752448]  ? __kthread_parkme+0x82/0x180
[   20.752476]  ? preempt_count_sub+0x50/0x80
[   20.752509]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.752543]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.752576]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   20.752608]  kthread+0x337/0x6f0
[   20.752636]  ? trace_preempt_on+0x20/0xc0
[   20.752668]  ? __pfx_kthread+0x10/0x10
[   20.752695]  ? _raw_spin_unlock_irq+0x47/0x80
[   20.752729]  ? calculate_sigpending+0x7b/0xa0
[   20.752762]  ? __pfx_kthread+0x10/0x10
[   20.752791]  ret_from_fork+0x116/0x1d0
[   20.752817]  ? __pfx_kthread+0x10/0x10
[   20.752877]  ret_from_fork_asm+0x1a/0x30
[   20.752920]  </TASK>
[   20.752937] 
[   20.767824] Allocated by task 284:
[   20.768143]  kasan_save_stack+0x45/0x70
[   20.768749]  kasan_save_track+0x18/0x40
[   20.769336]  kasan_save_alloc_info+0x3b/0x50
[   20.769788]  __kasan_kmalloc+0xb7/0xc0
[   20.770183]  __kmalloc_cache_noprof+0x189/0x420
[   20.770868]  kasan_memcmp+0xb7/0x390
[   20.771211]  kunit_try_run_case+0x1a5/0x480
[   20.771753]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.772422]  kthread+0x337/0x6f0
[   20.772797]  ret_from_fork+0x116/0x1d0
[   20.773249]  ret_from_fork_asm+0x1a/0x30
[   20.773646] 
[   20.773856] The buggy address belongs to the object at ffff88810383f5c0
[   20.773856]  which belongs to the cache kmalloc-32 of size 32
[   20.774977] The buggy address is located 0 bytes to the right of
[   20.774977]  allocated 24-byte region [ffff88810383f5c0, ffff88810383f5d8)
[   20.776165] 
[   20.776546] The buggy address belongs to the physical page:
[   20.777053] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10383f
[   20.777911] flags: 0x200000000000000(node=0|zone=2)
[   20.778305] page_type: f5(slab)
[   20.778703] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   20.779512] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   20.780202] page dumped because: kasan: bad access detected
[   20.780890] 
[   20.781110] Memory state around the buggy address:
[   20.781771]  ffff88810383f480: fa fb fb fb fc fc fc fc 00 00 07 fc fc fc fc fc
[   20.782544]  ffff88810383f500: 00 00 00 fc fc fc fc fc 00 00 00 04 fc fc fc fc
[   20.783187] >ffff88810383f580: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   20.783916]                                                     ^
[   20.784647]  ffff88810383f600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.785232]  ffff88810383f680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.785988] ==================================================================