Hay
Date
Dec. 5, 2024, 2:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   31.190945] ==================================================================
[   31.192547] BUG: KASAN: slab-out-of-bounds in kmem_cache_oob+0x33c/0x428
[   31.193810] Read of size 1 at addr fff00000c65650c8 by task kunit_try_catch/196
[   31.194981] 
[   31.195385] CPU: 1 UID: 0 PID: 196 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241205 #1
[   31.196677] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.197343] Hardware name: linux,dummy-virt (DT)
[   31.198004] Call trace:
[   31.198395]  show_stack+0x20/0x38 (C)
[   31.198965]  dump_stack_lvl+0x8c/0xd0
[   31.199504]  print_report+0x118/0x5e0
[   31.200371]  kasan_report+0xc8/0x118
[   31.200912]  __asan_report_load1_noabort+0x20/0x30
[   31.201656]  kmem_cache_oob+0x33c/0x428
[   31.202327]  kunit_try_run_case+0x14c/0x3d0
[   31.202957]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.203941]  kthread+0x24c/0x2d0
[   31.204449]  ret_from_fork+0x10/0x20
[   31.205109] 
[   31.205528] Allocated by task 196:
[   31.206056]  kasan_save_stack+0x3c/0x68
[   31.206805]  kasan_save_track+0x20/0x40
[   31.207730]  kasan_save_alloc_info+0x40/0x58
[   31.208211]  __kasan_slab_alloc+0xa8/0xb0
[   31.208749]  kmem_cache_alloc_noprof+0x108/0x398
[   31.209409]  kmem_cache_oob+0x12c/0x428
[   31.210424]  kunit_try_run_case+0x14c/0x3d0
[   31.211409]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.212122]  kthread+0x24c/0x2d0
[   31.212690]  ret_from_fork+0x10/0x20
[   31.213355] 
[   31.213712] The buggy address belongs to the object at fff00000c6565000
[   31.213712]  which belongs to the cache test_cache of size 200
[   31.215160] The buggy address is located 0 bytes to the right of
[   31.215160]  allocated 200-byte region [fff00000c6565000, fff00000c65650c8)
[   31.216765] 
[   31.217193] The buggy address belongs to the physical page:
[   31.217949] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106565
[   31.218862] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.219986] page_type: f5(slab)
[   31.220515] raw: 0bfffe0000000000 fff00000c16088c0 dead000000000122 0000000000000000
[   31.221507] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   31.222527] page dumped because: kasan: bad access detected
[   31.223187] 
[   31.223939] Memory state around the buggy address:
[   31.224572]  fff00000c6564f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.225441]  fff00000c6565000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   31.226547] >fff00000c6565080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   31.227445]                                               ^
[   31.228054]  fff00000c6565100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.229151]  fff00000c6565180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.230030] ==================================================================

[   29.039719] ==================================================================
[   29.040741] BUG: KASAN: slab-out-of-bounds in kmem_cache_oob+0x404/0x530
[   29.041360] Read of size 1 at addr ffff888101ab90c8 by task kunit_try_catch/214
[   29.042158] 
[   29.042706] CPU: 0 UID: 0 PID: 214 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241205 #1
[   29.043553] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.044366] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   29.045092] Call Trace:
[   29.045360]  <TASK>
[   29.045621]  dump_stack_lvl+0x73/0xb0
[   29.046110]  print_report+0xd1/0x640
[   29.046495]  ? __virt_addr_valid+0x1db/0x2d0
[   29.047286]  ? kasan_complete_mode_report_info+0x2a/0x200
[   29.048109]  kasan_report+0x102/0x140
[   29.048446]  ? kmem_cache_oob+0x404/0x530
[   29.048936]  ? kmem_cache_oob+0x404/0x530
[   29.049293]  __asan_report_load1_noabort+0x18/0x20
[   29.050182]  kmem_cache_oob+0x404/0x530
[   29.050521]  ? trace_hardirqs_on+0x37/0xe0
[   29.051032]  ? __pfx_kmem_cache_oob+0x10/0x10
[   29.051729]  ? finish_task_switch.isra.0+0x153/0x700
[   29.052354]  ? __switch_to+0x5d9/0xf60
[   29.052845]  ? __pfx_read_tsc+0x10/0x10
[   29.053313]  ? ktime_get_ts64+0x86/0x230
[   29.053940]  kunit_try_run_case+0x1b3/0x490
[   29.054423]  ? __pfx_kunit_try_run_case+0x10/0x10
[   29.055112]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   29.055555]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   29.056056]  ? __kthread_parkme+0x82/0x160
[   29.056458]  ? preempt_count_sub+0x50/0x80
[   29.056927]  ? __pfx_kunit_try_run_case+0x10/0x10
[   29.057464]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   29.058222]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   29.058872]  kthread+0x257/0x310
[   29.059213]  ? __pfx_kthread+0x10/0x10
[   29.059550]  ret_from_fork+0x41/0x80
[   29.059989]  ? __pfx_kthread+0x10/0x10
[   29.060446]  ret_from_fork_asm+0x1a/0x30
[   29.060978]  </TASK>
[   29.061281] 
[   29.061458] Allocated by task 214:
[   29.061954]  kasan_save_stack+0x3d/0x60
[   29.062256]  kasan_save_track+0x18/0x40
[   29.062620]  kasan_save_alloc_info+0x3b/0x50
[   29.063205]  __kasan_slab_alloc+0x91/0xa0
[   29.063582]  kmem_cache_alloc_noprof+0x11e/0x3e0
[   29.064115]  kmem_cache_oob+0x158/0x530
[   29.064617]  kunit_try_run_case+0x1b3/0x490
[   29.065195]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   29.065622]  kthread+0x257/0x310
[   29.066077]  ret_from_fork+0x41/0x80
[   29.066540]  ret_from_fork_asm+0x1a/0x30
[   29.067001] 
[   29.067187] The buggy address belongs to the object at ffff888101ab9000
[   29.067187]  which belongs to the cache test_cache of size 200
[   29.068218] The buggy address is located 0 bytes to the right of
[   29.068218]  allocated 200-byte region [ffff888101ab9000, ffff888101ab90c8)
[   29.069425] 
[   29.069697] The buggy address belongs to the physical page:
[   29.070087] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101ab9
[   29.071011] flags: 0x200000000000000(node=0|zone=2)
[   29.071488] page_type: f5(slab)
[   29.072508] raw: 0200000000000000 ffff8881011e5b40 dead000000000122 0000000000000000
[   29.073133] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   29.073749] page dumped because: kasan: bad access detected
[   29.074286] 
[   29.074461] Memory state around the buggy address:
[   29.075489]  ffff888101ab8f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.076136]  ffff888101ab9000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   29.076723] >ffff888101ab9080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   29.077324]                                               ^
[   29.077968]  ffff888101ab9100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.078448]  ffff888101ab9180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.079085] ==================================================================