Hay
Date
Nov. 28, 2024, 2:36 a.m.

Environment
qemu-arm64
qemu-x86_64

[   30.532156] ==================================================================
[   30.533147] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x144/0x2d0
[   30.533914] Write of size 128 at addr fff00000c638e400 by task kunit_try_catch/158
[   30.535417] 
[   30.535762] CPU: 0 UID: 0 PID: 158 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   30.536575] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.537516] Hardware name: linux,dummy-virt (DT)
[   30.538153] Call trace:
[   30.538507]  show_stack+0x20/0x38 (C)
[   30.539090]  dump_stack_lvl+0x8c/0xd0
[   30.539652]  print_report+0x118/0x5e0
[   30.540185]  kasan_report+0xc8/0x118
[   30.540773]  kasan_check_range+0x100/0x1a8
[   30.541820]  __asan_memset+0x34/0x78
[   30.542360]  kmalloc_oob_in_memset+0x144/0x2d0
[   30.542913]  kunit_try_run_case+0x14c/0x3d0
[   30.543494]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.544187]  kthread+0x24c/0x2d0
[   30.544771]  ret_from_fork+0x10/0x20
[   30.545477] 
[   30.545822] Allocated by task 158:
[   30.546237]  kasan_save_stack+0x3c/0x68
[   30.546741]  kasan_save_track+0x20/0x40
[   30.547668]  kasan_save_alloc_info+0x40/0x58
[   30.548226]  __kasan_kmalloc+0xd4/0xd8
[   30.548897]  __kmalloc_cache_noprof+0x15c/0x3c0
[   30.549906]  kmalloc_oob_in_memset+0xb0/0x2d0
[   30.550566]  kunit_try_run_case+0x14c/0x3d0
[   30.551219]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.551938]  kthread+0x24c/0x2d0
[   30.552518]  ret_from_fork+0x10/0x20
[   30.553241] 
[   30.554016] The buggy address belongs to the object at fff00000c638e400
[   30.554016]  which belongs to the cache kmalloc-128 of size 128
[   30.555044] The buggy address is located 0 bytes inside of
[   30.555044]  allocated 120-byte region [fff00000c638e400, fff00000c638e478)
[   30.555867] 
[   30.556336] The buggy address belongs to the physical page:
[   30.556800] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10638e
[   30.557441] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   30.559191] page_type: f5(slab)
[   30.559628] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   30.560408] raw: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000
[   30.561716] page dumped because: kasan: bad access detected
[   30.562569] 
[   30.563072] Memory state around the buggy address:
[   30.563806]  fff00000c638e300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
[   30.564760]  fff00000c638e380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.565942] >fff00000c638e400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   30.566635]                                                                 ^
[   30.567306]  fff00000c638e480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.568153]  fff00000c638e500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.569357] ==================================================================

[   21.454795] ==================================================================
[   21.455891] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_in_memset+0x160/0x320
[   21.457231] Write of size 128 at addr ffff888102a1d000 by task kunit_try_catch/178
[   21.458207] 
[   21.458571] CPU: 0 UID: 0 PID: 178 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   21.459498] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.459912] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   21.460921] Call Trace:
[   21.461259]  <TASK>
[   21.461775]  dump_stack_lvl+0x73/0xb0
[   21.462089]  print_report+0xd1/0x640
[   21.462737]  ? __virt_addr_valid+0x1db/0x2d0
[   21.463414]  ? kasan_complete_mode_report_info+0x2a/0x200
[   21.464125]  kasan_report+0x102/0x140
[   21.464511]  ? kmalloc_oob_in_memset+0x160/0x320
[   21.464885]  ? kmalloc_oob_in_memset+0x160/0x320
[   21.465361]  kasan_check_range+0x10c/0x1c0
[   21.465861]  __asan_memset+0x27/0x50
[   21.466244]  kmalloc_oob_in_memset+0x160/0x320
[   21.466724]  ? __pfx_kmalloc_oob_in_memset+0x10/0x10
[   21.467123]  ? __schedule+0xc3e/0x2790
[   21.467583]  ? __pfx_read_tsc+0x10/0x10
[   21.467959]  ? ktime_get_ts64+0x84/0x230
[   21.468416]  kunit_try_run_case+0x1b3/0x490
[   21.468719]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.469366]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   21.469757]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   21.470295]  ? __kthread_parkme+0x82/0x160
[   21.470678]  ? preempt_count_sub+0x50/0x80
[   21.471196]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.471765]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   21.472372]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.472954]  kthread+0x257/0x310
[   21.473360]  ? __pfx_kthread+0x10/0x10
[   21.473698]  ret_from_fork+0x41/0x80
[   21.474130]  ? __pfx_kthread+0x10/0x10
[   21.474601]  ret_from_fork_asm+0x1a/0x30
[   21.474961]  </TASK>
[   21.475327] 
[   21.475512] Allocated by task 178:
[   21.475825]  kasan_save_stack+0x3d/0x60
[   21.476252]  kasan_save_track+0x18/0x40
[   21.476563]  kasan_save_alloc_info+0x3b/0x50
[   21.477128]  __kasan_kmalloc+0xb7/0xc0
[   21.477639]  __kmalloc_cache_noprof+0x184/0x410
[   21.478031]  kmalloc_oob_in_memset+0xad/0x320
[   21.478465]  kunit_try_run_case+0x1b3/0x490
[   21.478863]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.479292]  kthread+0x257/0x310
[   21.479699]  ret_from_fork+0x41/0x80
[   21.480161]  ret_from_fork_asm+0x1a/0x30
[   21.480580] 
[   21.480735] The buggy address belongs to the object at ffff888102a1d000
[   21.480735]  which belongs to the cache kmalloc-128 of size 128
[   21.482203] The buggy address is located 0 bytes inside of
[   21.482203]  allocated 120-byte region [ffff888102a1d000, ffff888102a1d078)
[   21.483579] 
[   21.483802] The buggy address belongs to the physical page:
[   21.484395] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a1d
[   21.485234] flags: 0x200000000000000(node=0|zone=2)
[   21.485879] page_type: f5(slab)
[   21.486354] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   21.487191] raw: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000
[   21.487823] page dumped because: kasan: bad access detected
[   21.488201] 
[   21.488570] Memory state around the buggy address:
[   21.489377]  ffff888102a1cf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.489830]  ffff888102a1cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.490829] >ffff888102a1d000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   21.491524]                                                                 ^
[   21.492288]  ffff888102a1d080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.492987]  ffff888102a1d100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.493753] ==================================================================