Hay
Date
Dec. 9, 2024, 6:35 a.m.

Environment
qemu-x86_64

[   27.289850] ==================================================================
[   27.291066] BUG: KASAN: slab-out-of-bounds in memcmp+0x1b4/0x1d0
[   27.292254] Read of size 1 at addr ffff888102964d18 by task kunit_try_catch/264
[   27.293818] 
[   27.294508] CPU: 0 UID: 0 PID: 264 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc2-next-20241209 #1
[   27.295060] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.295480] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.297271] Call Trace:
[   27.297692]  <TASK>
[   27.297906]  dump_stack_lvl+0x73/0xb0
[   27.298674]  print_report+0xd1/0x640
[   27.298954]  ? __virt_addr_valid+0x1db/0x2d0
[   27.299528]  ? kasan_complete_mode_report_info+0x2a/0x200
[   27.300404]  kasan_report+0x102/0x140
[   27.301196]  ? memcmp+0x1b4/0x1d0
[   27.301770]  ? memcmp+0x1b4/0x1d0
[   27.302469]  __asan_report_load1_noabort+0x18/0x20
[   27.303329]  memcmp+0x1b4/0x1d0
[   27.303763]  kasan_memcmp+0x190/0x390
[   27.304742]  ? trace_hardirqs_on+0x37/0xe0
[   27.305587]  ? __pfx_kasan_memcmp+0x10/0x10
[   27.306267]  ? finish_task_switch.isra.0+0x153/0x700
[   27.306760]  ? __switch_to+0x5d9/0xf60
[   27.307735]  ? __pfx_read_tsc+0x10/0x10
[   27.308381]  ? ktime_get_ts64+0x86/0x230
[   27.309132]  kunit_try_run_case+0x1b3/0x490
[   27.309752]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.310711]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   27.311712]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.313103]  ? __kthread_parkme+0x82/0x160
[   27.313946]  ? preempt_count_sub+0x50/0x80
[   27.314548]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.315656]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.316373]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.317109]  kthread+0x257/0x310
[   27.317857]  ? __pfx_kthread+0x10/0x10
[   27.318698]  ret_from_fork+0x41/0x80
[   27.319124]  ? __pfx_kthread+0x10/0x10
[   27.320345]  ret_from_fork_asm+0x1a/0x30
[   27.320808]  </TASK>
[   27.321564] 
[   27.321795] Allocated by task 264:
[   27.322660]  kasan_save_stack+0x3d/0x60
[   27.323362]  kasan_save_track+0x18/0x40
[   27.323807]  kasan_save_alloc_info+0x3b/0x50
[   27.324850]  __kasan_kmalloc+0xb7/0xc0
[   27.325929]  __kmalloc_cache_noprof+0x184/0x410
[   27.326354]  kasan_memcmp+0xb8/0x390
[   27.326731]  kunit_try_run_case+0x1b3/0x490
[   27.327437]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.328612]  kthread+0x257/0x310
[   27.328864]  ret_from_fork+0x41/0x80
[   27.329866]  ret_from_fork_asm+0x1a/0x30
[   27.331378] 
[   27.331637] The buggy address belongs to the object at ffff888102964d00
[   27.331637]  which belongs to the cache kmalloc-32 of size 32
[   27.333521] The buggy address is located 0 bytes to the right of
[   27.333521]  allocated 24-byte region [ffff888102964d00, ffff888102964d18)
[   27.334658] 
[   27.334881] The buggy address belongs to the physical page:
[   27.335632] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102964
[   27.336558] flags: 0x200000000000000(node=0|zone=2)
[   27.337420] page_type: f5(slab)
[   27.337984] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   27.338965] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   27.339846] page dumped because: kasan: bad access detected
[   27.340528] 
[   27.340794] Memory state around the buggy address:
[   27.341748]  ffff888102964c00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.342573]  ffff888102964c80: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   27.343510] >ffff888102964d00: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.344173]                             ^
[   27.344934]  ffff888102964d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.345735]  ffff888102964e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.346692] ==================================================================