Hay
Date
Dec. 3, 2024, 11:38 p.m.

Environment
qemu-arm64
qemu-x86_64

[   30.409160] ==================================================================
[   30.410312] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x144/0x2d0
[   30.411076] Write of size 128 at addr fff00000c58e8400 by task kunit_try_catch/159
[   30.411985] 
[   30.412317] CPU: 1 UID: 0 PID: 159 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241203 #1
[   30.414922] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.415986] Hardware name: linux,dummy-virt (DT)
[   30.416607] Call trace:
[   30.417032]  show_stack+0x20/0x38 (C)
[   30.417634]  dump_stack_lvl+0x8c/0xd0
[   30.418231]  print_report+0x118/0x5e0
[   30.419022]  kasan_report+0xc8/0x118
[   30.419967]  kasan_check_range+0x100/0x1a8
[   30.420596]  __asan_memset+0x34/0x78
[   30.421123]  kmalloc_oob_in_memset+0x144/0x2d0
[   30.421771]  kunit_try_run_case+0x14c/0x3d0
[   30.422697]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.424063]  kthread+0x24c/0x2d0
[   30.424632]  ret_from_fork+0x10/0x20
[   30.425181] 
[   30.425911] Allocated by task 159:
[   30.426444]  kasan_save_stack+0x3c/0x68
[   30.427026]  kasan_save_track+0x20/0x40
[   30.427628]  kasan_save_alloc_info+0x40/0x58
[   30.428257]  __kasan_kmalloc+0xd4/0xd8
[   30.428834]  __kmalloc_cache_noprof+0x15c/0x3c0
[   30.429486]  kmalloc_oob_in_memset+0xb0/0x2d0
[   30.430092]  kunit_try_run_case+0x14c/0x3d0
[   30.431181]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.432201]  kthread+0x24c/0x2d0
[   30.433439]  ret_from_fork+0x10/0x20
[   30.433961] 
[   30.434278] The buggy address belongs to the object at fff00000c58e8400
[   30.434278]  which belongs to the cache kmalloc-128 of size 128
[   30.435998] The buggy address is located 0 bytes inside of
[   30.435998]  allocated 120-byte region [fff00000c58e8400, fff00000c58e8478)
[   30.437860] 
[   30.438464] The buggy address belongs to the physical page:
[   30.439605] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1058e8
[   30.440609] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   30.441409] page_type: f5(slab)
[   30.441859] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   30.442889] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   30.443812] page dumped because: kasan: bad access detected
[   30.444556] 
[   30.444912] Memory state around the buggy address:
[   30.445918]  fff00000c58e8300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   30.446785]  fff00000c58e8380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.447986] >fff00000c58e8400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   30.448830]                                                                 ^
[   30.449705]  fff00000c58e8480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.450600]  fff00000c58e8500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.452063] ==================================================================

[   26.006830] ==================================================================
[   26.007529] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x160/0x320
[   26.008089] Write of size 128 at addr ffff888102985000 by task kunit_try_catch/179
[   26.008719] 
[   26.008958] CPU: 0 UID: 0 PID: 179 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241203 #1
[   26.011027] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.011301] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.011900] Call Trace:
[   26.012284]  <TASK>
[   26.012599]  dump_stack_lvl+0x73/0xb0
[   26.014098]  print_report+0xd1/0x640
[   26.014656]  ? __virt_addr_valid+0x1db/0x2d0
[   26.015391]  ? kasan_complete_mode_report_info+0x2a/0x200
[   26.015799]  kasan_report+0x102/0x140
[   26.016324]  ? kmalloc_oob_in_memset+0x160/0x320
[   26.017021]  ? kmalloc_oob_in_memset+0x160/0x320
[   26.017507]  kasan_check_range+0x10c/0x1c0
[   26.017895]  __asan_memset+0x27/0x50
[   26.018298]  kmalloc_oob_in_memset+0x160/0x320
[   26.018713]  ? __pfx_kmalloc_oob_in_memset+0x10/0x10
[   26.019194]  ? __schedule+0xc3e/0x2790
[   26.020225]  ? __pfx_read_tsc+0x10/0x10
[   26.020751]  ? ktime_get_ts64+0x86/0x230
[   26.021249]  kunit_try_run_case+0x1b3/0x490
[   26.021857]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.022348]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   26.022955]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.023403]  ? __kthread_parkme+0x82/0x160
[   26.024393]  ? preempt_count_sub+0x50/0x80
[   26.024739]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.025197]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.025641]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.026049]  kthread+0x257/0x310
[   26.026758]  ? __pfx_kthread+0x10/0x10
[   26.027030]  ret_from_fork+0x41/0x80
[   26.027504]  ? __pfx_kthread+0x10/0x10
[   26.028129]  ret_from_fork_asm+0x1a/0x30
[   26.028609]  </TASK>
[   26.029077] 
[   26.029287] Allocated by task 179:
[   26.029739]  kasan_save_stack+0x3d/0x60
[   26.030796]  kasan_save_track+0x18/0x40
[   26.031092]  kasan_save_alloc_info+0x3b/0x50
[   26.031589]  __kasan_kmalloc+0xb7/0xc0
[   26.032200]  __kmalloc_cache_noprof+0x184/0x410
[   26.032689]  kmalloc_oob_in_memset+0xad/0x320
[   26.033199]  kunit_try_run_case+0x1b3/0x490
[   26.033931]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.034360]  kthread+0x257/0x310
[   26.034969]  ret_from_fork+0x41/0x80
[   26.035432]  ret_from_fork_asm+0x1a/0x30
[   26.036523] 
[   26.036883] The buggy address belongs to the object at ffff888102985000
[   26.036883]  which belongs to the cache kmalloc-128 of size 128
[   26.038028] The buggy address is located 0 bytes inside of
[   26.038028]  allocated 120-byte region [ffff888102985000, ffff888102985078)
[   26.038970] 
[   26.039268] The buggy address belongs to the physical page:
[   26.039885] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102985
[   26.040507] flags: 0x200000000000000(node=0|zone=2)
[   26.041354] page_type: f5(slab)
[   26.041716] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   26.042347] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   26.042866] page dumped because: kasan: bad access detected
[   26.043419] 
[   26.043723] Memory state around the buggy address:
[   26.044199]  ffff888102984f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.045078]  ffff888102984f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.045714] >ffff888102985000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   26.046670]                                                                 ^
[   26.047247]  ffff888102985080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.048586]  ffff888102985100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.049507] ==================================================================