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

Environment
qemu-arm64
qemu-x86_64

[   33.415296] ==================================================================
[   33.416409] BUG: KASAN: slab-out-of-bounds in memchr+0x78/0x88
[   33.417070] Read of size 1 at addr fff00000c4081998 by task kunit_try_catch/243
[   33.418562] 
[   33.418958] CPU: 1 UID: 0 PID: 243 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   33.420537] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.421014] Hardware name: linux,dummy-virt (DT)
[   33.421949] Call trace:
[   33.422549]  show_stack+0x20/0x38 (C)
[   33.423297]  dump_stack_lvl+0x8c/0xd0
[   33.423999]  print_report+0x118/0x5e0
[   33.424733]  kasan_report+0xc8/0x118
[   33.425508]  __asan_report_load1_noabort+0x20/0x30
[   33.426329]  memchr+0x78/0x88
[   33.426999]  kasan_memchr+0x148/0x2d8
[   33.427707]  kunit_try_run_case+0x14c/0x3d0
[   33.428282]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.428900]  kthread+0x24c/0x2d0
[   33.429849]  ret_from_fork+0x10/0x20
[   33.430592] 
[   33.431097] Allocated by task 243:
[   33.431793]  kasan_save_stack+0x3c/0x68
[   33.432531]  kasan_save_track+0x20/0x40
[   33.433431]  kasan_save_alloc_info+0x40/0x58
[   33.434211]  __kasan_kmalloc+0xd4/0xd8
[   33.434939]  __kmalloc_cache_noprof+0x15c/0x3c0
[   33.435693]  kasan_memchr+0xb0/0x2d8
[   33.436435]  kunit_try_run_case+0x14c/0x3d0
[   33.437233]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.437799]  kthread+0x24c/0x2d0
[   33.438224]  ret_from_fork+0x10/0x20
[   33.438934] 
[   33.439484] The buggy address belongs to the object at fff00000c4081980
[   33.439484]  which belongs to the cache kmalloc-32 of size 32
[   33.440585] The buggy address is located 0 bytes to the right of
[   33.440585]  allocated 24-byte region [fff00000c4081980, fff00000c4081998)
[   33.442514] 
[   33.443021] The buggy address belongs to the physical page:
[   33.443824] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104081
[   33.444884] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   33.445964] page_type: f5(slab)
[   33.446390] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   33.446779] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   33.447181] page dumped because: kasan: bad access detected
[   33.447709] 
[   33.447997] Memory state around the buggy address:
[   33.448517]  fff00000c4081880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   33.449588]  fff00000c4081900: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   33.450396] >fff00000c4081980: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.451091]                             ^
[   33.451693]  fff00000c4081a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.452469]  fff00000c4081a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.453558] ==================================================================

[   24.345818] ==================================================================
[   24.347012] BUG: KASAN: slab-out-of-bounds in memchr+0x79/0x90
[   24.348078] Read of size 1 at addr ffff888101b67018 by task kunit_try_catch/263
[   24.349110] 
[   24.349871] CPU: 1 UID: 0 PID: 263 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   24.351054] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.351732] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.352916] Call Trace:
[   24.353410]  <TASK>
[   24.354193]  dump_stack_lvl+0x73/0xb0
[   24.354778]  print_report+0xd1/0x640
[   24.355235]  ? __virt_addr_valid+0x1db/0x2d0
[   24.355869]  ? kasan_complete_mode_report_info+0x2a/0x200
[   24.356785]  kasan_report+0x102/0x140
[   24.357238]  ? memchr+0x79/0x90
[   24.357609]  ? memchr+0x79/0x90
[   24.358031]  __asan_report_load1_noabort+0x18/0x20
[   24.358967]  memchr+0x79/0x90
[   24.359388]  kasan_memchr+0x163/0x320
[   24.359856]  ? __pfx_kasan_memchr+0x10/0x10
[   24.360510]  ? __schedule+0xc3e/0x2790
[   24.361159]  ? __pfx_read_tsc+0x10/0x10
[   24.361758]  ? ktime_get_ts64+0x84/0x230
[   24.362186]  kunit_try_run_case+0x1b3/0x490
[   24.362789]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.363310]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   24.364042]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.365516]  ? __kthread_parkme+0x82/0x160
[   24.366589]  ? preempt_count_sub+0x50/0x80
[   24.367048]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.367510]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.368414]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.369017]  kthread+0x257/0x310
[   24.369433]  ? __pfx_kthread+0x10/0x10
[   24.369840]  ret_from_fork+0x41/0x80
[   24.370656]  ? __pfx_kthread+0x10/0x10
[   24.370985]  ret_from_fork_asm+0x1a/0x30
[   24.371581]  </TASK>
[   24.371940] 
[   24.372094] Allocated by task 263:
[   24.372732]  kasan_save_stack+0x3d/0x60
[   24.373067]  kasan_save_track+0x18/0x40
[   24.373470]  kasan_save_alloc_info+0x3b/0x50
[   24.374033]  __kasan_kmalloc+0xb7/0xc0
[   24.374852]  __kmalloc_cache_noprof+0x184/0x410
[   24.375246]  kasan_memchr+0xad/0x320
[   24.375743]  kunit_try_run_case+0x1b3/0x490
[   24.376417]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.376831]  kthread+0x257/0x310
[   24.377101]  ret_from_fork+0x41/0x80
[   24.377686]  ret_from_fork_asm+0x1a/0x30
[   24.378456] 
[   24.378680] The buggy address belongs to the object at ffff888101b67000
[   24.378680]  which belongs to the cache kmalloc-32 of size 32
[   24.380185] The buggy address is located 0 bytes to the right of
[   24.380185]  allocated 24-byte region [ffff888101b67000, ffff888101b67018)
[   24.381518] 
[   24.382078] The buggy address belongs to the physical page:
[   24.382764] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101b67
[   24.384583] flags: 0x200000000000000(node=0|zone=2)
[   24.385608] page_type: f5(slab)
[   24.386029] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   24.386894] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   24.387819] page dumped because: kasan: bad access detected
[   24.388783] 
[   24.389323] Memory state around the buggy address:
[   24.389969]  ffff888101b66f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.391286]  ffff888101b66f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.391611] >ffff888101b67000: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.391877]                             ^
[   24.392050]  ffff888101b67080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.393463]  ffff888101b67100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.395044] ==================================================================