Hay
Date
June 7, 2025, 10:40 a.m.

Environment
qemu-arm64
qemu-x86_64

[   21.290241] ==================================================================
[   21.291233] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x150/0x2e8
[   21.292600] Write of size 128 at addr fff00000c416b400 by task kunit_try_catch/158
[   21.293314] 
[   21.293628] CPU: 1 UID: 0 PID: 158 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   21.293944] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.294038] Hardware name: linux,dummy-virt (DT)
[   21.294125] Call trace:
[   21.294187]  dump_backtrace+0x9c/0x128
[   21.294299]  show_stack+0x20/0x38
[   21.294401]  dump_stack_lvl+0x8c/0xd0
[   21.294473]  print_report+0x118/0x5f0
[   21.294520]  kasan_report+0xdc/0x128
[   21.294563]  kasan_check_range+0x100/0x1a8
[   21.294610]  __asan_memset+0x34/0x78
[   21.294653]  kmalloc_oob_in_memset+0x150/0x2e8
[   21.294701]  kunit_try_run_case+0x170/0x3f0
[   21.294747]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.294798]  kthread+0x24c/0x2d0
[   21.294841]  ret_from_fork+0x10/0x20
[   21.294888] 
[   21.302424] Allocated by task 158:
[   21.303040]  kasan_save_stack+0x3c/0x68
[   21.303704]  kasan_save_track+0x20/0x40
[   21.304375]  kasan_save_alloc_info+0x40/0x58
[   21.304950]  __kasan_kmalloc+0xd4/0xd8
[   21.305712]  __kmalloc_cache_noprof+0x154/0x320
[   21.306437]  kmalloc_oob_in_memset+0xb0/0x2e8
[   21.307055]  kunit_try_run_case+0x170/0x3f0
[   21.307650]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.308375]  kthread+0x24c/0x2d0
[   21.308955]  ret_from_fork+0x10/0x20
[   21.309508] 
[   21.309928] The buggy address belongs to the object at fff00000c416b400
[   21.309928]  which belongs to the cache kmalloc-128 of size 128
[   21.311268] The buggy address is located 0 bytes inside of
[   21.311268]  allocated 120-byte region [fff00000c416b400, fff00000c416b478)
[   21.312576] 
[   21.312909] The buggy address belongs to the physical page:
[   21.313594] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10416b
[   21.314362] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   21.315057] page_type: f5(slab)
[   21.315516] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   21.316368] raw: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000
[   21.317094] page dumped because: kasan: bad access detected
[   21.317723] 
[   21.318067] Memory state around the buggy address:
[   21.318571]  fff00000c416b300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   21.319382]  fff00000c416b380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.320070] >fff00000c416b400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   21.320842]                                                                 ^
[   21.321492]  fff00000c416b480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.322263]  fff00000c416b500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.322937] ==================================================================

[   17.605821] ==================================================================
[   17.606976] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x160/0x320
[   17.608266] Write of size 128 at addr ffff888102309f00 by task kunit_try_catch/175
[   17.608794] 
[   17.609022] CPU: 1 UID: 0 PID: 175 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   17.609139] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.609176] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   17.609254] Call Trace:
[   17.609300]  <TASK>
[   17.609349]  dump_stack_lvl+0x73/0xb0
[   17.609432]  print_report+0xd1/0x640
[   17.609505]  ? __virt_addr_valid+0x1db/0x2d0
[   17.609628]  ? kmalloc_oob_in_memset+0x160/0x320
[   17.609667]  ? kasan_complete_mode_report_info+0x2a/0x200
[   17.609700]  ? kmalloc_oob_in_memset+0x160/0x320
[   17.609734]  kasan_report+0x140/0x180
[   17.609768]  ? kmalloc_oob_in_memset+0x160/0x320
[   17.609830]  kasan_check_range+0x10c/0x1c0
[   17.609898]  __asan_memset+0x27/0x50
[   17.609929]  kmalloc_oob_in_memset+0x160/0x320
[   17.609965]  ? __pfx_kmalloc_oob_in_memset+0x10/0x10
[   17.610003]  ? __pfx_kmalloc_oob_in_memset+0x10/0x10
[   17.610043]  kunit_try_run_case+0x1a6/0x480
[   17.610077]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.610105]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   17.610134]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   17.610170]  ? __kthread_parkme+0x82/0x160
[   17.610198]  ? preempt_count_sub+0x50/0x80
[   17.610258]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.610288]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   17.610324]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   17.610362]  kthread+0x257/0x310
[   17.610387]  ? __pfx_kthread+0x10/0x10
[   17.610413]  ret_from_fork+0x41/0x80
[   17.610450]  ? __pfx_kthread+0x10/0x10
[   17.610571]  ret_from_fork_asm+0x1a/0x30
[   17.610616]  </TASK>
[   17.610631] 
[   17.631193] Allocated by task 175:
[   17.631568]  kasan_save_stack+0x45/0x70
[   17.632058]  kasan_save_track+0x18/0x40
[   17.632529]  kasan_save_alloc_info+0x3b/0x50
[   17.633639]  __kasan_kmalloc+0xb7/0xc0
[   17.633992]  __kmalloc_cache_noprof+0x168/0x350
[   17.635334]  kmalloc_oob_in_memset+0xad/0x320
[   17.636784]  kunit_try_run_case+0x1a6/0x480
[   17.637071]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   17.637413]  kthread+0x257/0x310
[   17.637630]  ret_from_fork+0x41/0x80
[   17.639486]  ret_from_fork_asm+0x1a/0x30
[   17.639899] 
[   17.640731] The buggy address belongs to the object at ffff888102309f00
[   17.640731]  which belongs to the cache kmalloc-128 of size 128
[   17.642775] The buggy address is located 0 bytes inside of
[   17.642775]  allocated 120-byte region [ffff888102309f00, ffff888102309f78)
[   17.643415] 
[   17.643586] The buggy address belongs to the physical page:
[   17.643914] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102309
[   17.644755] flags: 0x200000000000000(node=0|zone=2)
[   17.646067] page_type: f5(slab)
[   17.646721] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   17.649539] raw: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000
[   17.650292] page dumped because: kasan: bad access detected
[   17.651167] 
[   17.651578] Memory state around the buggy address:
[   17.652077]  ffff888102309e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
[   17.653143]  ffff888102309e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.654014] >ffff888102309f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   17.654852]                                                                 ^
[   17.655636]  ffff888102309f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.656262]  ffff88810230a000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   17.656978] ==================================================================