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

Environment
qemu-arm64
qemu-x86_64

[   30.639539] ==================================================================
[   30.642929] BUG: KASAN: slab-out-of-bounds in kmalloc_node_oob_right+0x2f4/0x330
[   30.643580] Read of size 1 at addr fff00000c638b000 by task kunit_try_catch/128
[   30.645974] 
[   30.646926] CPU: 0 UID: 0 PID: 128 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241204 #1
[   30.650006] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.651265] Hardware name: linux,dummy-virt (DT)
[   30.652543] Call trace:
[   30.653482]  show_stack+0x20/0x38 (C)
[   30.654521]  dump_stack_lvl+0x8c/0xd0
[   30.655970]  print_report+0x118/0x5e0
[   30.657561]  kasan_report+0xc8/0x118
[   30.658041]  __asan_report_load1_noabort+0x20/0x30
[   30.658505]  kmalloc_node_oob_right+0x2f4/0x330
[   30.661927]  kunit_try_run_case+0x14c/0x3d0
[   30.663410]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.665096]  kthread+0x24c/0x2d0
[   30.666725]  ret_from_fork+0x10/0x20
[   30.667430] 
[   30.667684] Allocated by task 128:
[   30.668033]  kasan_save_stack+0x3c/0x68
[   30.668426]  kasan_save_track+0x20/0x40
[   30.671312]  kasan_save_alloc_info+0x40/0x58
[   30.673038]  __kasan_kmalloc+0xd4/0xd8
[   30.673508]  __kmalloc_cache_node_noprof+0x168/0x3d0
[   30.674264]  kmalloc_node_oob_right+0xbc/0x330
[   30.674709]  kunit_try_run_case+0x14c/0x3d0
[   30.675138]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.675611]  kthread+0x24c/0x2d0
[   30.677099]  ret_from_fork+0x10/0x20
[   30.677883] 
[   30.678171] The buggy address belongs to the object at fff00000c638a000
[   30.678171]  which belongs to the cache kmalloc-4k of size 4096
[   30.684790] The buggy address is located 0 bytes to the right of
[   30.684790]  allocated 4096-byte region [fff00000c638a000, fff00000c638b000)
[   30.687735] 
[   30.688436] The buggy address belongs to the physical page:
[   30.689459] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106388
[   30.691960] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   30.692692] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   30.693597] page_type: f5(slab)
[   30.694283] raw: 0bfffe0000000040 fff00000c0002140 dead000000000122 0000000000000000
[   30.696072] raw: 0000000000000000 0000000080040004 00000000f5000000 0000000000000000
[   30.697299] head: 0bfffe0000000040 fff00000c0002140 dead000000000122 0000000000000000
[   30.699083] head: 0000000000000000 0000000080040004 00000000f5000000 0000000000000000
[   30.699882] head: 0bfffe0000000003 ffffc1ffc318e201 ffffffffffffffff 0000000000000000
[   30.700807] head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
[   30.701749] page dumped because: kasan: bad access detected
[   30.702925] 
[   30.703203] Memory state around the buggy address:
[   30.703893]  fff00000c638af00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   30.704811]  fff00000c638af80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   30.705667] >fff00000c638b000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.706896]                    ^
[   30.707515]  fff00000c638b080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.708402]  fff00000c638b100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.709463] ==================================================================

[   21.334507] ==================================================================
[   21.335438] BUG: KASAN: slab-out-of-bounds in kmalloc_node_oob_right+0x36b/0x3d0
[   21.336681] Read of size 1 at addr ffff888102b5b000 by task kunit_try_catch/148
[   21.337771] 
[   21.338417] CPU: 1 UID: 0 PID: 148 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241204 #1
[   21.339678] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.340148] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   21.341336] Call Trace:
[   21.341695]  <TASK>
[   21.341913]  dump_stack_lvl+0x73/0xb0
[   21.342123]  print_report+0xd1/0x640
[   21.342810]  ? __virt_addr_valid+0x1db/0x2d0
[   21.343814]  ? kasan_complete_mode_report_info+0x2a/0x200
[   21.344814]  kasan_report+0x102/0x140
[   21.345786]  ? kmalloc_node_oob_right+0x36b/0x3d0
[   21.346630]  ? kmalloc_node_oob_right+0x36b/0x3d0
[   21.347045]  __asan_report_load1_noabort+0x18/0x20
[   21.347956]  kmalloc_node_oob_right+0x36b/0x3d0
[   21.348632]  ? __pfx_kmalloc_node_oob_right+0x10/0x10
[   21.349255]  ? __schedule+0xc3e/0x2790
[   21.349656]  ? __pfx_read_tsc+0x10/0x10
[   21.350069]  ? ktime_get_ts64+0x86/0x230
[   21.350485]  kunit_try_run_case+0x1b3/0x490
[   21.351797]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.353291]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   21.354389]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   21.354986]  ? __kthread_parkme+0x82/0x160
[   21.355924]  ? preempt_count_sub+0x50/0x80
[   21.356447]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.356666]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   21.357150]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.357587]  kthread+0x257/0x310
[   21.358945]  ? __pfx_kthread+0x10/0x10
[   21.359524]  ret_from_fork+0x41/0x80
[   21.359783]  ? __pfx_kthread+0x10/0x10
[   21.360056]  ret_from_fork_asm+0x1a/0x30
[   21.360768]  </TASK>
[   21.361049] 
[   21.361807] Allocated by task 148:
[   21.362557]  kasan_save_stack+0x3d/0x60
[   21.362952]  kasan_save_track+0x18/0x40
[   21.363842]  kasan_save_alloc_info+0x3b/0x50
[   21.364467]  __kasan_kmalloc+0xb7/0xc0
[   21.365563]  __kmalloc_cache_node_noprof+0x183/0x410
[   21.365965]  kmalloc_node_oob_right+0xac/0x3d0
[   21.366402]  kunit_try_run_case+0x1b3/0x490
[   21.367217]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.367948]  kthread+0x257/0x310
[   21.368464]  ret_from_fork+0x41/0x80
[   21.369247]  ret_from_fork_asm+0x1a/0x30
[   21.369996] 
[   21.370316] The buggy address belongs to the object at ffff888102b5a000
[   21.370316]  which belongs to the cache kmalloc-4k of size 4096
[   21.372643] The buggy address is located 0 bytes to the right of
[   21.372643]  allocated 4096-byte region [ffff888102b5a000, ffff888102b5b000)
[   21.374809] 
[   21.375020] The buggy address belongs to the physical page:
[   21.375885] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b58
[   21.377059] head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   21.378464] flags: 0x200000000000040(head|node=0|zone=2)
[   21.379047] page_type: f5(slab)
[   21.379709] raw: 0200000000000040 ffff888100042140 dead000000000122 0000000000000000
[   21.380666] raw: 0000000000000000 0000000080040004 00000000f5000000 0000000000000000
[   21.381375] head: 0200000000000040 ffff888100042140 dead000000000122 0000000000000000
[   21.382028] head: 0000000000000000 0000000080040004 00000000f5000000 0000000000000000
[   21.383188] head: 0200000000000003 ffffea00040ad601 ffffffffffffffff 0000000000000000
[   21.383940] head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000
[   21.385478] page dumped because: kasan: bad access detected
[   21.386060] 
[   21.386295] Memory state around the buggy address:
[   21.386983]  ffff888102b5af00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   21.387933]  ffff888102b5af80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   21.388989] >ffff888102b5b000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.389948]                    ^
[   21.390760]  ffff888102b5b080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.391461]  ffff888102b5b100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.392143] ==================================================================