Hay
Date
May 29, 2025, 7:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   21.594219] ==================================================================
[   21.594572] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_4+0x150/0x300
[   21.594732] Write of size 4 at addr fff00000c5d6ec75 by task kunit_try_catch/174
[   21.594854] 
[   21.594931] CPU: 1 UID: 0 PID: 174 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT 
[   21.595112] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.595174] Hardware name: linux,dummy-virt (DT)
[   21.595251] Call trace:
[   21.595308]  show_stack+0x20/0x38 (C)
[   21.595446]  dump_stack_lvl+0x8c/0xd0
[   21.595569]  print_report+0x118/0x608
[   21.596087]  kasan_report+0xdc/0x128
[   21.596308]  kasan_check_range+0x100/0x1a8
[   21.596786]  __asan_memset+0x34/0x78
[   21.597096]  kmalloc_oob_memset_4+0x150/0x300
[   21.597364]  kunit_try_run_case+0x170/0x3f0
[   21.597663]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.597813]  kthread+0x328/0x630
[   21.598221]  ret_from_fork+0x10/0x20
[   21.598475] 
[   21.598589] Allocated by task 174:
[   21.598762]  kasan_save_stack+0x3c/0x68
[   21.599004]  kasan_save_track+0x20/0x40
[   21.599088]  kasan_save_alloc_info+0x40/0x58
[   21.599160]  __kasan_kmalloc+0xd4/0xd8
[   21.599239]  __kmalloc_cache_noprof+0x15c/0x3c0
[   21.599328]  kmalloc_oob_memset_4+0xb0/0x300
[   21.599818]  kunit_try_run_case+0x170/0x3f0
[   21.600049]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.600287]  kthread+0x328/0x630
[   21.600537]  ret_from_fork+0x10/0x20
[   21.600658] 
[   21.600712] The buggy address belongs to the object at fff00000c5d6ec00
[   21.600712]  which belongs to the cache kmalloc-128 of size 128
[   21.601243] The buggy address is located 117 bytes inside of
[   21.601243]  allocated 120-byte region [fff00000c5d6ec00, fff00000c5d6ec78)
[   21.601406] 
[   21.601503] The buggy address belongs to the physical page:
[   21.601615] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105d6e
[   21.601800] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   21.602015] page_type: f5(slab)
[   21.602118] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   21.602554] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   21.602902] page dumped because: kasan: bad access detected
[   21.602989] 
[   21.603039] Memory state around the buggy address:
[   21.603121]  fff00000c5d6eb00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   21.603227]  fff00000c5d6eb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.603315] >fff00000c5d6ec00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   21.603384]                                                                 ^
[   21.604012]  fff00000c5d6ec80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.604161]  fff00000c5d6ed00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.604314] ==================================================================


[   10.988404] ==================================================================
[   10.988909] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_4+0x166/0x330
[   10.989197] Write of size 4 at addr ffff888102896b75 by task kunit_try_catch/191
[   10.989508] 
[   10.989622] CPU: 1 UID: 0 PID: 191 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT(voluntary) 
[   10.989667] Tainted: [B]=BAD_PAGE, [N]=TEST
[   10.989679] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   10.989700] Call Trace:
[   10.989711]  <TASK>
[   10.989726]  dump_stack_lvl+0x73/0xb0
[   10.989751]  print_report+0xd1/0x650
[   10.989773]  ? __virt_addr_valid+0x1db/0x2d0
[   10.989795]  ? kmalloc_oob_memset_4+0x166/0x330
[   10.989815]  ? kasan_complete_mode_report_info+0x2a/0x200
[   10.989837]  ? kmalloc_oob_memset_4+0x166/0x330
[   10.989859]  kasan_report+0x141/0x180
[   10.989880]  ? kmalloc_oob_memset_4+0x166/0x330
[   10.989906]  kasan_check_range+0x10c/0x1c0
[   10.989930]  __asan_memset+0x27/0x50
[   10.989949]  kmalloc_oob_memset_4+0x166/0x330
[   10.989971]  ? __pfx_kmalloc_oob_memset_4+0x10/0x10
[   10.989994]  ? __schedule+0x10cc/0x2b60
[   10.990016]  ? __pfx_read_tsc+0x10/0x10
[   10.990036]  ? ktime_get_ts64+0x86/0x230
[   10.990060]  kunit_try_run_case+0x1a5/0x480
[   10.990081]  ? __pfx_kunit_try_run_case+0x10/0x10
[   10.990099]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   10.990123]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   10.990146]  ? __kthread_parkme+0x82/0x180
[   10.990166]  ? preempt_count_sub+0x50/0x80
[   10.990188]  ? __pfx_kunit_try_run_case+0x10/0x10
[   10.990209]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   10.990232]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   10.990255]  kthread+0x337/0x6f0
[   10.990274]  ? trace_preempt_on+0x20/0xc0
[   10.990297]  ? __pfx_kthread+0x10/0x10
[   10.990316]  ? _raw_spin_unlock_irq+0x47/0x80
[   10.990338]  ? calculate_sigpending+0x7b/0xa0
[   10.990361]  ? __pfx_kthread+0x10/0x10
[   10.990382]  ret_from_fork+0x116/0x1d0
[   10.990400]  ? __pfx_kthread+0x10/0x10
[   10.990419]  ret_from_fork_asm+0x1a/0x30
[   10.990449]  </TASK>
[   10.990459] 
[   10.997958] Allocated by task 191:
[   10.998136]  kasan_save_stack+0x45/0x70
[   10.998316]  kasan_save_track+0x18/0x40
[   10.998501]  kasan_save_alloc_info+0x3b/0x50
[   10.998711]  __kasan_kmalloc+0xb7/0xc0
[   10.998964]  __kmalloc_cache_noprof+0x189/0x420
[   10.999128]  kmalloc_oob_memset_4+0xac/0x330
[   10.999330]  kunit_try_run_case+0x1a5/0x480
[   10.999538]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   10.999875]  kthread+0x337/0x6f0
[   11.000052]  ret_from_fork+0x116/0x1d0
[   11.000196]  ret_from_fork_asm+0x1a/0x30
[   11.000396] 
[   11.000486] The buggy address belongs to the object at ffff888102896b00
[   11.000486]  which belongs to the cache kmalloc-128 of size 128
[   11.000935] The buggy address is located 117 bytes inside of
[   11.000935]  allocated 120-byte region [ffff888102896b00, ffff888102896b78)
[   11.001480] 
[   11.001577] The buggy address belongs to the physical page:
[   11.001920] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102896
[   11.002269] flags: 0x200000000000000(node=0|zone=2)
[   11.002483] page_type: f5(slab)
[   11.002620] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   11.002930] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   11.003273] page dumped because: kasan: bad access detected
[   11.003532] 
[   11.003636] Memory state around the buggy address:
[   11.004035]  ffff888102896a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   11.004377]  ffff888102896a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.004691] >ffff888102896b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   11.005041]                                                                 ^
[   11.005346]  ffff888102896b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.005645]  ffff888102896c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.005998] ==================================================================