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

Environment
qemu-arm64
qemu-x86_64

[   32.117761] ==================================================================
[   32.119008] BUG: KASAN: slab-out-of-bounds in kmalloc_node_oob_right+0x2f4/0x330
[   32.119865] Read of size 1 at addr fff00000c5e1d000 by task kunit_try_catch/129
[   32.120746] 
[   32.121068] CPU: 1 UID: 0 PID: 129 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241122 #1
[   32.123082] Tainted: [B]=BAD_PAGE, [N]=TEST
[   32.123675] Hardware name: linux,dummy-virt (DT)
[   32.124339] Call trace:
[   32.124775]  show_stack+0x20/0x38 (C)
[   32.126133]  dump_stack_lvl+0x8c/0xd0
[   32.126931]  print_report+0x118/0x5e0
[   32.128132]  kasan_report+0xc8/0x118
[   32.128709]  __asan_report_load1_noabort+0x20/0x30
[   32.129083]  kmalloc_node_oob_right+0x2f4/0x330
[   32.129404]  kunit_try_run_case+0x14c/0x3d0
[   32.130008]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.131657]  kthread+0x24c/0x2d0
[   32.132202]  ret_from_fork+0x10/0x20
[   32.133250] 
[   32.133662] Allocated by task 129:
[   32.134278]  kasan_save_stack+0x3c/0x68
[   32.134879]  kasan_save_track+0x20/0x40
[   32.135412]  kasan_save_alloc_info+0x40/0x58
[   32.137079]  __kasan_kmalloc+0xd4/0xd8
[   32.137375]  __kmalloc_cache_node_noprof+0x164/0x3d0
[   32.137902]  kmalloc_node_oob_right+0xbc/0x330
[   32.139375]  kunit_try_run_case+0x14c/0x3d0
[   32.140067]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.140696]  kthread+0x24c/0x2d0
[   32.142109]  ret_from_fork+0x10/0x20
[   32.142946] 
[   32.143218] The buggy address belongs to the object at fff00000c5e1c000
[   32.143218]  which belongs to the cache kmalloc-4k of size 4096
[   32.145454] The buggy address is located 0 bytes to the right of
[   32.145454]  allocated 4096-byte region [fff00000c5e1c000, fff00000c5e1d000)
[   32.146966] 
[   32.147304] The buggy address belongs to the physical page:
[   32.148325] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105e18
[   32.149675] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   32.151065] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   32.151774] page_type: f5(slab)
[   32.152545] raw: 0bfffe0000000040 fff00000c0002140 dead000000000122 0000000000000000
[   32.153788] raw: 0000000000000000 0000000080040004 00000001f5000000 0000000000000000
[   32.154950] head: 0bfffe0000000040 fff00000c0002140 dead000000000122 0000000000000000
[   32.156699] head: 0000000000000000 0000000080040004 00000001f5000000 0000000000000000
[   32.157699] head: 0bfffe0000000003 ffffc1ffc3178601 ffffffffffffffff 0000000000000000
[   32.159417] head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
[   32.161394] page dumped because: kasan: bad access detected
[   32.162047] 
[   32.162310] Memory state around the buggy address:
[   32.162936]  fff00000c5e1cf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   32.164549]  fff00000c5e1cf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   32.166813] >fff00000c5e1d000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.167676]                    ^
[   32.168380]  fff00000c5e1d080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.169961]  fff00000c5e1d100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.171712] ==================================================================

[   23.807732] ==================================================================
[   23.808894] BUG: KASAN: slab-out-of-bounds in kmalloc_node_oob_right+0x36b/0x3d0
[   23.809418] Read of size 1 at addr ffff888102be1000 by task kunit_try_catch/148
[   23.809886] 
[   23.810105] CPU: 1 UID: 0 PID: 148 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241122 #1
[   23.811148] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.811562] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   23.812359] Call Trace:
[   23.812785]  <TASK>
[   23.813143]  dump_stack_lvl+0x73/0xb0
[   23.813507]  print_report+0xd1/0x640
[   23.813787]  ? __virt_addr_valid+0x1db/0x2d0
[   23.814124]  ? kasan_complete_mode_report_info+0x2a/0x200
[   23.814845]  kasan_report+0x102/0x140
[   23.815625]  ? kmalloc_node_oob_right+0x36b/0x3d0
[   23.816230]  ? kmalloc_node_oob_right+0x36b/0x3d0
[   23.816739]  __asan_report_load1_noabort+0x18/0x20
[   23.817371]  kmalloc_node_oob_right+0x36b/0x3d0
[   23.818028]  ? __pfx_kmalloc_node_oob_right+0x10/0x10
[   23.818493]  ? __schedule+0xc3e/0x2790
[   23.818996]  ? __pfx_read_tsc+0x10/0x10
[   23.819437]  ? ktime_get_ts64+0x84/0x230
[   23.819941]  kunit_try_run_case+0x1b3/0x490
[   23.820494]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.821218]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   23.821724]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   23.822383]  ? __kthread_parkme+0x82/0x160
[   23.822806]  ? preempt_count_sub+0x50/0x80
[   23.823373]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.823739]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   23.824517]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.825179]  kthread+0x257/0x310
[   23.825527]  ? __pfx_kthread+0x10/0x10
[   23.826131]  ret_from_fork+0x41/0x80
[   23.826591]  ? __pfx_kthread+0x10/0x10
[   23.827073]  ret_from_fork_asm+0x1a/0x30
[   23.827433]  </TASK>
[   23.827883] 
[   23.828163] Allocated by task 148:
[   23.828623]  kasan_save_stack+0x3d/0x60
[   23.829229]  kasan_save_track+0x18/0x40
[   23.829626]  kasan_save_alloc_info+0x3b/0x50
[   23.830286]  __kasan_kmalloc+0xb7/0xc0
[   23.830721]  __kmalloc_cache_node_noprof+0x183/0x420
[   23.831195]  kmalloc_node_oob_right+0xac/0x3d0
[   23.831566]  kunit_try_run_case+0x1b3/0x490
[   23.831863]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.832178]  kthread+0x257/0x310
[   23.832642]  ret_from_fork+0x41/0x80
[   23.833066]  ret_from_fork_asm+0x1a/0x30
[   23.833551] 
[   23.833860] The buggy address belongs to the object at ffff888102be0000
[   23.833860]  which belongs to the cache kmalloc-4k of size 4096
[   23.834977] The buggy address is located 0 bytes to the right of
[   23.834977]  allocated 4096-byte region [ffff888102be0000, ffff888102be1000)
[   23.836194] 
[   23.837141] The buggy address belongs to the physical page:
[   23.838966] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102be0
[   23.840113] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   23.841733] flags: 0x200000000000040(head|node=0|zone=2)
[   23.843023] page_type: f5(slab)
[   23.843473] raw: 0200000000000040 ffff888100042140 dead000000000122 0000000000000000
[   23.844124] raw: 0000000000000000 0000000080040004 00000001f5000000 0000000000000000
[   23.844562] head: 0200000000000040 ffff888100042140 dead000000000122 0000000000000000
[   23.845319] head: 0000000000000000 0000000080040004 00000001f5000000 0000000000000000
[   23.846360] head: 0200000000000003 ffffea00040af801 ffffffffffffffff 0000000000000000
[   23.847297] head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
[   23.848139] page dumped because: kasan: bad access detected
[   23.848943] 
[   23.849189] Memory state around the buggy address:
[   23.849800]  ffff888102be0f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.850195]  ffff888102be0f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.851109] >ffff888102be1000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.851633]                    ^
[   23.852115]  ffff888102be1080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.852762]  ffff888102be1100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.853762] ==================================================================