Hay
Date
Dec. 6, 2024, 3:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   30.035153] ==================================================================
[   30.036657] BUG: KASAN: slab-out-of-bounds in kmalloc_big_oob_right+0x2a4/0x2f0
[   30.037439] Write of size 1 at addr fff00000c13bdf00 by task kunit_try_catch/133
[   30.038098] 
[   30.038500] CPU: 1 UID: 0 PID: 133 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241206 #1
[   30.039891] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.040336] Hardware name: linux,dummy-virt (DT)
[   30.041452] Call trace:
[   30.041953]  show_stack+0x20/0x38 (C)
[   30.042719]  dump_stack_lvl+0x8c/0xd0
[   30.043680]  print_report+0x118/0x5e0
[   30.044242]  kasan_report+0xc8/0x118
[   30.044795]  __asan_report_store1_noabort+0x20/0x30
[   30.045461]  kmalloc_big_oob_right+0x2a4/0x2f0
[   30.046458]  kunit_try_run_case+0x14c/0x3d0
[   30.047135]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.048332]  kthread+0x24c/0x2d0
[   30.049013]  ret_from_fork+0x10/0x20
[   30.049599] 
[   30.049971] Allocated by task 133:
[   30.050959]  kasan_save_stack+0x3c/0x68
[   30.051594]  kasan_save_track+0x20/0x40
[   30.052120]  kasan_save_alloc_info+0x40/0x58
[   30.052695]  __kasan_kmalloc+0xd4/0xd8
[   30.053384]  __kmalloc_cache_noprof+0x15c/0x3c0
[   30.054178]  kmalloc_big_oob_right+0xb8/0x2f0
[   30.054971]  kunit_try_run_case+0x14c/0x3d0
[   30.056829]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.057857]  kthread+0x24c/0x2d0
[   30.058897]  ret_from_fork+0x10/0x20
[   30.059378] 
[   30.059879] The buggy address belongs to the object at fff00000c13bc000
[   30.059879]  which belongs to the cache kmalloc-8k of size 8192
[   30.060793] The buggy address is located 0 bytes to the right of
[   30.060793]  allocated 7936-byte region [fff00000c13bc000, fff00000c13bdf00)
[   30.061839] 
[   30.062481] The buggy address belongs to the physical page:
[   30.063349] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1013b8
[   30.064363] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   30.066953] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   30.068009] page_type: f5(slab)
[   30.068600] raw: 0bfffe0000000040 fff00000c0002280 dead000000000122 0000000000000000
[   30.069682] raw: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000
[   30.070902] head: 0bfffe0000000040 fff00000c0002280 dead000000000122 0000000000000000
[   30.071907] head: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000
[   30.073527] head: 0bfffe0000000003 ffffc1ffc304ee01 ffffffffffffffff 0000000000000000
[   30.074558] head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
[   30.075638] page dumped because: kasan: bad access detected
[   30.076563] 
[   30.076899] Memory state around the buggy address:
[   30.077995]  fff00000c13bde00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   30.078759]  fff00000c13bde80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   30.080255] >fff00000c13bdf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.081274]                    ^
[   30.081964]  fff00000c13bdf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.083182]  fff00000c13be000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.084038] ==================================================================

[   22.178991] ==================================================================
[   22.180239] BUG: KASAN: slab-out-of-bounds in kmalloc_big_oob_right+0x318/0x370
[   22.182186] Write of size 1 at addr ffff888102a91f00 by task kunit_try_catch/152
[   22.182917] 
[   22.183121] CPU: 1 UID: 0 PID: 152 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241206 #1
[   22.185961] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.186771] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.187918] Call Trace:
[   22.188737]  <TASK>
[   22.189003]  dump_stack_lvl+0x73/0xb0
[   22.189494]  print_report+0xd1/0x640
[   22.189746]  ? __virt_addr_valid+0x1db/0x2d0
[   22.190692]  ? kasan_complete_mode_report_info+0x2a/0x200
[   22.191891]  kasan_report+0x102/0x140
[   22.192674]  ? kmalloc_big_oob_right+0x318/0x370
[   22.193548]  ? kmalloc_big_oob_right+0x318/0x370
[   22.194100]  __asan_report_store1_noabort+0x1b/0x30
[   22.194628]  kmalloc_big_oob_right+0x318/0x370
[   22.195534]  ? __pfx_kmalloc_big_oob_right+0x10/0x10
[   22.196313]  ? __pfx_kmalloc_big_oob_right+0x10/0x10
[   22.196686]  kunit_try_run_case+0x1b3/0x490
[   22.197452]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.197969]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   22.198448]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.198790]  ? __kthread_parkme+0x82/0x160
[   22.199494]  ? preempt_count_sub+0x50/0x80
[   22.200115]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.201015]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.202364]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.203078]  kthread+0x257/0x310
[   22.204335]  ? __pfx_kthread+0x10/0x10
[   22.205332]  ret_from_fork+0x41/0x80
[   22.206230]  ? __pfx_kthread+0x10/0x10
[   22.206654]  ret_from_fork_asm+0x1a/0x30
[   22.207115]  </TASK>
[   22.207375] 
[   22.207580] Allocated by task 152:
[   22.209395]  kasan_save_stack+0x3d/0x60
[   22.210234]  kasan_save_track+0x18/0x40
[   22.210425]  kasan_save_alloc_info+0x3b/0x50
[   22.210617]  __kasan_kmalloc+0xb7/0xc0
[   22.210791]  __kmalloc_cache_noprof+0x184/0x410
[   22.211026]  kmalloc_big_oob_right+0xaa/0x370
[   22.211224]  kunit_try_run_case+0x1b3/0x490
[   22.211410]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.211632]  kthread+0x257/0x310
[   22.211792]  ret_from_fork+0x41/0x80
[   22.212152]  ret_from_fork_asm+0x1a/0x30
[   22.212718] 
[   22.212881] The buggy address belongs to the object at ffff888102a90000
[   22.212881]  which belongs to the cache kmalloc-8k of size 8192
[   22.215525] The buggy address is located 0 bytes to the right of
[   22.215525]  allocated 7936-byte region [ffff888102a90000, ffff888102a91f00)
[   22.217598] 
[   22.217987] The buggy address belongs to the physical page:
[   22.219365] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a90
[   22.221131] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   22.222271] flags: 0x200000000000040(head|node=0|zone=2)
[   22.222642] page_type: f5(slab)
[   22.223117] raw: 0200000000000040 ffff888100042280 dead000000000122 0000000000000000
[   22.224073] raw: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000
[   22.224682] head: 0200000000000040 ffff888100042280 dead000000000122 0000000000000000
[   22.226561] head: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000
[   22.228063] head: 0200000000000003 ffffea00040aa401 ffffffffffffffff 0000000000000000
[   22.229067] head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
[   22.230000] page dumped because: kasan: bad access detected
[   22.230646] 
[   22.230976] Memory state around the buggy address:
[   22.232270]  ffff888102a91e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.233452]  ffff888102a91e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.234826] >ffff888102a91f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.235432]                    ^
[   22.235714]  ffff888102a91f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.236460]  ffff888102a92000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.237218] ==================================================================