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

Environment
qemu-arm64
qemu-x86_64

[   31.591556] ==================================================================
[   31.593348] BUG: KASAN: slab-out-of-bounds in kmem_cache_oob+0x33c/0x428
[   31.594184] Read of size 1 at addr fff00000c59070c8 by task kunit_try_catch/196
[   31.596253] 
[   31.596663] CPU: 0 UID: 0 PID: 196 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241203 #1
[   31.597785] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.598270] Hardware name: linux,dummy-virt (DT)
[   31.599151] Call trace:
[   31.599868]  show_stack+0x20/0x38 (C)
[   31.600438]  dump_stack_lvl+0x8c/0xd0
[   31.601010]  print_report+0x118/0x5e0
[   31.601551]  kasan_report+0xc8/0x118
[   31.602191]  __asan_report_load1_noabort+0x20/0x30
[   31.602890]  kmem_cache_oob+0x33c/0x428
[   31.603864]  kunit_try_run_case+0x14c/0x3d0
[   31.604520]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.605421]  kthread+0x24c/0x2d0
[   31.605976]  ret_from_fork+0x10/0x20
[   31.606633] 
[   31.606917] Allocated by task 196:
[   31.607509]  kasan_save_stack+0x3c/0x68
[   31.608090]  kasan_save_track+0x20/0x40
[   31.608744]  kasan_save_alloc_info+0x40/0x58
[   31.609700]  __kasan_slab_alloc+0xa8/0xb0
[   31.610345]  kmem_cache_alloc_noprof+0x108/0x398
[   31.610879]  kmem_cache_oob+0x12c/0x428
[   31.611664]  kunit_try_run_case+0x14c/0x3d0
[   31.612797]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.613919]  kthread+0x24c/0x2d0
[   31.614446]  ret_from_fork+0x10/0x20
[   31.615092] 
[   31.615444] The buggy address belongs to the object at fff00000c5907000
[   31.615444]  which belongs to the cache test_cache of size 200
[   31.616703] The buggy address is located 0 bytes to the right of
[   31.616703]  allocated 200-byte region [fff00000c5907000, fff00000c59070c8)
[   31.618839] 
[   31.619592] The buggy address belongs to the physical page:
[   31.620381] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105907
[   31.621653] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.622721] page_type: f5(slab)
[   31.623431] raw: 0bfffe0000000000 fff00000c0ffddc0 dead000000000122 0000000000000000
[   31.624321] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   31.625707] page dumped because: kasan: bad access detected
[   31.626500] 
[   31.627033] Memory state around the buggy address:
[   31.627977]  fff00000c5906f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.629031]  fff00000c5907000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   31.629972] >fff00000c5907080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   31.630782]                                               ^
[   31.632523]  fff00000c5907100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.633572]  fff00000c5907180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.634707] ==================================================================

[   27.037171] ==================================================================
[   27.038237] BUG: KASAN: slab-out-of-bounds in kmem_cache_oob+0x404/0x530
[   27.039270] Read of size 1 at addr ffff888102a170c8 by task kunit_try_catch/216
[   27.040168] 
[   27.040420] CPU: 1 UID: 0 PID: 216 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241203 #1
[   27.042222] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.042714] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.043545] Call Trace:
[   27.043950]  <TASK>
[   27.044315]  dump_stack_lvl+0x73/0xb0
[   27.044901]  print_report+0xd1/0x640
[   27.045394]  ? __virt_addr_valid+0x1db/0x2d0
[   27.045869]  ? kasan_complete_mode_report_info+0x2a/0x200
[   27.046615]  kasan_report+0x102/0x140
[   27.046839]  ? kmem_cache_oob+0x404/0x530
[   27.047089]  ? kmem_cache_oob+0x404/0x530
[   27.047652]  __asan_report_load1_noabort+0x18/0x20
[   27.048219]  kmem_cache_oob+0x404/0x530
[   27.048788]  ? trace_hardirqs_on+0x37/0xe0
[   27.049294]  ? __pfx_kmem_cache_oob+0x10/0x10
[   27.050017]  ? finish_task_switch.isra.0+0x153/0x700
[   27.050806]  ? __switch_to+0x5d9/0xf60
[   27.051407]  ? __pfx_read_tsc+0x10/0x10
[   27.051857]  ? ktime_get_ts64+0x86/0x230
[   27.052347]  kunit_try_run_case+0x1b3/0x490
[   27.053266]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.053943]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   27.054347]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.055928]  ? __kthread_parkme+0x82/0x160
[   27.056465]  ? preempt_count_sub+0x50/0x80
[   27.057123]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.057923]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.058404]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.058842]  kthread+0x257/0x310
[   27.059643]  ? __pfx_kthread+0x10/0x10
[   27.060008]  ret_from_fork+0x41/0x80
[   27.061046]  ? __pfx_kthread+0x10/0x10
[   27.061421]  ret_from_fork_asm+0x1a/0x30
[   27.062302]  </TASK>
[   27.062781] 
[   27.063185] Allocated by task 216:
[   27.063387]  kasan_save_stack+0x3d/0x60
[   27.064391]  kasan_save_track+0x18/0x40
[   27.065091]  kasan_save_alloc_info+0x3b/0x50
[   27.065646]  __kasan_slab_alloc+0x91/0xa0
[   27.066391]  kmem_cache_alloc_noprof+0x11e/0x3e0
[   27.066901]  kmem_cache_oob+0x158/0x530
[   27.067290]  kunit_try_run_case+0x1b3/0x490
[   27.068338]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.068667]  kthread+0x257/0x310
[   27.068976]  ret_from_fork+0x41/0x80
[   27.069773]  ret_from_fork_asm+0x1a/0x30
[   27.070478] 
[   27.070689] The buggy address belongs to the object at ffff888102a17000
[   27.070689]  which belongs to the cache test_cache of size 200
[   27.072147] The buggy address is located 0 bytes to the right of
[   27.072147]  allocated 200-byte region [ffff888102a17000, ffff888102a170c8)
[   27.073572] 
[   27.074318] The buggy address belongs to the physical page:
[   27.074626] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a17
[   27.075483] flags: 0x200000000000000(node=0|zone=2)
[   27.076175] page_type: f5(slab)
[   27.076727] raw: 0200000000000000 ffff888101e703c0 dead000000000122 0000000000000000
[   27.077269] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   27.078134] page dumped because: kasan: bad access detected
[   27.078429] 
[   27.078589] Memory state around the buggy address:
[   27.079282]  ffff888102a16f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.080295]  ffff888102a17000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   27.080993] >ffff888102a17080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   27.082099]                                               ^
[   27.082649]  ffff888102a17100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.083532]  ffff888102a17180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.084243] ==================================================================