Hay
Date
Nov. 22, 2024, 6:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   33.461977] ==================================================================
[   33.463597] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_16+0x3a0/0x3f8
[   33.464796] Write of size 16 at addr fff00000c61052a0 by task kunit_try_catch/155
[   33.466391] 
[   33.467458] CPU: 0 UID: 0 PID: 155 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241122 #1
[   33.469278] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.471160] Hardware name: linux,dummy-virt (DT)
[   33.471854] Call trace:
[   33.472260]  show_stack+0x20/0x38 (C)
[   33.472927]  dump_stack_lvl+0x8c/0xd0
[   33.473901]  print_report+0x118/0x5e0
[   33.474511]  kasan_report+0xc8/0x118
[   33.475188]  __asan_report_store16_noabort+0x20/0x30
[   33.475925]  kmalloc_oob_16+0x3a0/0x3f8
[   33.476724]  kunit_try_run_case+0x14c/0x3d0
[   33.477857]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.478992]  kthread+0x24c/0x2d0
[   33.479886]  ret_from_fork+0x10/0x20
[   33.481055] 
[   33.481787] Allocated by task 155:
[   33.482283]  kasan_save_stack+0x3c/0x68
[   33.482720]  kasan_save_track+0x20/0x40
[   33.483154]  kasan_save_alloc_info+0x40/0x58
[   33.483817]  __kasan_kmalloc+0xd4/0xd8
[   33.484256]  __kmalloc_cache_noprof+0x15c/0x3c8
[   33.486544]  kmalloc_oob_16+0xb4/0x3f8
[   33.487063]  kunit_try_run_case+0x14c/0x3d0
[   33.488105]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.489539]  kthread+0x24c/0x2d0
[   33.490744]  ret_from_fork+0x10/0x20
[   33.491536] 
[   33.492170] The buggy address belongs to the object at fff00000c61052a0
[   33.492170]  which belongs to the cache kmalloc-16 of size 16
[   33.496087] The buggy address is located 0 bytes inside of
[   33.496087]  allocated 13-byte region [fff00000c61052a0, fff00000c61052ad)
[   33.499034] 
[   33.499471] The buggy address belongs to the physical page:
[   33.500239] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106105
[   33.501233] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   33.502967] page_type: f5(slab)
[   33.503754] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   33.505547] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000
[   33.507145] page dumped because: kasan: bad access detected
[   33.507943] 
[   33.508243] Memory state around the buggy address:
[   33.508847]  fff00000c6105180: fa fb fc fc 00 05 fc fc 00 05 fc fc 00 00 fc fc
[   33.509973]  fff00000c6105200: 00 06 fc fc 00 06 fc fc 00 00 fc fc fa fb fc fc
[   33.511306] >fff00000c6105280: fa fb fc fc 00 05 fc fc 00 00 fc fc fc fc fc fc
[   33.512284]                                   ^
[   33.513169]  fff00000c6105300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.514105]  fff00000c6105380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.515648] ==================================================================

[   24.979727] ==================================================================
[   24.980582] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_16+0x454/0x4a0
[   24.981538] Write of size 16 at addr ffff888102834680 by task kunit_try_catch/174
[   24.982913] 
[   24.983191] CPU: 1 UID: 0 PID: 174 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241122 #1
[   24.983814] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.985073] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.986171] Call Trace:
[   24.986813]  <TASK>
[   24.987136]  dump_stack_lvl+0x73/0xb0
[   24.987654]  print_report+0xd1/0x640
[   24.988144]  ? __virt_addr_valid+0x1db/0x2d0
[   24.989313]  ? kasan_complete_mode_report_info+0x2a/0x200
[   24.989761]  kasan_report+0x102/0x140
[   24.990439]  ? kmalloc_oob_16+0x454/0x4a0
[   24.990846]  ? kmalloc_oob_16+0x454/0x4a0
[   24.991231]  __asan_report_store16_noabort+0x1b/0x30
[   24.992471]  kmalloc_oob_16+0x454/0x4a0
[   24.992850]  ? __pfx_kmalloc_oob_16+0x10/0x10
[   24.993634]  ? __schedule+0xc3e/0x2790
[   24.994366]  ? __pfx_read_tsc+0x10/0x10
[   24.995314]  ? ktime_get_ts64+0x84/0x230
[   24.995709]  kunit_try_run_case+0x1b3/0x490
[   24.996334]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.997207]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   24.997616]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.998485]  ? __kthread_parkme+0x82/0x160
[   24.999179]  ? preempt_count_sub+0x50/0x80
[   24.999674]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.000758]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.001232]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.001934]  kthread+0x257/0x310
[   25.002628]  ? __pfx_kthread+0x10/0x10
[   25.003301]  ret_from_fork+0x41/0x80
[   25.003728]  ? __pfx_kthread+0x10/0x10
[   25.004200]  ret_from_fork_asm+0x1a/0x30
[   25.004892]  </TASK>
[   25.005395] 
[   25.005633] Allocated by task 174:
[   25.006415]  kasan_save_stack+0x3d/0x60
[   25.006957]  kasan_save_track+0x18/0x40
[   25.007639]  kasan_save_alloc_info+0x3b/0x50
[   25.008217]  __kasan_kmalloc+0xb7/0xc0
[   25.008896]  __kmalloc_cache_noprof+0x184/0x410
[   25.009565]  kmalloc_oob_16+0xa9/0x4a0
[   25.009841]  kunit_try_run_case+0x1b3/0x490
[   25.010145]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.010690]  kthread+0x257/0x310
[   25.011036]  ret_from_fork+0x41/0x80
[   25.011568]  ret_from_fork_asm+0x1a/0x30
[   25.011893] 
[   25.012047] The buggy address belongs to the object at ffff888102834680
[   25.012047]  which belongs to the cache kmalloc-16 of size 16
[   25.012898] The buggy address is located 0 bytes inside of
[   25.012898]  allocated 13-byte region [ffff888102834680, ffff88810283468d)
[   25.013924] 
[   25.014086] The buggy address belongs to the physical page:
[   25.015115] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102834
[   25.015982] flags: 0x200000000000000(node=0|zone=2)
[   25.016484] page_type: f5(slab)
[   25.017064] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   25.017814] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000
[   25.019158] page dumped because: kasan: bad access detected
[   25.019737] 
[   25.019975] Memory state around the buggy address:
[   25.020555]  ffff888102834580: 00 02 fc fc 00 02 fc fc 00 02 fc fc fa fb fc fc
[   25.021206]  ffff888102834600: fa fb fc fc fa fb fc fc 00 05 fc fc fa fb fc fc
[   25.021858] >ffff888102834680: 00 05 fc fc 00 00 fc fc fc fc fc fc fc fc fc fc
[   25.022228]                       ^
[   25.022902]  ffff888102834700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.023537]  ffff888102834780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.024430] ==================================================================