Hay
Date
May 15, 2025, 10:38 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.018218] ==================================================================
[   18.018677] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x144/0x2d0
[   18.018737] Write of size 128 at addr fff00000c68f1200 by task kunit_try_catch/170
[   18.018792] 
[   18.019143] CPU: 1 UID: 0 PID: 170 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT 
[   18.019355] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.019456] Hardware name: linux,dummy-virt (DT)
[   18.019630] Call trace:
[   18.019710]  show_stack+0x20/0x38 (C)
[   18.019825]  dump_stack_lvl+0x8c/0xd0
[   18.020046]  print_report+0x118/0x608
[   18.020130]  kasan_report+0xdc/0x128
[   18.020339]  kasan_check_range+0x100/0x1a8
[   18.020477]  __asan_memset+0x34/0x78
[   18.020606]  kmalloc_oob_in_memset+0x144/0x2d0
[   18.020755]  kunit_try_run_case+0x170/0x3f0
[   18.021089]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.021253]  kthread+0x328/0x630
[   18.021474]  ret_from_fork+0x10/0x20
[   18.021592] 
[   18.021694] Allocated by task 170:
[   18.021770]  kasan_save_stack+0x3c/0x68
[   18.021811]  kasan_save_track+0x20/0x40
[   18.021853]  kasan_save_alloc_info+0x40/0x58
[   18.022172]  __kasan_kmalloc+0xd4/0xd8
[   18.022375]  __kmalloc_cache_noprof+0x15c/0x3c0
[   18.022472]  kmalloc_oob_in_memset+0xb0/0x2d0
[   18.022590]  kunit_try_run_case+0x170/0x3f0
[   18.022821]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.022885]  kthread+0x328/0x630
[   18.023084]  ret_from_fork+0x10/0x20
[   18.023181] 
[   18.023204] The buggy address belongs to the object at fff00000c68f1200
[   18.023204]  which belongs to the cache kmalloc-128 of size 128
[   18.023269] The buggy address is located 0 bytes inside of
[   18.023269]  allocated 120-byte region [fff00000c68f1200, fff00000c68f1278)
[   18.023328] 
[   18.023348] The buggy address belongs to the physical page:
[   18.023378] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1068f1
[   18.023428] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.023474] page_type: f5(slab)
[   18.023521] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   18.023582] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   18.023634] page dumped because: kasan: bad access detected
[   18.023674] 
[   18.023692] Memory state around the buggy address:
[   18.023724]  fff00000c68f1100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.023764]  fff00000c68f1180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.023804] >fff00000c68f1200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   18.023849]                                                                 ^
[   18.023886]  fff00000c68f1280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.023927]  fff00000c68f1300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.023963] ==================================================================


[   14.110649] ==================================================================
[   14.111266] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x15f/0x320
[   14.112029] Write of size 128 at addr ffff8881022f9c00 by task kunit_try_catch/188
[   14.112612] 
[   14.112887] CPU: 1 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT(voluntary) 
[   14.112976] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.113309] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.113335] Call Trace:
[   14.113351]  <TASK>
[   14.113374]  dump_stack_lvl+0x73/0xb0
[   14.113413]  print_report+0xd1/0x650
[   14.113437]  ? __virt_addr_valid+0x1db/0x2d0
[   14.113469]  ? kmalloc_oob_in_memset+0x15f/0x320
[   14.113531]  ? kasan_complete_mode_report_info+0x2a/0x200
[   14.113567]  ? kmalloc_oob_in_memset+0x15f/0x320
[   14.113619]  kasan_report+0x141/0x180
[   14.113643]  ? kmalloc_oob_in_memset+0x15f/0x320
[   14.113668]  kasan_check_range+0x10c/0x1c0
[   14.113690]  __asan_memset+0x27/0x50
[   14.113709]  kmalloc_oob_in_memset+0x15f/0x320
[   14.113730]  ? __pfx_kmalloc_oob_in_memset+0x10/0x10
[   14.113750]  ? __schedule+0x10cc/0x2b60
[   14.113772]  ? __pfx_read_tsc+0x10/0x10
[   14.113793]  ? ktime_get_ts64+0x86/0x230
[   14.113817]  kunit_try_run_case+0x1a5/0x480
[   14.113843]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.113862]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.113883]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.113903]  ? __kthread_parkme+0x82/0x180
[   14.113924]  ? preempt_count_sub+0x50/0x80
[   14.113949]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.113970]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.113990]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.114010]  kthread+0x337/0x6f0
[   14.114028]  ? trace_preempt_on+0x20/0xc0
[   14.114051]  ? __pfx_kthread+0x10/0x10
[   14.114070]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.114089]  ? calculate_sigpending+0x7b/0xa0
[   14.114112]  ? __pfx_kthread+0x10/0x10
[   14.114132]  ret_from_fork+0x116/0x1d0
[   14.114149]  ? __pfx_kthread+0x10/0x10
[   14.114168]  ret_from_fork_asm+0x1a/0x30
[   14.114198]  </TASK>
[   14.114211] 
[   14.124232] Allocated by task 188:
[   14.124675]  kasan_save_stack+0x45/0x70
[   14.125067]  kasan_save_track+0x18/0x40
[   14.125277]  kasan_save_alloc_info+0x3b/0x50
[   14.125800]  __kasan_kmalloc+0xb7/0xc0
[   14.126130]  __kmalloc_cache_noprof+0x189/0x420
[   14.126450]  kmalloc_oob_in_memset+0xac/0x320
[   14.126972]  kunit_try_run_case+0x1a5/0x480
[   14.127314]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.127646]  kthread+0x337/0x6f0
[   14.127814]  ret_from_fork+0x116/0x1d0
[   14.128106]  ret_from_fork_asm+0x1a/0x30
[   14.128775] 
[   14.128954] The buggy address belongs to the object at ffff8881022f9c00
[   14.128954]  which belongs to the cache kmalloc-128 of size 128
[   14.129739] The buggy address is located 0 bytes inside of
[   14.129739]  allocated 120-byte region [ffff8881022f9c00, ffff8881022f9c78)
[   14.130707] 
[   14.130890] The buggy address belongs to the physical page:
[   14.131316] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1022f9
[   14.131789] flags: 0x200000000000000(node=0|zone=2)
[   14.132204] page_type: f5(slab)
[   14.132717] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   14.133267] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   14.133904] page dumped because: kasan: bad access detected
[   14.134292] 
[   14.134611] Memory state around the buggy address:
[   14.135002]  ffff8881022f9b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   14.135399]  ffff8881022f9b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.136023] >ffff8881022f9c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   14.136705]                                                                 ^
[   14.137119]  ffff8881022f9c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.137402]  ffff8881022f9d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.138019] ==================================================================