Hay
Date
Dec. 4, 2024, 3:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   30.822873] ==================================================================
[   30.824258] BUG: KASAN: slab-out-of-bounds in kmalloc_big_oob_right+0x2a4/0x2f0
[   30.825199] Write of size 1 at addr fff00000c6025f00 by task kunit_try_catch/132
[   30.827289] 
[   30.827964] CPU: 1 UID: 0 PID: 132 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241204 #1
[   30.830338] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.831350] Hardware name: linux,dummy-virt (DT)
[   30.831726] Call trace:
[   30.831940]  show_stack+0x20/0x38 (C)
[   30.832246]  dump_stack_lvl+0x8c/0xd0
[   30.832544]  print_report+0x118/0x5e0
[   30.833447]  kasan_report+0xc8/0x118
[   30.834336]  __asan_report_store1_noabort+0x20/0x30
[   30.835425]  kmalloc_big_oob_right+0x2a4/0x2f0
[   30.836374]  kunit_try_run_case+0x14c/0x3d0
[   30.837259]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.838151]  kthread+0x24c/0x2d0
[   30.839249]  ret_from_fork+0x10/0x20
[   30.839852] 
[   30.840255] Allocated by task 132:
[   30.840844]  kasan_save_stack+0x3c/0x68
[   30.841448]  kasan_save_track+0x20/0x40
[   30.842108]  kasan_save_alloc_info+0x40/0x58
[   30.843017]  __kasan_kmalloc+0xd4/0xd8
[   30.844154]  __kmalloc_cache_noprof+0x15c/0x3c0
[   30.845006]  kmalloc_big_oob_right+0xb8/0x2f0
[   30.846031]  kunit_try_run_case+0x14c/0x3d0
[   30.847033]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.848089]  kthread+0x24c/0x2d0
[   30.848519]  ret_from_fork+0x10/0x20
[   30.849125] 
[   30.849491] The buggy address belongs to the object at fff00000c6024000
[   30.849491]  which belongs to the cache kmalloc-8k of size 8192
[   30.851681] The buggy address is located 0 bytes to the right of
[   30.851681]  allocated 7936-byte region [fff00000c6024000, fff00000c6025f00)
[   30.853534] 
[   30.854359] The buggy address belongs to the physical page:
[   30.855487] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106020
[   30.856520] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   30.857475] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   30.858695] page_type: f5(slab)
[   30.859105] raw: 0bfffe0000000040 fff00000c0002280 dead000000000122 0000000000000000
[   30.859897] raw: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000
[   30.861185] head: 0bfffe0000000040 fff00000c0002280 dead000000000122 0000000000000000
[   30.862577] head: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000
[   30.863570] head: 0bfffe0000000003 ffffc1ffc3180801 ffffffffffffffff 0000000000000000
[   30.864600] head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
[   30.865559] page dumped because: kasan: bad access detected
[   30.866645] 
[   30.866935] Memory state around the buggy address:
[   30.868361]  fff00000c6025e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   30.869267]  fff00000c6025e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   30.870262] >fff00000c6025f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.871136]                    ^
[   30.871600]  fff00000c6025f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.872991]  fff00000c6026000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.873571] ==================================================================

[   21.512978] ==================================================================
[   21.514621] BUG: KASAN: slab-out-of-bounds in kmalloc_big_oob_right+0x318/0x370
[   21.515919] Write of size 1 at addr ffff888102b71f00 by task kunit_try_catch/152
[   21.517114] 
[   21.517331] CPU: 0 UID: 0 PID: 152 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241204 #1
[   21.518963] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.519671] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   21.520449] Call Trace:
[   21.520848]  <TASK>
[   21.521161]  dump_stack_lvl+0x73/0xb0
[   21.521568]  print_report+0xd1/0x640
[   21.522874]  ? __virt_addr_valid+0x1db/0x2d0
[   21.523723]  ? kasan_complete_mode_report_info+0x2a/0x200
[   21.524509]  kasan_report+0x102/0x140
[   21.524963]  ? kmalloc_big_oob_right+0x318/0x370
[   21.525780]  ? kmalloc_big_oob_right+0x318/0x370
[   21.526954]  __asan_report_store1_noabort+0x1b/0x30
[   21.527419]  kmalloc_big_oob_right+0x318/0x370
[   21.527942]  ? __pfx_kmalloc_big_oob_right+0x10/0x10
[   21.529010]  ? __pfx_kmalloc_big_oob_right+0x10/0x10
[   21.529743]  kunit_try_run_case+0x1b3/0x490
[   21.530165]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.531503]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   21.531969]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   21.533377]  ? __kthread_parkme+0x82/0x160
[   21.533619]  ? preempt_count_sub+0x50/0x80
[   21.533906]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.534396]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   21.535003]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.535464]  kthread+0x257/0x310
[   21.536139]  ? __pfx_kthread+0x10/0x10
[   21.536938]  ret_from_fork+0x41/0x80
[   21.537363]  ? __pfx_kthread+0x10/0x10
[   21.537813]  ret_from_fork_asm+0x1a/0x30
[   21.538236]  </TASK>
[   21.538492] 
[   21.538695] Allocated by task 152:
[   21.540732]  kasan_save_stack+0x3d/0x60
[   21.541533]  kasan_save_track+0x18/0x40
[   21.542031]  kasan_save_alloc_info+0x3b/0x50
[   21.542540]  __kasan_kmalloc+0xb7/0xc0
[   21.542849]  __kmalloc_cache_noprof+0x184/0x410
[   21.543180]  kmalloc_big_oob_right+0xaa/0x370
[   21.543793]  kunit_try_run_case+0x1b3/0x490
[   21.545243]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.545777]  kthread+0x257/0x310
[   21.546056]  ret_from_fork+0x41/0x80
[   21.546489]  ret_from_fork_asm+0x1a/0x30
[   21.546864] 
[   21.547015] The buggy address belongs to the object at ffff888102b70000
[   21.547015]  which belongs to the cache kmalloc-8k of size 8192
[   21.548124] The buggy address is located 0 bytes to the right of
[   21.548124]  allocated 7936-byte region [ffff888102b70000, ffff888102b71f00)
[   21.549971] 
[   21.550360] The buggy address belongs to the physical page:
[   21.550777] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b70
[   21.551709] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   21.552649] flags: 0x200000000000040(head|node=0|zone=2)
[   21.553840] page_type: f5(slab)
[   21.554682] raw: 0200000000000040 ffff888100042280 dead000000000122 0000000000000000
[   21.555694] raw: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000
[   21.556662] head: 0200000000000040 ffff888100042280 dead000000000122 0000000000000000
[   21.557948] head: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000
[   21.559190] head: 0200000000000003 ffffea00040adc01 ffffffffffffffff 0000000000000000
[   21.560365] head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
[   21.560873] page dumped because: kasan: bad access detected
[   21.562287] 
[   21.562519] Memory state around the buggy address:
[   21.563206]  ffff888102b71e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   21.563978]  ffff888102b71e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   21.565103] >ffff888102b71f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.566187]                    ^
[   21.566496]  ffff888102b71f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.568068]  ffff888102b72000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.569125] ==================================================================