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

Environment
qemu-arm64
qemu-x86_64

[   23.223996] ==================================================================
[   23.225058] BUG: KASAN: slab-out-of-bounds in kmalloc_big_oob_right+0x2a4/0x2f0
[   23.225865] Write of size 1 at addr fff00000c5dc5f00 by task kunit_try_catch/132
[   23.226751] 
[   23.227176] CPU: 1 UID: 0 PID: 132 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc2-next-20241209 #1
[   23.228493] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.229266] Hardware name: linux,dummy-virt (DT)
[   23.229757] Call trace:
[   23.230144]  show_stack+0x20/0x38 (C)
[   23.230853]  dump_stack_lvl+0x8c/0xd0
[   23.232208]  print_report+0x118/0x5e0
[   23.232785]  kasan_report+0xc8/0x118
[   23.233440]  __asan_report_store1_noabort+0x20/0x30
[   23.234269]  kmalloc_big_oob_right+0x2a4/0x2f0
[   23.235231]  kunit_try_run_case+0x14c/0x3d0
[   23.235815]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.236620]  kthread+0x24c/0x2d0
[   23.237209]  ret_from_fork+0x10/0x20
[   23.237792] 
[   23.238093] Allocated by task 132:
[   23.238609]  kasan_save_stack+0x3c/0x68
[   23.239464]  kasan_save_track+0x20/0x40
[   23.240047]  kasan_save_alloc_info+0x40/0x58
[   23.240720]  __kasan_kmalloc+0xd4/0xd8
[   23.241317]  __kmalloc_cache_noprof+0x15c/0x3c0
[   23.241956]  kmalloc_big_oob_right+0xb8/0x2f0
[   23.242587]  kunit_try_run_case+0x14c/0x3d0
[   23.243378]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.243882]  kthread+0x24c/0x2d0
[   23.244241]  ret_from_fork+0x10/0x20
[   23.244656] 
[   23.245132] The buggy address belongs to the object at fff00000c5dc4000
[   23.245132]  which belongs to the cache kmalloc-8k of size 8192
[   23.246738] The buggy address is located 0 bytes to the right of
[   23.246738]  allocated 7936-byte region [fff00000c5dc4000, fff00000c5dc5f00)
[   23.248356] 
[   23.248749] The buggy address belongs to the physical page:
[   23.249383] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105dc0
[   23.250412] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   23.251567] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   23.252475] page_type: f5(slab)
[   23.253293] raw: 0bfffe0000000040 fff00000c0002280 dead000000000122 0000000000000000
[   23.254241] raw: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000
[   23.255214] head: 0bfffe0000000040 fff00000c0002280 dead000000000122 0000000000000000
[   23.256063] head: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000
[   23.257003] head: 0bfffe0000000003 ffffc1ffc3177001 ffffffffffffffff 0000000000000000
[   23.257743] head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
[   23.258797] page dumped because: kasan: bad access detected
[   23.259517] 
[   23.259816] Memory state around the buggy address:
[   23.260472]  fff00000c5dc5e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.261265]  fff00000c5dc5e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.262175] >fff00000c5dc5f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.262937]                    ^
[   23.263889]  fff00000c5dc5f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.264534]  fff00000c5dc6000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.265421] ==================================================================

[   22.815972] ==================================================================
[   22.817205] BUG: KASAN: slab-out-of-bounds in kmalloc_big_oob_right+0x318/0x370
[   22.817958] Write of size 1 at addr ffff8881029ddf00 by task kunit_try_catch/151
[   22.818735] 
[   22.819122] CPU: 0 UID: 0 PID: 151 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc2-next-20241209 #1
[   22.819856] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.820388] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.821184] Call Trace:
[   22.821887]  <TASK>
[   22.822598]  dump_stack_lvl+0x73/0xb0
[   22.823549]  print_report+0xd1/0x640
[   22.824193]  ? __virt_addr_valid+0x1db/0x2d0
[   22.824658]  ? kasan_complete_mode_report_info+0x2a/0x200
[   22.826348]  kasan_report+0x102/0x140
[   22.826928]  ? kmalloc_big_oob_right+0x318/0x370
[   22.827732]  ? kmalloc_big_oob_right+0x318/0x370
[   22.828526]  __asan_report_store1_noabort+0x1b/0x30
[   22.829291]  kmalloc_big_oob_right+0x318/0x370
[   22.829597]  ? __pfx_kmalloc_big_oob_right+0x10/0x10
[   22.831077]  ? __schedule+0xc70/0x27e0
[   22.831484]  ? __pfx_read_tsc+0x10/0x10
[   22.831706]  ? ktime_get_ts64+0x86/0x230
[   22.832400]  kunit_try_run_case+0x1b3/0x490
[   22.833348]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.834003]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   22.835386]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.835871]  ? __kthread_parkme+0x82/0x160
[   22.836741]  ? preempt_count_sub+0x50/0x80
[   22.837614]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.838594]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.839129]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.840010]  kthread+0x257/0x310
[   22.841091]  ? __pfx_kthread+0x10/0x10
[   22.841502]  ret_from_fork+0x41/0x80
[   22.842348]  ? __pfx_kthread+0x10/0x10
[   22.842844]  ret_from_fork_asm+0x1a/0x30
[   22.843407]  </TASK>
[   22.843718] 
[   22.843882] Allocated by task 151:
[   22.844655]  kasan_save_stack+0x3d/0x60
[   22.846046]  kasan_save_track+0x18/0x40
[   22.846589]  kasan_save_alloc_info+0x3b/0x50
[   22.847517]  __kasan_kmalloc+0xb7/0xc0
[   22.848384]  __kmalloc_cache_noprof+0x184/0x410
[   22.848701]  kmalloc_big_oob_right+0xaa/0x370
[   22.849025]  kunit_try_run_case+0x1b3/0x490
[   22.849530]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.849895]  kthread+0x257/0x310
[   22.850379]  ret_from_fork+0x41/0x80
[   22.850995]  ret_from_fork_asm+0x1a/0x30
[   22.852096] 
[   22.852759] The buggy address belongs to the object at ffff8881029dc000
[   22.852759]  which belongs to the cache kmalloc-8k of size 8192
[   22.853836] The buggy address is located 0 bytes to the right of
[   22.853836]  allocated 7936-byte region [ffff8881029dc000, ffff8881029ddf00)
[   22.856161] 
[   22.856526] The buggy address belongs to the physical page:
[   22.856914] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1029d8
[   22.858066] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   22.858806] flags: 0x200000000000040(head|node=0|zone=2)
[   22.859987] page_type: f5(slab)
[   22.860799] raw: 0200000000000040 ffff888100042280 dead000000000122 0000000000000000
[   22.861557] raw: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000
[   22.863281] head: 0200000000000040 ffff888100042280 dead000000000122 0000000000000000
[   22.864597] head: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000
[   22.865804] head: 0200000000000003 ffffea00040a7601 ffffffffffffffff 0000000000000000
[   22.866824] head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
[   22.867804] page dumped because: kasan: bad access detected
[   22.869052] 
[   22.869198] Memory state around the buggy address:
[   22.869795]  ffff8881029dde00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.870569]  ffff8881029dde80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.871870] >ffff8881029ddf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.872727]                    ^
[   22.873374]  ffff8881029ddf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.874134]  ffff8881029de000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.875237] ==================================================================