Hay
Date
Feb. 5, 2025, 2:09 p.m.

Environment
qemu-armv7
qemu-x86_64

[  144.559231] ==================================================================
[  144.560289] BUG: KASAN: slab-out-of-bounds in kmalloc_large_oob_right+0xcc/0x1dc
[  144.561077] Write of size 1 at addr c8e91f00 by task kunit_try_catch/127
[  144.561861] 
[  144.562190] CPU: 0 PID: 127 Comm: kunit_try_catch Tainted: G    B            N 6.6.76-rc1 #1
[  144.563080] Hardware name: Generic DT based system
[  144.563562]  unwind_backtrace from show_stack+0x18/0x1c
[  144.564240]  show_stack from dump_stack_lvl+0x58/0x70
[  144.564926]  dump_stack_lvl from print_report+0x164/0x51c
[  144.565720]  print_report from kasan_report+0xc8/0x104
[  144.566409]  kasan_report from kmalloc_large_oob_right+0xcc/0x1dc
[  144.567316]  kmalloc_large_oob_right from kunit_try_run_case+0x11c/0x2e4
[  144.568615]  kunit_try_run_case from kunit_generic_run_threadfn_adapter+0x2c/0x48
[  144.569731]  kunit_generic_run_threadfn_adapter from kthread+0x184/0x1a8
[  144.570721]  kthread from ret_from_fork+0x14/0x30
[  144.571513] Exception stack(0xf9f03fb0 to 0xf9f03ff8)
[  144.572188] 3fa0:                                     00000000 00000000 00000000 00000000
[  144.573166] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  144.574143] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[  144.574872] 
[  144.575223] Allocated by task 127:
[  144.575582]  kasan_set_track+0x3c/0x5c
[  144.576140]  __kasan_kmalloc+0x8c/0x94
[  144.576629]  kmalloc_large_oob_right+0xa0/0x1dc
[  144.577576]  kunit_try_run_case+0x11c/0x2e4
[  144.578090]  kunit_generic_run_threadfn_adapter+0x2c/0x48
[  144.578813]  kthread+0x184/0x1a8
[  144.579279]  ret_from_fork+0x14/0x30
[  144.579820] 
[  144.580104] The buggy address belongs to the object at c8e90000
[  144.580104]  which belongs to the cache kmalloc-8k of size 8192
[  144.581381] The buggy address is located 0 bytes to the right of
[  144.581381]  allocated 7936-byte region [c8e90000, c8e91f00)
[  144.582627] 
[  144.582961] The buggy address belongs to the physical page:
[  144.583643] page:07f5ae76 refcount:1 mapcount:0 mapping:00000000 index:0x0 pfn:0x48e90
[  144.584492] head:07f5ae76 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[  144.585289] flags: 0x840(slab|head|zone=0)
[  144.586145] page_type: 0xffffffff()
[  144.587330] raw: 00000840 c4801a00 00000122 00000000 00000000 80020002 ffffffff 00000001
[  144.588452] raw: 00000000
[  144.588988] page dumped because: kasan: bad access detected
[  144.589820] 
[  144.590177] Memory state around the buggy address:
[  144.590668]  c8e91e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[  144.591450]  c8e91e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[  144.592107] >c8e91f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[  144.592818]            ^
[  144.593182]  c8e91f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[  144.593978]  c8e92000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[  144.594673] ==================================================================


[   47.029861] ==================================================================
[   47.030762] BUG: KASAN: slab-out-of-bounds in kmalloc_large_oob_right+0xd0/0x1e0
[   47.031538] Write of size 1 at addr ffff888102a21f00 by task kunit_try_catch/150
[   47.032451] 
[   47.032926] CPU: 1 PID: 150 Comm: kunit_try_catch Tainted: G    B            N 6.6.76-rc1 #1
[   47.034588] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   47.035572] Call Trace:
[   47.036148]  <TASK>
[   47.036613]  dump_stack_lvl+0x4e/0x90
[   47.037412]  print_report+0xd2/0x660
[   47.037905]  ? __virt_addr_valid+0x156/0x1e0
[   47.038842]  ? kasan_complete_mode_report_info+0x2a/0x200
[   47.039586]  kasan_report+0xff/0x140
[   47.040238]  ? kmalloc_large_oob_right+0xd0/0x1e0
[   47.041190]  ? kmalloc_large_oob_right+0xd0/0x1e0
[   47.041925]  __asan_store1+0x69/0x70
[   47.042395]  kmalloc_large_oob_right+0xd0/0x1e0
[   47.043001]  ? __pfx_kmalloc_large_oob_right+0x10/0x10
[   47.043667]  ? __schedule+0x70b/0x1190
[   47.044337]  ? ktime_get_ts64+0x118/0x140
[   47.044969]  kunit_try_run_case+0x126/0x290
[   47.045574]  ? __pfx_kunit_try_run_case+0x10/0x10
[   47.046656]  ? __kasan_check_write+0x18/0x20
[   47.047660]  ? trace_preempt_on+0x20/0xa0
[   47.048413]  ? __kthread_parkme+0x4f/0xd0
[   47.049181]  ? preempt_count_sub+0x50/0x80
[   47.049718]  ? __pfx_kunit_try_run_case+0x10/0x10
[   47.050555]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   47.051506]  kunit_generic_run_threadfn_adapter+0x33/0x50
[   47.052528]  kthread+0x19e/0x1e0
[   47.053044]  ? __pfx_kthread+0x10/0x10
[   47.053792]  ret_from_fork+0x41/0x70
[   47.054733]  ? __pfx_kthread+0x10/0x10
[   47.055771]  ret_from_fork_asm+0x1b/0x30
[   47.056326]  </TASK>
[   47.056833] 
[   47.057399] Allocated by task 150:
[   47.057828]  kasan_save_stack+0x3c/0x60
[   47.058645]  kasan_set_track+0x29/0x40
[   47.059306]  kasan_save_alloc_info+0x22/0x30
[   47.060015]  __kasan_kmalloc+0xb7/0xc0
[   47.060661]  kmalloc_trace+0x4c/0xb0
[   47.061160]  kmalloc_large_oob_right+0x9d/0x1e0
[   47.061896]  kunit_try_run_case+0x126/0x290
[   47.063006]  kunit_generic_run_threadfn_adapter+0x33/0x50
[   47.063875]  kthread+0x19e/0x1e0
[   47.064520]  ret_from_fork+0x41/0x70
[   47.064985]  ret_from_fork_asm+0x1b/0x30
[   47.065375] 
[   47.065647] The buggy address belongs to the object at ffff888102a20000
[   47.065647]  which belongs to the cache kmalloc-8k of size 8192
[   47.066914] The buggy address is located 0 bytes to the right of
[   47.066914]  allocated 7936-byte region [ffff888102a20000, ffff888102a21f00)
[   47.068838] 
[   47.069128] The buggy address belongs to the physical page:
[   47.069591] page:(____ptrval____) refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a20
[   47.071321] head:(____ptrval____) order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   47.072263] flags: 0x200000000000840(slab|head|node=0|zone=2)
[   47.072775] page_type: 0xffffffff()
[   47.073461] raw: 0200000000000840 ffff888100042280 dead000000000122 0000000000000000
[   47.074210] raw: 0000000000000000 0000000080020002 00000001ffffffff 0000000000000000
[   47.075005] page dumped because: kasan: bad access detected
[   47.075493] 
[   47.076728] Memory state around the buggy address:
[   47.077397]  ffff888102a21e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   47.078122]  ffff888102a21e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   47.079023] >ffff888102a21f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   47.079977]                    ^
[   47.080571]  ffff888102a21f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   47.081725]  ffff888102a22000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   47.082665] ==================================================================