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

Environment
qemu-arm64
qemu-x86_64

[   36.682876] ==================================================================
[   36.683712] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x144/0x2d0
[   36.684556] Write of size 128 at addr fff00000c657f400 by task kunit_try_catch/159
[   36.685721] 
[   36.686069] CPU: 1 UID: 0 PID: 159 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241120 #1
[   36.687026] Tainted: [B]=BAD_PAGE, [N]=TEST
[   36.687858] Hardware name: linux,dummy-virt (DT)
[   36.688339] Call trace:
[   36.688900]  show_stack+0x20/0x38 (C)
[   36.689801]  dump_stack_lvl+0x8c/0xd0
[   36.690432]  print_report+0x118/0x5e0
[   36.691069]  kasan_report+0xc8/0x118
[   36.691570]  kasan_check_range+0x100/0x1a8
[   36.692213]  __asan_memset+0x34/0x78
[   36.692857]  kmalloc_oob_in_memset+0x144/0x2d0
[   36.693522]  kunit_try_run_case+0x14c/0x3d0
[   36.694504]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   36.695261]  kthread+0x24c/0x2d0
[   36.695680]  ret_from_fork+0x10/0x20
[   36.696321] 
[   36.696699] Allocated by task 159:
[   36.697180]  kasan_save_stack+0x3c/0x68
[   36.698279]  kasan_save_track+0x20/0x40
[   36.698854]  kasan_save_alloc_info+0x40/0x58
[   36.699428]  __kasan_kmalloc+0xd4/0xd8
[   36.699982]  __kmalloc_cache_noprof+0x15c/0x3c8
[   36.700600]  kmalloc_oob_in_memset+0xb0/0x2d0
[   36.701226]  kunit_try_run_case+0x14c/0x3d0
[   36.701968]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   36.702565]  kthread+0x24c/0x2d0
[   36.703114]  ret_from_fork+0x10/0x20
[   36.703725] 
[   36.704112] The buggy address belongs to the object at fff00000c657f400
[   36.704112]  which belongs to the cache kmalloc-128 of size 128
[   36.705560] The buggy address is located 0 bytes inside of
[   36.705560]  allocated 120-byte region [fff00000c657f400, fff00000c657f478)
[   36.706836] 
[   36.707212] The buggy address belongs to the physical page:
[   36.708407] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10657f
[   36.709142] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   36.709912] page_type: f5(slab)
[   36.710635] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   36.711417] raw: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000
[   36.712191] page dumped because: kasan: bad access detected
[   36.712889] 
[   36.713613] Memory state around the buggy address:
[   36.714212]  fff00000c657f300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
[   36.714928]  fff00000c657f380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   36.715666] >fff00000c657f400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   36.716413]                                                                 ^
[   36.717180]  fff00000c657f480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   36.718308]  fff00000c657f500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   36.719044] ==================================================================

[   28.140229] ==================================================================
[   28.141060] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x160/0x320
[   28.141664] Write of size 128 at addr ffff888101ac5800 by task kunit_try_catch/177
[   28.142361] 
[   28.142614] CPU: 0 UID: 0 PID: 177 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241120 #1
[   28.143625] Tainted: [B]=BAD_PAGE, [N]=TEST
[   28.144253] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   28.145076] Call Trace:
[   28.145519]  <TASK>
[   28.145901]  dump_stack_lvl+0x73/0xb0
[   28.146439]  print_report+0xd1/0x640
[   28.146832]  ? __virt_addr_valid+0x1db/0x2d0
[   28.147475]  ? kasan_complete_mode_report_info+0x2a/0x200
[   28.148056]  kasan_report+0x102/0x140
[   28.148629]  ? kmalloc_oob_in_memset+0x160/0x320
[   28.149353]  ? kmalloc_oob_in_memset+0x160/0x320
[   28.149863]  kasan_check_range+0x10c/0x1c0
[   28.150350]  __asan_memset+0x27/0x50
[   28.150857]  kmalloc_oob_in_memset+0x160/0x320
[   28.151420]  ? __pfx_kmalloc_oob_in_memset+0x10/0x10
[   28.152028]  ? __schedule+0xc3e/0x2790
[   28.152542]  ? __pfx_read_tsc+0x10/0x10
[   28.152948]  ? ktime_get_ts64+0x84/0x230
[   28.153450]  kunit_try_run_case+0x1b3/0x490
[   28.153892]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.154334]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   28.154791]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   28.155337]  ? __kthread_parkme+0x82/0x160
[   28.155815]  ? preempt_count_sub+0x50/0x80
[   28.156324]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.156958]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   28.157741]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.158295]  kthread+0x257/0x310
[   28.158657]  ? __pfx_kthread+0x10/0x10
[   28.159360]  ret_from_fork+0x41/0x80
[   28.159856]  ? __pfx_kthread+0x10/0x10
[   28.160381]  ret_from_fork_asm+0x1a/0x30
[   28.160951]  </TASK>
[   28.161357] 
[   28.161593] Allocated by task 177:
[   28.162010]  kasan_save_stack+0x3d/0x60
[   28.162502]  kasan_save_track+0x18/0x40
[   28.163009]  kasan_save_alloc_info+0x3b/0x50
[   28.163549]  __kasan_kmalloc+0xb7/0xc0
[   28.164232]  __kmalloc_cache_noprof+0x184/0x410
[   28.164766]  kmalloc_oob_in_memset+0xad/0x320
[   28.165304]  kunit_try_run_case+0x1b3/0x490
[   28.165623]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.166384]  kthread+0x257/0x310
[   28.166777]  ret_from_fork+0x41/0x80
[   28.167064]  ret_from_fork_asm+0x1a/0x30
[   28.167535] 
[   28.167783] The buggy address belongs to the object at ffff888101ac5800
[   28.167783]  which belongs to the cache kmalloc-128 of size 128
[   28.168609] The buggy address is located 0 bytes inside of
[   28.168609]  allocated 120-byte region [ffff888101ac5800, ffff888101ac5878)
[   28.170008] 
[   28.170380] The buggy address belongs to the physical page:
[   28.170802] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101ac5
[   28.171732] flags: 0x200000000000000(node=0|zone=2)
[   28.172563] page_type: f5(slab)
[   28.173347] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   28.173902] raw: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000
[   28.174564] page dumped because: kasan: bad access detected
[   28.175103] 
[   28.175300] Memory state around the buggy address:
[   28.175918]  ffff888101ac5700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
[   28.176632]  ffff888101ac5780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.177740] >ffff888101ac5800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   28.178626]                                                                 ^
[   28.179400]  ffff888101ac5880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.180324]  ffff888101ac5900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.181067] ==================================================================