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

Environment
qemu-arm64
qemu-x86_64

[   33.466372] ==================================================================
[   33.467461] BUG: KASAN: slab-out-of-bounds in memcmp+0x198/0x1d8
[   33.468172] Read of size 1 at addr fff00000c4081ad8 by task kunit_try_catch/245
[   33.469219] 
[   33.469566] CPU: 1 UID: 0 PID: 245 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   33.470816] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.471456] Hardware name: linux,dummy-virt (DT)
[   33.472147] Call trace:
[   33.472604]  show_stack+0x20/0x38 (C)
[   33.473437]  dump_stack_lvl+0x8c/0xd0
[   33.473934]  print_report+0x118/0x5e0
[   33.474548]  kasan_report+0xc8/0x118
[   33.475052]  __asan_report_load1_noabort+0x20/0x30
[   33.475760]  memcmp+0x198/0x1d8
[   33.476299]  kasan_memcmp+0x16c/0x300
[   33.476842]  kunit_try_run_case+0x14c/0x3d0
[   33.477558]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.478246]  kthread+0x24c/0x2d0
[   33.478737]  ret_from_fork+0x10/0x20
[   33.479541] 
[   33.480099] Allocated by task 245:
[   33.480659]  kasan_save_stack+0x3c/0x68
[   33.481665]  kasan_save_track+0x20/0x40
[   33.482264]  kasan_save_alloc_info+0x40/0x58
[   33.482845]  __kasan_kmalloc+0xd4/0xd8
[   33.483140]  __kmalloc_cache_noprof+0x15c/0x3c0
[   33.483814]  kasan_memcmp+0xbc/0x300
[   33.484499]  kunit_try_run_case+0x14c/0x3d0
[   33.485089]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.486051]  kthread+0x24c/0x2d0
[   33.486591]  ret_from_fork+0x10/0x20
[   33.487180] 
[   33.487545] The buggy address belongs to the object at fff00000c4081ac0
[   33.487545]  which belongs to the cache kmalloc-32 of size 32
[   33.488671] The buggy address is located 0 bytes to the right of
[   33.488671]  allocated 24-byte region [fff00000c4081ac0, fff00000c4081ad8)
[   33.490715] 
[   33.490994] The buggy address belongs to the physical page:
[   33.491505] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104081
[   33.492633] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   33.493806] page_type: f5(slab)
[   33.494533] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   33.495673] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   33.496505] page dumped because: kasan: bad access detected
[   33.497191] 
[   33.497574] Memory state around the buggy address:
[   33.498219]  fff00000c4081980: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   33.499181]  fff00000c4081a00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   33.500154] >fff00000c4081a80: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   33.501287]                                                     ^
[   33.501945]  fff00000c4081b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.502762]  fff00000c4081b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.503546] ==================================================================

[   24.401174] ==================================================================
[   24.402408] BUG: KASAN: slab-out-of-bounds in memcmp+0x1b4/0x1d0
[   24.403314] Read of size 1 at addr ffff888102a34118 by task kunit_try_catch/265
[   24.404729] 
[   24.405181] CPU: 0 UID: 0 PID: 265 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   24.406288] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.406975] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.408014] Call Trace:
[   24.408505]  <TASK>
[   24.408757]  dump_stack_lvl+0x73/0xb0
[   24.409400]  print_report+0xd1/0x640
[   24.409755]  ? __virt_addr_valid+0x1db/0x2d0
[   24.410414]  ? kasan_complete_mode_report_info+0x2a/0x200
[   24.411022]  kasan_report+0x102/0x140
[   24.412064]  ? memcmp+0x1b4/0x1d0
[   24.412662]  ? memcmp+0x1b4/0x1d0
[   24.413387]  __asan_report_load1_noabort+0x18/0x20
[   24.414072]  memcmp+0x1b4/0x1d0
[   24.414842]  kasan_memcmp+0x190/0x390
[   24.415568]  ? trace_hardirqs_on+0x37/0xe0
[   24.416314]  ? __pfx_kasan_memcmp+0x10/0x10
[   24.416885]  ? finish_task_switch.isra.0+0x153/0x700
[   24.417245]  ? __switch_to+0x5d9/0xf60
[   24.418089]  ? __pfx_read_tsc+0x10/0x10
[   24.419075]  ? ktime_get_ts64+0x84/0x230
[   24.419681]  kunit_try_run_case+0x1b3/0x490
[   24.420103]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.421035]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   24.421650]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.422529]  ? __kthread_parkme+0x82/0x160
[   24.423327]  ? preempt_count_sub+0x50/0x80
[   24.423907]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.424730]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.425243]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.425830]  kthread+0x257/0x310
[   24.426191]  ? __pfx_kthread+0x10/0x10
[   24.426815]  ret_from_fork+0x41/0x80
[   24.427615]  ? __pfx_kthread+0x10/0x10
[   24.428044]  ret_from_fork_asm+0x1a/0x30
[   24.428732]  </TASK>
[   24.428951] 
[   24.429190] Allocated by task 265:
[   24.429800]  kasan_save_stack+0x3d/0x60
[   24.430153]  kasan_save_track+0x18/0x40
[   24.430924]  kasan_save_alloc_info+0x3b/0x50
[   24.431463]  __kasan_kmalloc+0xb7/0xc0
[   24.431915]  __kmalloc_cache_noprof+0x184/0x410
[   24.432528]  kasan_memcmp+0xb8/0x390
[   24.432922]  kunit_try_run_case+0x1b3/0x490
[   24.433327]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.434005]  kthread+0x257/0x310
[   24.434516]  ret_from_fork+0x41/0x80
[   24.434999]  ret_from_fork_asm+0x1a/0x30
[   24.435634] 
[   24.436471] The buggy address belongs to the object at ffff888102a34100
[   24.436471]  which belongs to the cache kmalloc-32 of size 32
[   24.437868] The buggy address is located 0 bytes to the right of
[   24.437868]  allocated 24-byte region [ffff888102a34100, ffff888102a34118)
[   24.439638] 
[   24.439893] The buggy address belongs to the physical page:
[   24.441003] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a34
[   24.441647] flags: 0x200000000000000(node=0|zone=2)
[   24.442292] page_type: f5(slab)
[   24.443040] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   24.444049] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   24.444804] page dumped because: kasan: bad access detected
[   24.445743] 
[   24.445945] Memory state around the buggy address:
[   24.446529]  ffff888102a34000: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   24.448018]  ffff888102a34080: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   24.449008] >ffff888102a34100: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.449604]                             ^
[   24.450152]  ffff888102a34180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.450963]  ffff888102a34200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.451995] ==================================================================