Hay
Date
Nov. 20, 2024, 6:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   35.550969] ==================================================================
[   35.552096] BUG: KASAN: slab-out-of-bounds in kmalloc_node_oob_right+0x2f4/0x330
[   35.552978] Read of size 1 at addr fff00000c649d000 by task kunit_try_catch/129
[   35.553899] 
[   35.554285] CPU: 1 UID: 0 PID: 129 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241120 #1
[   35.555677] Tainted: [B]=BAD_PAGE, [N]=TEST
[   35.556695] Hardware name: linux,dummy-virt (DT)
[   35.557195] Call trace:
[   35.558054]  show_stack+0x20/0x38 (C)
[   35.558654]  dump_stack_lvl+0x8c/0xd0
[   35.559359]  print_report+0x118/0x5e0
[   35.559911]  kasan_report+0xc8/0x118
[   35.560489]  __asan_report_load1_noabort+0x20/0x30
[   35.561276]  kmalloc_node_oob_right+0x2f4/0x330
[   35.562459]  kunit_try_run_case+0x14c/0x3d0
[   35.562975]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   35.563615]  kthread+0x24c/0x2d0
[   35.564143]  ret_from_fork+0x10/0x20
[   35.564696] 
[   35.564982] Allocated by task 129:
[   35.565807]  kasan_save_stack+0x3c/0x68
[   35.566474]  kasan_save_track+0x20/0x40
[   35.567006]  kasan_save_alloc_info+0x40/0x58
[   35.567632]  __kasan_kmalloc+0xd4/0xd8
[   35.568178]  __kmalloc_cache_node_noprof+0x164/0x3d0
[   35.568767]  kmalloc_node_oob_right+0xbc/0x330
[   35.569396]  kunit_try_run_case+0x14c/0x3d0
[   35.570380]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   35.571089]  kthread+0x24c/0x2d0
[   35.571578]  ret_from_fork+0x10/0x20
[   35.572041] 
[   35.572388] The buggy address belongs to the object at fff00000c649c000
[   35.572388]  which belongs to the cache kmalloc-4k of size 4096
[   35.573721] The buggy address is located 0 bytes to the right of
[   35.573721]  allocated 4096-byte region [fff00000c649c000, fff00000c649d000)
[   35.575559] 
[   35.575849] The buggy address belongs to the physical page:
[   35.576623] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106498
[   35.578023] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   35.578769] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   35.579650] page_type: f5(slab)
[   35.580169] raw: 0bfffe0000000040 fff00000c0002140 dead000000000122 0000000000000000
[   35.580927] raw: 0000000000000000 0000000080040004 00000001f5000000 0000000000000000
[   35.581995] head: 0bfffe0000000040 fff00000c0002140 dead000000000122 0000000000000000
[   35.583006] head: 0000000000000000 0000000080040004 00000001f5000000 0000000000000000
[   35.583838] head: 0bfffe0000000003 ffffc1ffc3192601 ffffffffffffffff 0000000000000000
[   35.584614] head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
[   35.585645] page dumped because: kasan: bad access detected
[   35.586313] 
[   35.586760] Memory state around the buggy address:
[   35.587403]  fff00000c649cf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   35.588408]  fff00000c649cf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   35.589489] >fff00000c649d000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   35.590667]                    ^
[   35.591236]  fff00000c649d080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   35.592124]  fff00000c649d100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   35.592987] ==================================================================

[   26.752277] ==================================================================
[   26.753833] BUG: KASAN: slab-out-of-bounds in kmalloc_node_oob_right+0x36b/0x3d0
[   26.754749] Read of size 1 at addr ffff888102b93000 by task kunit_try_catch/147
[   26.755778] 
[   26.756361] CPU: 0 UID: 0 PID: 147 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241120 #1
[   26.757600] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.758304] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.759059] Call Trace:
[   26.759968]  <TASK>
[   26.760259]  dump_stack_lvl+0x73/0xb0
[   26.760560]  print_report+0xd1/0x640
[   26.761492]  ? __virt_addr_valid+0x1db/0x2d0
[   26.762871]  ? kasan_complete_mode_report_info+0x2a/0x200
[   26.763438]  kasan_report+0x102/0x140
[   26.764224]  ? kmalloc_node_oob_right+0x36b/0x3d0
[   26.764719]  ? kmalloc_node_oob_right+0x36b/0x3d0
[   26.765177]  __asan_report_load1_noabort+0x18/0x20
[   26.765618]  kmalloc_node_oob_right+0x36b/0x3d0
[   26.766113]  ? __pfx_kmalloc_node_oob_right+0x10/0x10
[   26.766576]  ? __schedule+0xc3e/0x2790
[   26.767880]  ? __pfx_read_tsc+0x10/0x10
[   26.768512]  ? ktime_get_ts64+0x84/0x230
[   26.769757]  kunit_try_run_case+0x1b3/0x490
[   26.770254]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.770928]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   26.771469]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.772376]  ? __kthread_parkme+0x82/0x160
[   26.773169]  ? preempt_count_sub+0x50/0x80
[   26.774019]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.774600]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.775220]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.776546]  kthread+0x257/0x310
[   26.776803]  ? __pfx_kthread+0x10/0x10
[   26.777893]  ret_from_fork+0x41/0x80
[   26.778304]  ? __pfx_kthread+0x10/0x10
[   26.778722]  ret_from_fork_asm+0x1a/0x30
[   26.779034]  </TASK>
[   26.779966] 
[   26.780258] Allocated by task 147:
[   26.780646]  kasan_save_stack+0x3d/0x60
[   26.780962]  kasan_save_track+0x18/0x40
[   26.781378]  kasan_save_alloc_info+0x3b/0x50
[   26.782556]  __kasan_kmalloc+0xb7/0xc0
[   26.783260]  __kmalloc_cache_node_noprof+0x183/0x420
[   26.783823]  kmalloc_node_oob_right+0xac/0x3d0
[   26.784530]  kunit_try_run_case+0x1b3/0x490
[   26.784914]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.785870]  kthread+0x257/0x310
[   26.786462]  ret_from_fork+0x41/0x80
[   26.787029]  ret_from_fork_asm+0x1a/0x30
[   26.787510] 
[   26.787766] The buggy address belongs to the object at ffff888102b92000
[   26.787766]  which belongs to the cache kmalloc-4k of size 4096
[   26.789800] The buggy address is located 0 bytes to the right of
[   26.789800]  allocated 4096-byte region [ffff888102b92000, ffff888102b93000)
[   26.791547] 
[   26.791728] The buggy address belongs to the physical page:
[   26.792470] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b90
[   26.793602] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   26.794784] flags: 0x200000000000040(head|node=0|zone=2)
[   26.795808] page_type: f5(slab)
[   26.796544] raw: 0200000000000040 ffff888100042140 dead000000000122 0000000000000000
[   26.797646] raw: 0000000000000000 0000000080040004 00000001f5000000 0000000000000000
[   26.798882] head: 0200000000000040 ffff888100042140 dead000000000122 0000000000000000
[   26.799313] head: 0000000000000000 0000000080040004 00000001f5000000 0000000000000000
[   26.800170] head: 0200000000000003 ffffea00040ae401 ffffffffffffffff 0000000000000000
[   26.800650] head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
[   26.801374] page dumped because: kasan: bad access detected
[   26.802381] 
[   26.802669] Memory state around the buggy address:
[   26.803191]  ffff888102b92f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   26.803882]  ffff888102b92f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   26.804642] >ffff888102b93000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.805329]                    ^
[   26.805615]  ffff888102b93080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.806548]  ffff888102b93100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.807211] ==================================================================