Hay
Date
Dec. 6, 2024, 3:11 p.m.

Environment
qemu-x86_64

[   21.996514] ==================================================================
[   21.998654] BUG: KASAN: slab-out-of-bounds in kmalloc_node_oob_right+0x36b/0x3d0
[   21.999394] Read of size 1 at addr ffff8881027af000 by task kunit_try_catch/148
[   22.000541] 
[   22.001602] CPU: 0 UID: 0 PID: 148 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241206 #1
[   22.003187] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.003648] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.005072] Call Trace:
[   22.005350]  <TASK>
[   22.005544]  dump_stack_lvl+0x73/0xb0
[   22.005899]  print_report+0xd1/0x640
[   22.006611]  ? __virt_addr_valid+0x1db/0x2d0
[   22.007114]  ? kasan_complete_mode_report_info+0x2a/0x200
[   22.007432]  kasan_report+0x102/0x140
[   22.007796]  ? kmalloc_node_oob_right+0x36b/0x3d0
[   22.008856]  ? kmalloc_node_oob_right+0x36b/0x3d0
[   22.009698]  __asan_report_load1_noabort+0x18/0x20
[   22.010486]  kmalloc_node_oob_right+0x36b/0x3d0
[   22.011596]  ? __pfx_kmalloc_node_oob_right+0x10/0x10
[   22.012546]  ? __schedule+0xc70/0x27e0
[   22.013527]  ? __pfx_read_tsc+0x10/0x10
[   22.014505]  ? ktime_get_ts64+0x86/0x230
[   22.015442]  kunit_try_run_case+0x1b3/0x490
[   22.016208]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.017058]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   22.018016]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.018731]  ? __kthread_parkme+0x82/0x160
[   22.019318]  ? preempt_count_sub+0x50/0x80
[   22.019710]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.020724]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.021345]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.023210]  kthread+0x257/0x310
[   22.024382]  ? __pfx_kthread+0x10/0x10
[   22.025062]  ret_from_fork+0x41/0x80
[   22.026591]  ? __pfx_kthread+0x10/0x10
[   22.027523]  ret_from_fork_asm+0x1a/0x30
[   22.028465]  </TASK>
[   22.029460] 
[   22.029771] Allocated by task 148:
[   22.030740]  kasan_save_stack+0x3d/0x60
[   22.031321]  kasan_save_track+0x18/0x40
[   22.031566]  kasan_save_alloc_info+0x3b/0x50
[   22.032349]  __kasan_kmalloc+0xb7/0xc0
[   22.032751]  __kmalloc_cache_node_noprof+0x183/0x410
[   22.033264]  kmalloc_node_oob_right+0xac/0x3d0
[   22.033710]  kunit_try_run_case+0x1b3/0x490
[   22.035747]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.036104]  kthread+0x257/0x310
[   22.036281]  ret_from_fork+0x41/0x80
[   22.036450]  ret_from_fork_asm+0x1a/0x30
[   22.036993] 
[   22.037309] The buggy address belongs to the object at ffff8881027ae000
[   22.037309]  which belongs to the cache kmalloc-4k of size 4096
[   22.041183] The buggy address is located 0 bytes to the right of
[   22.041183]  allocated 4096-byte region [ffff8881027ae000, ffff8881027af000)
[   22.044536] 
[   22.044845] The buggy address belongs to the physical page:
[   22.045435] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027a8
[   22.046416] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   22.047826] flags: 0x200000000000040(head|node=0|zone=2)
[   22.048891] page_type: f5(slab)
[   22.049983] raw: 0200000000000040 ffff888100042140 dead000000000122 0000000000000000
[   22.050803] raw: 0000000000000000 0000000080040004 00000000f5000000 0000000000000000
[   22.052246] head: 0200000000000040 ffff888100042140 dead000000000122 0000000000000000
[   22.053193] head: 0000000000000000 0000000080040004 00000000f5000000 0000000000000000
[   22.054521] head: 0200000000000003 ffffea000409ea01 ffffffffffffffff 0000000000000000
[   22.055377] head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
[   22.057577] page dumped because: kasan: bad access detected
[   22.058402] 
[   22.058604] Memory state around the buggy address:
[   22.059099]  ffff8881027aef00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.060924]  ffff8881027aef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.061686] >ffff8881027af000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.062441]                    ^
[   22.063183]  ffff8881027af080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.064660]  ffff8881027af100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.064984] ==================================================================