Hay
Date
Nov. 27, 2024, 3:37 a.m.

Environment
qemu-arm64
qemu-x86_64

[   46.766945] ==================================================================
[   46.768185] BUG: KASAN: slab-out-of-bounds in kmalloc_big_oob_right+0x2a4/0x2f0
[   46.768981] Write of size 1 at addr fff00000c5d15f00 by task kunit_try_catch/133
[   46.769685] 
[   46.770062] CPU: 1 UID: 0 PID: 133 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241127 #1
[   46.771395] Tainted: [B]=BAD_PAGE, [N]=TEST
[   46.772391] Hardware name: linux,dummy-virt (DT)
[   46.773223] Call trace:
[   46.773630]  show_stack+0x20/0x38 (C)
[   46.774261]  dump_stack_lvl+0x8c/0xd0
[   46.775067]  print_report+0x118/0x5e0
[   46.775580]  kasan_report+0xc8/0x118
[   46.776231]  __asan_report_store1_noabort+0x20/0x30
[   46.776955]  kmalloc_big_oob_right+0x2a4/0x2f0
[   46.777679]  kunit_try_run_case+0x14c/0x3d0
[   46.778353]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   46.779134]  kthread+0x24c/0x2d0
[   46.779778]  ret_from_fork+0x10/0x20
[   46.780352] 
[   46.780652] Allocated by task 133:
[   46.781098]  kasan_save_stack+0x3c/0x68
[   46.781795]  kasan_save_track+0x20/0x40
[   46.782364]  kasan_save_alloc_info+0x40/0x58
[   46.783078]  __kasan_kmalloc+0xd4/0xd8
[   46.783718]  __kmalloc_cache_noprof+0x15c/0x3c0
[   46.784340]  kmalloc_big_oob_right+0xb8/0x2f0
[   46.784977]  kunit_try_run_case+0x14c/0x3d0
[   46.785531]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   46.786204]  kthread+0x24c/0x2d0
[   46.786844]  ret_from_fork+0x10/0x20
[   46.787457] 
[   46.787829] The buggy address belongs to the object at fff00000c5d14000
[   46.787829]  which belongs to the cache kmalloc-8k of size 8192
[   46.789263] The buggy address is located 0 bytes to the right of
[   46.789263]  allocated 7936-byte region [fff00000c5d14000, fff00000c5d15f00)
[   46.790659] 
[   46.790945] The buggy address belongs to the physical page:
[   46.791726] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105d10
[   46.792665] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   46.793544] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   46.794334] page_type: f5(slab)
[   46.794904] raw: 0bfffe0000000040 fff00000c0002280 dead000000000122 0000000000000000
[   46.795864] raw: 0000000000000000 0000000080020002 00000001f5000000 0000000000000000
[   46.796696] head: 0bfffe0000000040 fff00000c0002280 dead000000000122 0000000000000000
[   46.797700] head: 0000000000000000 0000000080020002 00000001f5000000 0000000000000000
[   46.798683] head: 0bfffe0000000003 ffffc1ffc3174401 ffffffffffffffff 0000000000000000
[   46.799572] head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
[   46.800465] page dumped because: kasan: bad access detected
[   46.801187] 
[   46.801515] Memory state around the buggy address:
[   46.802207]  fff00000c5d15e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   46.803331]  fff00000c5d15e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   46.804228] >fff00000c5d15f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   46.805195]                    ^
[   46.805843]  fff00000c5d15f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   46.806780]  fff00000c5d16000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   46.807650] ==================================================================

[   23.839858] ==================================================================
[   23.841956] BUG: KASAN: slab-out-of-bounds in kmalloc_big_oob_right+0x318/0x370
[   23.843130] Write of size 1 at addr ffff88810211df00 by task kunit_try_catch/152
[   23.843808] 
[   23.844047] CPU: 1 UID: 0 PID: 152 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241127 #1
[   23.844800] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.845174] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   23.845875] Call Trace:
[   23.846239]  <TASK>
[   23.846512]  dump_stack_lvl+0x73/0xb0
[   23.847471]  print_report+0xd1/0x640
[   23.847777]  ? __virt_addr_valid+0x1db/0x2d0
[   23.848874]  ? kasan_complete_mode_report_info+0x2a/0x200
[   23.850417]  kasan_report+0x102/0x140
[   23.850780]  ? kmalloc_big_oob_right+0x318/0x370
[   23.851312]  ? kmalloc_big_oob_right+0x318/0x370
[   23.851785]  __asan_report_store1_noabort+0x1b/0x30
[   23.852704]  kmalloc_big_oob_right+0x318/0x370
[   23.853558]  ? __pfx_kmalloc_big_oob_right+0x10/0x10
[   23.854219]  ? __schedule+0xc3e/0x2790
[   23.854959]  ? __pfx_read_tsc+0x10/0x10
[   23.855695]  ? ktime_get_ts64+0x84/0x230
[   23.856128]  kunit_try_run_case+0x1b3/0x490
[   23.856534]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.856959]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   23.857844]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   23.858762]  ? __kthread_parkme+0x82/0x160
[   23.859403]  ? preempt_count_sub+0x50/0x80
[   23.859963]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.860687]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   23.861334]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.862170]  kthread+0x257/0x310
[   23.862571]  ? __pfx_kthread+0x10/0x10
[   23.863371]  ret_from_fork+0x41/0x80
[   23.863971]  ? __pfx_kthread+0x10/0x10
[   23.864577]  ret_from_fork_asm+0x1a/0x30
[   23.865229]  </TASK>
[   23.865516] 
[   23.866136] Allocated by task 152:
[   23.866416]  kasan_save_stack+0x3d/0x60
[   23.866865]  kasan_save_track+0x18/0x40
[   23.867344]  kasan_save_alloc_info+0x3b/0x50
[   23.867785]  __kasan_kmalloc+0xb7/0xc0
[   23.868764]  __kmalloc_cache_noprof+0x184/0x410
[   23.869187]  kmalloc_big_oob_right+0xaa/0x370
[   23.869933]  kunit_try_run_case+0x1b3/0x490
[   23.870393]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.871259]  kthread+0x257/0x310
[   23.871815]  ret_from_fork+0x41/0x80
[   23.872214]  ret_from_fork_asm+0x1a/0x30
[   23.872911] 
[   23.873217] The buggy address belongs to the object at ffff88810211c000
[   23.873217]  which belongs to the cache kmalloc-8k of size 8192
[   23.874483] The buggy address is located 0 bytes to the right of
[   23.874483]  allocated 7936-byte region [ffff88810211c000, ffff88810211df00)
[   23.876216] 
[   23.876504] The buggy address belongs to the physical page:
[   23.877407] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102118
[   23.878287] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   23.879396] flags: 0x200000000000040(head|node=0|zone=2)
[   23.879852] page_type: f5(slab)
[   23.880501] raw: 0200000000000040 ffff888100042280 dead000000000122 0000000000000000
[   23.881340] raw: 0000000000000000 0000000080020002 00000001f5000000 0000000000000000
[   23.882343] head: 0200000000000040 ffff888100042280 dead000000000122 0000000000000000
[   23.883290] head: 0000000000000000 0000000080020002 00000001f5000000 0000000000000000
[   23.884259] head: 0200000000000003 ffffea0004084601 ffffffffffffffff 0000000000000000
[   23.884968] head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
[   23.886086] page dumped because: kasan: bad access detected
[   23.886524] 
[   23.887173] Memory state around the buggy address:
[   23.887586]  ffff88810211de00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.888694]  ffff88810211de80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   23.889476] >ffff88810211df00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.890307]                    ^
[   23.890590]  ffff88810211df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.891451]  ffff88810211e000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.892057] ==================================================================