Hay
Date
June 3, 2025, 7:38 a.m.

Environment
qemu-arm64
qemu-x86_64

[   21.623161] ==================================================================
[   21.623557] BUG: KASAN: slab-out-of-bounds in strncpy_from_user+0x270/0x2a0
[   21.623721] Write of size 1 at addr fff00000c58a9678 by task kunit_try_catch/285
[   21.623834] 
[   21.623870] CPU: 1 UID: 0 PID: 285 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250603 #1 PREEMPT 
[   21.623960] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.624405] Hardware name: linux,dummy-virt (DT)
[   21.624477] Call trace:
[   21.624655]  show_stack+0x20/0x38 (C)
[   21.624903]  dump_stack_lvl+0x8c/0xd0
[   21.625175]  print_report+0x118/0x608
[   21.625365]  kasan_report+0xdc/0x128
[   21.625589]  __asan_report_store1_noabort+0x20/0x30
[   21.625800]  strncpy_from_user+0x270/0x2a0
[   21.626018]  copy_user_test_oob+0x5c0/0xec8
[   21.626192]  kunit_try_run_case+0x170/0x3f0
[   21.626457]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.626888]  kthread+0x328/0x630
[   21.627093]  ret_from_fork+0x10/0x20
[   21.627151] 
[   21.627172] Allocated by task 285:
[   21.627203]  kasan_save_stack+0x3c/0x68
[   21.627339]  kasan_save_track+0x20/0x40
[   21.627405]  kasan_save_alloc_info+0x40/0x58
[   21.627869]  __kasan_kmalloc+0xd4/0xd8
[   21.628024]  __kmalloc_noprof+0x198/0x4c8
[   21.628146]  kunit_kmalloc_array+0x34/0x88
[   21.628381]  copy_user_test_oob+0xac/0xec8
[   21.628444]  kunit_try_run_case+0x170/0x3f0
[   21.628487]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.628602]  kthread+0x328/0x630
[   21.628855]  ret_from_fork+0x10/0x20
[   21.629163] 
[   21.629291] The buggy address belongs to the object at fff00000c58a9600
[   21.629291]  which belongs to the cache kmalloc-128 of size 128
[   21.629763] The buggy address is located 0 bytes to the right of
[   21.629763]  allocated 120-byte region [fff00000c58a9600, fff00000c58a9678)
[   21.629951] 
[   21.630135] The buggy address belongs to the physical page:
[   21.630277] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1058a9
[   21.630539] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   21.630660] page_type: f5(slab)
[   21.630806] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   21.630885] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   21.631015] page dumped because: kasan: bad access detected
[   21.631063] 
[   21.631116] Memory state around the buggy address:
[   21.631171]  fff00000c58a9500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   21.631217]  fff00000c58a9580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.631262] >fff00000c58a9600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   21.631304]                                                                 ^
[   21.631363]  fff00000c58a9680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.632058]  fff00000c58a9700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.632139] ==================================================================
[   21.612095] ==================================================================
[   21.612158] BUG: KASAN: slab-out-of-bounds in strncpy_from_user+0x3c/0x2a0
[   21.612646] Write of size 121 at addr fff00000c58a9600 by task kunit_try_catch/285
[   21.612759] 
[   21.613128] CPU: 1 UID: 0 PID: 285 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250603 #1 PREEMPT 
[   21.613529] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.613677] Hardware name: linux,dummy-virt (DT)
[   21.613720] Call trace:
[   21.613771]  show_stack+0x20/0x38 (C)
[   21.614006]  dump_stack_lvl+0x8c/0xd0
[   21.614258]  print_report+0x118/0x608
[   21.614329]  kasan_report+0xdc/0x128
[   21.614541]  kasan_check_range+0x100/0x1a8
[   21.614661]  __kasan_check_write+0x20/0x30
[   21.614722]  strncpy_from_user+0x3c/0x2a0
[   21.615129]  copy_user_test_oob+0x5c0/0xec8
[   21.615244]  kunit_try_run_case+0x170/0x3f0
[   21.615438]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.615502]  kthread+0x328/0x630
[   21.615554]  ret_from_fork+0x10/0x20
[   21.615834] 
[   21.615868] Allocated by task 285:
[   21.615903]  kasan_save_stack+0x3c/0x68
[   21.615949]  kasan_save_track+0x20/0x40
[   21.616004]  kasan_save_alloc_info+0x40/0x58
[   21.616044]  __kasan_kmalloc+0xd4/0xd8
[   21.616081]  __kmalloc_noprof+0x198/0x4c8
[   21.616130]  kunit_kmalloc_array+0x34/0x88
[   21.616167]  copy_user_test_oob+0xac/0xec8
[   21.616220]  kunit_try_run_case+0x170/0x3f0
[   21.616274]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.616321]  kthread+0x328/0x630
[   21.616364]  ret_from_fork+0x10/0x20
[   21.616416] 
[   21.616567] The buggy address belongs to the object at fff00000c58a9600
[   21.616567]  which belongs to the cache kmalloc-128 of size 128
[   21.617207] The buggy address is located 0 bytes inside of
[   21.617207]  allocated 120-byte region [fff00000c58a9600, fff00000c58a9678)
[   21.617420] 
[   21.617683] The buggy address belongs to the physical page:
[   21.618032] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1058a9
[   21.618221] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   21.618616] page_type: f5(slab)
[   21.618828] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   21.619081] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   21.619161] page dumped because: kasan: bad access detected
[   21.619498] 
[   21.619688] Memory state around the buggy address:
[   21.619986]  fff00000c58a9500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   21.620078]  fff00000c58a9580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.620134] >fff00000c58a9600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   21.620374]                                                                 ^
[   21.620739]  fff00000c58a9680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.620894]  fff00000c58a9700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.621540] ==================================================================


[   19.921394] ==================================================================
[   19.921718] BUG: KASAN: slab-out-of-bounds in strncpy_from_user+0x2e/0x1d0
[   19.921906] Write of size 121 at addr ffff888103341c00 by task kunit_try_catch/302
[   19.922520] 
[   19.922741] CPU: 1 UID: 0 PID: 302 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250603 #1 PREEMPT(voluntary) 
[   19.923072] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.923109] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   19.923138] Call Trace:
[   19.923167]  <TASK>
[   19.923218]  dump_stack_lvl+0x73/0xb0
[   19.923272]  print_report+0xd1/0x650
[   19.923302]  ? __virt_addr_valid+0x1db/0x2d0
[   19.923331]  ? strncpy_from_user+0x2e/0x1d0
[   19.923405]  ? kasan_complete_mode_report_info+0x2a/0x200
[   19.923439]  ? strncpy_from_user+0x2e/0x1d0
[   19.923478]  kasan_report+0x141/0x180
[   19.923555]  ? strncpy_from_user+0x2e/0x1d0
[   19.923624]  kasan_check_range+0x10c/0x1c0
[   19.923666]  __kasan_check_write+0x18/0x20
[   19.923710]  strncpy_from_user+0x2e/0x1d0
[   19.923738]  ? __kasan_check_read+0x15/0x20
[   19.923764]  copy_user_test_oob+0x760/0x10f0
[   19.923795]  ? __pfx_copy_user_test_oob+0x10/0x10
[   19.923823]  ? finish_task_switch.isra.0+0x153/0x700
[   19.923854]  ? __switch_to+0x47/0xf50
[   19.923886]  ? __schedule+0x10cc/0x2b60
[   19.923916]  ? __pfx_read_tsc+0x10/0x10
[   19.923944]  ? ktime_get_ts64+0x86/0x230
[   19.923973]  kunit_try_run_case+0x1a5/0x480
[   19.924001]  ? __pfx_kunit_try_run_case+0x10/0x10
[   19.924026]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   19.924055]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   19.924083]  ? __kthread_parkme+0x82/0x180
[   19.924108]  ? preempt_count_sub+0x50/0x80
[   19.924137]  ? __pfx_kunit_try_run_case+0x10/0x10
[   19.924165]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.924211]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   19.924247]  kthread+0x337/0x6f0
[   19.924275]  ? trace_preempt_on+0x20/0xc0
[   19.924304]  ? __pfx_kthread+0x10/0x10
[   19.924330]  ? _raw_spin_unlock_irq+0x47/0x80
[   19.924359]  ? calculate_sigpending+0x7b/0xa0
[   19.924391]  ? __pfx_kthread+0x10/0x10
[   19.924525]  ret_from_fork+0x116/0x1d0
[   19.924554]  ? __pfx_kthread+0x10/0x10
[   19.924578]  ret_from_fork_asm+0x1a/0x30
[   19.924615]  </TASK>
[   19.924630] 
[   19.936363] Allocated by task 302:
[   19.936734]  kasan_save_stack+0x45/0x70
[   19.936878]  kasan_save_track+0x18/0x40
[   19.937158]  kasan_save_alloc_info+0x3b/0x50
[   19.937504]  __kasan_kmalloc+0xb7/0xc0
[   19.937604]  __kmalloc_noprof+0x1c9/0x500
[   19.937907]  kunit_kmalloc_array+0x25/0x60
[   19.938030]  copy_user_test_oob+0xab/0x10f0
[   19.938331]  kunit_try_run_case+0x1a5/0x480
[   19.938487]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.938708]  kthread+0x337/0x6f0
[   19.938921]  ret_from_fork+0x116/0x1d0
[   19.939032]  ret_from_fork_asm+0x1a/0x30
[   19.939179] 
[   19.939504] The buggy address belongs to the object at ffff888103341c00
[   19.939504]  which belongs to the cache kmalloc-128 of size 128
[   19.940039] The buggy address is located 0 bytes inside of
[   19.940039]  allocated 120-byte region [ffff888103341c00, ffff888103341c78)
[   19.940265] 
[   19.940400] The buggy address belongs to the physical page:
[   19.940770] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103341
[   19.941352] flags: 0x200000000000000(node=0|zone=2)
[   19.941756] page_type: f5(slab)
[   19.941906] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   19.942745] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   19.942917] page dumped because: kasan: bad access detected
[   19.943037] 
[   19.943182] Memory state around the buggy address:
[   19.943782]  ffff888103341b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   19.944228]  ffff888103341b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.944634] >ffff888103341c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   19.945115]                                                                 ^
[   19.945466]  ffff888103341c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.945918]  ffff888103341d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.946407] ==================================================================
[   19.947518] ==================================================================
[   19.948309] BUG: KASAN: slab-out-of-bounds in strncpy_from_user+0x1a5/0x1d0
[   19.948544] Write of size 1 at addr ffff888103341c78 by task kunit_try_catch/302
[   19.948712] 
[   19.948885] CPU: 1 UID: 0 PID: 302 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250603 #1 PREEMPT(voluntary) 
[   19.948947] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.948963] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   19.948990] Call Trace:
[   19.949016]  <TASK>
[   19.949043]  dump_stack_lvl+0x73/0xb0
[   19.949075]  print_report+0xd1/0x650
[   19.949105]  ? __virt_addr_valid+0x1db/0x2d0
[   19.949132]  ? strncpy_from_user+0x1a5/0x1d0
[   19.949156]  ? kasan_complete_mode_report_info+0x2a/0x200
[   19.949182]  ? strncpy_from_user+0x1a5/0x1d0
[   19.949207]  kasan_report+0x141/0x180
[   19.949233]  ? strncpy_from_user+0x1a5/0x1d0
[   19.949261]  __asan_report_store1_noabort+0x1b/0x30
[   19.949322]  strncpy_from_user+0x1a5/0x1d0
[   19.949364]  copy_user_test_oob+0x760/0x10f0
[   19.949399]  ? __pfx_copy_user_test_oob+0x10/0x10
[   19.949424]  ? finish_task_switch.isra.0+0x153/0x700
[   19.949451]  ? __switch_to+0x47/0xf50
[   19.949495]  ? __schedule+0x10cc/0x2b60
[   19.949524]  ? __pfx_read_tsc+0x10/0x10
[   19.949550]  ? ktime_get_ts64+0x86/0x230
[   19.949579]  kunit_try_run_case+0x1a5/0x480
[   19.949607]  ? __pfx_kunit_try_run_case+0x10/0x10
[   19.949630]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   19.949659]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   19.949687]  ? __kthread_parkme+0x82/0x180
[   19.949712]  ? preempt_count_sub+0x50/0x80
[   19.949739]  ? __pfx_kunit_try_run_case+0x10/0x10
[   19.949764]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.949794]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   19.949821]  kthread+0x337/0x6f0
[   19.949846]  ? trace_preempt_on+0x20/0xc0
[   19.949873]  ? __pfx_kthread+0x10/0x10
[   19.949897]  ? _raw_spin_unlock_irq+0x47/0x80
[   19.949925]  ? calculate_sigpending+0x7b/0xa0
[   19.949953]  ? __pfx_kthread+0x10/0x10
[   19.949979]  ret_from_fork+0x116/0x1d0
[   19.950001]  ? __pfx_kthread+0x10/0x10
[   19.950028]  ret_from_fork_asm+0x1a/0x30
[   19.950065]  </TASK>
[   19.950080] 
[   19.957166] Allocated by task 302:
[   19.957508]  kasan_save_stack+0x45/0x70
[   19.957796]  kasan_save_track+0x18/0x40
[   19.958032]  kasan_save_alloc_info+0x3b/0x50
[   19.958172]  __kasan_kmalloc+0xb7/0xc0
[   19.958439]  __kmalloc_noprof+0x1c9/0x500
[   19.958590]  kunit_kmalloc_array+0x25/0x60
[   19.958796]  copy_user_test_oob+0xab/0x10f0
[   19.959022]  kunit_try_run_case+0x1a5/0x480
[   19.959293]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.959539]  kthread+0x337/0x6f0
[   19.959734]  ret_from_fork+0x116/0x1d0
[   19.959849]  ret_from_fork_asm+0x1a/0x30
[   19.959963] 
[   19.960111] The buggy address belongs to the object at ffff888103341c00
[   19.960111]  which belongs to the cache kmalloc-128 of size 128
[   19.960524] The buggy address is located 0 bytes to the right of
[   19.960524]  allocated 120-byte region [ffff888103341c00, ffff888103341c78)
[   19.961193] 
[   19.961328] The buggy address belongs to the physical page:
[   19.961554] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103341
[   19.961739] flags: 0x200000000000000(node=0|zone=2)
[   19.961874] page_type: f5(slab)
[   19.961980] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   19.962151] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   19.962314] page dumped because: kasan: bad access detected
[   19.962700] 
[   19.962845] Memory state around the buggy address:
[   19.963359]  ffff888103341b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   19.963875]  ffff888103341b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.964061] >ffff888103341c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   19.964263]                                                                 ^
[   19.964782]  ffff888103341c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.964993]  ffff888103341d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.965418] ==================================================================