Hay
Date
July 4, 2025, 11:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   29.601319] ==================================================================
[   29.601378] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x150/0x2f8
[   29.601427] Write of size 2 at addr fff00000c5a97b77 by task kunit_try_catch/205
[   29.601475] 
[   29.601547] CPU: 0 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT 
[   29.601684] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.601877] Hardware name: linux,dummy-virt (DT)
[   29.601965] Call trace:
[   29.602088]  show_stack+0x20/0x38 (C)
[   29.602137]  dump_stack_lvl+0x8c/0xd0
[   29.602209]  print_report+0x118/0x608
[   29.602255]  kasan_report+0xdc/0x128
[   29.602300]  kasan_check_range+0x100/0x1a8
[   29.602575]  __asan_memset+0x34/0x78
[   29.602720]  kmalloc_oob_memset_2+0x150/0x2f8
[   29.602786]  kunit_try_run_case+0x170/0x3f0
[   29.602998]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.603215]  kthread+0x328/0x630
[   29.603359]  ret_from_fork+0x10/0x20
[   29.603435] 
[   29.603454] Allocated by task 205:
[   29.603480]  kasan_save_stack+0x3c/0x68
[   29.603521]  kasan_save_track+0x20/0x40
[   29.603693]  kasan_save_alloc_info+0x40/0x58
[   29.603827]  __kasan_kmalloc+0xd4/0xd8
[   29.603925]  __kmalloc_cache_noprof+0x16c/0x3c0
[   29.603966]  kmalloc_oob_memset_2+0xb0/0x2f8
[   29.604003]  kunit_try_run_case+0x170/0x3f0
[   29.604053]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.604106]  kthread+0x328/0x630
[   29.604138]  ret_from_fork+0x10/0x20
[   29.604189] 
[   29.604208] The buggy address belongs to the object at fff00000c5a97b00
[   29.604208]  which belongs to the cache kmalloc-128 of size 128
[   29.604264] The buggy address is located 119 bytes inside of
[   29.604264]  allocated 120-byte region [fff00000c5a97b00, fff00000c5a97b78)
[   29.604324] 
[   29.604345] The buggy address belongs to the physical page:
[   29.604394] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105a97
[   29.604454] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.604507] page_type: f5(slab)
[   29.604545] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   29.604592] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   29.604631] page dumped because: kasan: bad access detected
[   29.604670] 
[   29.604688] Memory state around the buggy address:
[   29.604718]  fff00000c5a97a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   29.604760]  fff00000c5a97a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.604805] >fff00000c5a97b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   29.604842]                                                                 ^
[   29.604891]  fff00000c5a97b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.604942]  fff00000c5a97c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.604978] ==================================================================

[   24.979012] ==================================================================
[   24.979494] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x166/0x330
[   24.979874] Write of size 2 at addr ffff888105aac077 by task kunit_try_catch/221
[   24.980216] 
[   24.980343] CPU: 0 UID: 0 PID: 221 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4-next-20250704 #1 PREEMPT(voluntary) 
[   24.980413] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.980427] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.980452] Call Trace:
[   24.980467]  <TASK>
[   24.980489]  dump_stack_lvl+0x73/0xb0
[   24.980522]  print_report+0xd1/0x650
[   24.980547]  ? __virt_addr_valid+0x1db/0x2d0
[   24.980574]  ? kmalloc_oob_memset_2+0x166/0x330
[   24.980596]  ? kasan_complete_mode_report_info+0x2a/0x200
[   24.980624]  ? kmalloc_oob_memset_2+0x166/0x330
[   24.980646]  kasan_report+0x141/0x180
[   24.980669]  ? kmalloc_oob_memset_2+0x166/0x330
[   24.980697]  kasan_check_range+0x10c/0x1c0
[   24.980722]  __asan_memset+0x27/0x50
[   24.980746]  kmalloc_oob_memset_2+0x166/0x330
[   24.980770]  ? __pfx_kmalloc_oob_memset_2+0x10/0x10
[   24.980794]  ? __schedule+0x10cc/0x2b60
[   24.980820]  ? __pfx_read_tsc+0x10/0x10
[   24.980845]  ? ktime_get_ts64+0x86/0x230
[   24.980873]  kunit_try_run_case+0x1a5/0x480
[   24.980979]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.981005]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   24.981032]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.981058]  ? __kthread_parkme+0x82/0x180
[   24.981082]  ? preempt_count_sub+0x50/0x80
[   24.981170]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.981201]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.981228]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.981254]  kthread+0x337/0x6f0
[   24.981276]  ? trace_preempt_on+0x20/0xc0
[   24.981303]  ? __pfx_kthread+0x10/0x10
[   24.981325]  ? _raw_spin_unlock_irq+0x47/0x80
[   24.981349]  ? calculate_sigpending+0x7b/0xa0
[   24.981376]  ? __pfx_kthread+0x10/0x10
[   24.981411]  ret_from_fork+0x116/0x1d0
[   24.981432]  ? __pfx_kthread+0x10/0x10
[   24.981454]  ret_from_fork_asm+0x1a/0x30
[   24.981489]  </TASK>
[   24.981502] 
[   24.989825] Allocated by task 221:
[   24.989965]  kasan_save_stack+0x45/0x70
[   24.990348]  kasan_save_track+0x18/0x40
[   24.990582]  kasan_save_alloc_info+0x3b/0x50
[   24.990808]  __kasan_kmalloc+0xb7/0xc0
[   24.991113]  __kmalloc_cache_noprof+0x189/0x420
[   24.991269]  kmalloc_oob_memset_2+0xac/0x330
[   24.991426]  kunit_try_run_case+0x1a5/0x480
[   24.991774]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.992240]  kthread+0x337/0x6f0
[   24.992429]  ret_from_fork+0x116/0x1d0
[   24.992634]  ret_from_fork_asm+0x1a/0x30
[   24.992835] 
[   24.992981] The buggy address belongs to the object at ffff888105aac000
[   24.992981]  which belongs to the cache kmalloc-128 of size 128
[   24.993546] The buggy address is located 119 bytes inside of
[   24.993546]  allocated 120-byte region [ffff888105aac000, ffff888105aac078)
[   24.994082] 
[   24.994355] The buggy address belongs to the physical page:
[   24.994611] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105aac
[   24.994871] flags: 0x200000000000000(node=0|zone=2)
[   24.995039] page_type: f5(slab)
[   24.995162] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   24.995473] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   24.995903] page dumped because: kasan: bad access detected
[   24.996159] 
[   24.996296] Memory state around the buggy address:
[   24.996620]  ffff888105aabf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.996847]  ffff888105aabf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.997534] >ffff888105aac000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   24.997871]                                                                 ^
[   24.998334]  ffff888105aac080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.998642]  ffff888105aac100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.999009] ==================================================================