Hay
Date
May 12, 2025, 6:12 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.697634] ==================================================================
[   18.698363] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x150/0x2f8
[   18.699474] Write of size 2 at addr fff00000c59c2777 by task kunit_try_catch/161
[   18.700508] 
[   18.700885] CPU: 1 UID: 0 PID: 161 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   18.701040] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.701108] Hardware name: linux,dummy-virt (DT)
[   18.701347] Call trace:
[   18.701384]  show_stack+0x20/0x38 (C)
[   18.701454]  dump_stack_lvl+0x8c/0xd0
[   18.701510]  print_report+0x118/0x608
[   18.701562]  kasan_report+0xdc/0x128
[   18.701611]  kasan_check_range+0x100/0x1a8
[   18.701663]  __asan_memset+0x34/0x78
[   18.701710]  kmalloc_oob_memset_2+0x150/0x2f8
[   18.701786]  kunit_try_run_case+0x170/0x3f0
[   18.701844]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.701900]  kthread+0x318/0x620
[   18.701949]  ret_from_fork+0x10/0x20
[   18.702004] 
[   18.707775] Allocated by task 161:
[   18.708305]  kasan_save_stack+0x3c/0x68
[   18.708796]  kasan_save_track+0x20/0x40
[   18.709233]  kasan_save_alloc_info+0x40/0x58
[   18.709703]  __kasan_kmalloc+0xd4/0xd8
[   18.710152]  __kmalloc_cache_noprof+0x15c/0x3c0
[   18.710924]  kmalloc_oob_memset_2+0xb0/0x2f8
[   18.711325]  kunit_try_run_case+0x170/0x3f0
[   18.711860]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.712458]  kthread+0x318/0x620
[   18.712915]  ret_from_fork+0x10/0x20
[   18.713371] 
[   18.713671] The buggy address belongs to the object at fff00000c59c2700
[   18.713671]  which belongs to the cache kmalloc-128 of size 128
[   18.714902] The buggy address is located 119 bytes inside of
[   18.714902]  allocated 120-byte region [fff00000c59c2700, fff00000c59c2778)
[   18.716234] 
[   18.716438] The buggy address belongs to the physical page:
[   18.716629] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1059c2
[   18.716906] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.717130] page_type: f5(slab)
[   18.717284] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   18.717518] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   18.717770] page dumped because: kasan: bad access detected
[   18.718371] 
[   18.718647] Memory state around the buggy address:
[   18.720213]  fff00000c59c2600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.721168]  fff00000c59c2680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.721830] >fff00000c59c2700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   18.722352]                                                                 ^
[   18.723252]  fff00000c59c2780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.723912]  fff00000c59c2800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.724634] ==================================================================

[   12.485378] ==================================================================
[   12.485817] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x167/0x330
[   12.486091] Write of size 2 at addr ffff888101b0ea77 by task kunit_try_catch/180
[   12.486318] 
[   12.486406] CPU: 1 UID: 0 PID: 180 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   12.486453] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.486465] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.486486] Call Trace:
[   12.486500]  <TASK>
[   12.486520]  dump_stack_lvl+0x73/0xb0
[   12.486548]  print_report+0xd1/0x650
[   12.486570]  ? __virt_addr_valid+0x1db/0x2d0
[   12.486592]  ? kmalloc_oob_memset_2+0x167/0x330
[   12.486613]  ? kasan_complete_mode_report_info+0x2a/0x200
[   12.486637]  ? kmalloc_oob_memset_2+0x167/0x330
[   12.486657]  kasan_report+0x140/0x180
[   12.486678]  ? kmalloc_oob_memset_2+0x167/0x330
[   12.486702]  kasan_check_range+0x10c/0x1c0
[   12.486724]  __asan_memset+0x27/0x50
[   12.486746]  kmalloc_oob_memset_2+0x167/0x330
[   12.486767]  ? __pfx_kmalloc_oob_memset_2+0x10/0x10
[   12.486788]  ? __schedule+0xce8/0x2840
[   12.486812]  ? __pfx_read_tsc+0x10/0x10
[   12.486834]  ? ktime_get_ts64+0x86/0x230
[   12.486910]  kunit_try_run_case+0x1a6/0x480
[   12.486934]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.486955]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   12.486975]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.487000]  ? __kthread_parkme+0x82/0x160
[   12.487022]  ? preempt_count_sub+0x50/0x80
[   12.487344]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.487370]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.487396]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.487788]  kthread+0x324/0x6e0
[   12.487820]  ? trace_preempt_on+0x20/0xc0
[   12.487857]  ? __pfx_kthread+0x10/0x10
[   12.487879]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.488138]  ? calculate_sigpending+0x7b/0xa0
[   12.488164]  ? __pfx_kthread+0x10/0x10
[   12.488186]  ret_from_fork+0x41/0x80
[   12.488207]  ? __pfx_kthread+0x10/0x10
[   12.488228]  ret_from_fork_asm+0x1a/0x30
[   12.488260]  </TASK>
[   12.488271] 
[   12.502198] Allocated by task 180:
[   12.502562]  kasan_save_stack+0x45/0x70
[   12.502945]  kasan_save_track+0x18/0x40
[   12.503592]  kasan_save_alloc_info+0x3b/0x50
[   12.504050]  __kasan_kmalloc+0xb7/0xc0
[   12.504336]  __kmalloc_cache_noprof+0x18a/0x420
[   12.504501]  kmalloc_oob_memset_2+0xad/0x330
[   12.504647]  kunit_try_run_case+0x1a6/0x480
[   12.504797]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.505023]  kthread+0x324/0x6e0
[   12.505227]  ret_from_fork+0x41/0x80
[   12.505386]  ret_from_fork_asm+0x1a/0x30
[   12.505539] 
[   12.505636] The buggy address belongs to the object at ffff888101b0ea00
[   12.505636]  which belongs to the cache kmalloc-128 of size 128
[   12.506253] The buggy address is located 119 bytes inside of
[   12.506253]  allocated 120-byte region [ffff888101b0ea00, ffff888101b0ea78)
[   12.506725] 
[   12.506800] The buggy address belongs to the physical page:
[   12.507350] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101b0e
[   12.507690] flags: 0x200000000000000(node=0|zone=2)
[   12.507932] page_type: f5(slab)
[   12.508174] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   12.508508] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   12.508822] page dumped because: kasan: bad access detected
[   12.509146] 
[   12.509245] Memory state around the buggy address:
[   12.509417]  ffff888101b0e900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   12.509702]  ffff888101b0e980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.510111] >ffff888101b0ea00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   12.510400]                                                                 ^
[   12.510671]  ffff888101b0ea80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.510949]  ffff888101b0eb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.511570] ==================================================================