Hay
Date
June 18, 2025, 6:43 a.m.

Environment
qemu-arm64
qemu-x86_64

[   24.565063] ==================================================================
[   24.565145] BUG: KASAN: slab-out-of-bounds in strncpy_from_user+0x3c/0x2a0
[   24.565227] Write of size 121 at addr fff00000c641b000 by task kunit_try_catch/295
[   24.565289] 
[   24.565328] CPU: 0 UID: 0 PID: 295 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc2-next-20250618 #1 PREEMPT 
[   24.565432] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   24.565469] Hardware name: linux,dummy-virt (DT)
[   24.565507] Call trace:
[   24.565538]  show_stack+0x20/0x38 (C)
[   24.565599]  dump_stack_lvl+0x8c/0xd0
[   24.565657]  print_report+0x118/0x608
[   24.565713]  kasan_report+0xdc/0x128
[   24.565769]  kasan_check_range+0x100/0x1a8
[   24.565826]  __kasan_check_write+0x20/0x30
[   24.565884]  strncpy_from_user+0x3c/0x2a0
[   24.565942]  copy_user_test_oob+0x5c0/0xec8
[   24.565996]  kunit_try_run_case+0x170/0x3f0
[   24.567635]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.567733]  kthread+0x328/0x630
[   24.567790]  ret_from_fork+0x10/0x20
[   24.567880] 
[   24.567908] Allocated by task 295:
[   24.567945]  kasan_save_stack+0x3c/0x68
[   24.567998]  kasan_save_track+0x20/0x40
[   24.568060]  kasan_save_alloc_info+0x40/0x58
[   24.568108]  __kasan_kmalloc+0xd4/0xd8
[   24.568153]  __kmalloc_noprof+0x198/0x4c8
[   24.568231]  kunit_kmalloc_array+0x34/0x88
[   24.568317]  copy_user_test_oob+0xac/0xec8
[   24.568368]  kunit_try_run_case+0x170/0x3f0
[   24.568471]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.568526]  kthread+0x328/0x630
[   24.568584]  ret_from_fork+0x10/0x20
[   24.568630] 
[   24.568656] The buggy address belongs to the object at fff00000c641b000
[   24.568656]  which belongs to the cache kmalloc-128 of size 128
[   24.568726] The buggy address is located 0 bytes inside of
[   24.568726]  allocated 120-byte region [fff00000c641b000, fff00000c641b078)
[   24.568801] 
[   24.568826] The buggy address belongs to the physical page:
[   24.568903] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10641b
[   24.569011] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   24.569083] page_type: f5(slab)
[   24.569165] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   24.569229] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   24.569278] page dumped because: kasan: bad access detected
[   24.569317] 
[   24.569340] Memory state around the buggy address:
[   24.569377]  fff00000c641af00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   24.569427]  fff00000c641af80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   24.569478] >fff00000c641b000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   24.569521]                                                                 ^
[   24.569567]  fff00000c641b080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.569616]  fff00000c641b100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.569660] ==================================================================
[   24.570103] ==================================================================
[   24.570179] BUG: KASAN: slab-out-of-bounds in strncpy_from_user+0x270/0x2a0
[   24.570250] Write of size 1 at addr fff00000c641b078 by task kunit_try_catch/295
[   24.570346] 
[   24.570400] CPU: 0 UID: 0 PID: 295 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc2-next-20250618 #1 PREEMPT 
[   24.570503] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   24.570541] Hardware name: linux,dummy-virt (DT)
[   24.570580] Call trace:
[   24.570609]  show_stack+0x20/0x38 (C)
[   24.570666]  dump_stack_lvl+0x8c/0xd0
[   24.570721]  print_report+0x118/0x608
[   24.570775]  kasan_report+0xdc/0x128
[   24.570832]  __asan_report_store1_noabort+0x20/0x30
[   24.570913]  strncpy_from_user+0x270/0x2a0
[   24.570987]  copy_user_test_oob+0x5c0/0xec8
[   24.571093]  kunit_try_run_case+0x170/0x3f0
[   24.571209]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.571278]  kthread+0x328/0x630
[   24.571330]  ret_from_fork+0x10/0x20
[   24.571399] 
[   24.571427] Allocated by task 295:
[   24.571464]  kasan_save_stack+0x3c/0x68
[   24.571563]  kasan_save_track+0x20/0x40
[   24.571630]  kasan_save_alloc_info+0x40/0x58
[   24.571681]  __kasan_kmalloc+0xd4/0xd8
[   24.571726]  __kmalloc_noprof+0x198/0x4c8
[   24.571771]  kunit_kmalloc_array+0x34/0x88
[   24.571817]  copy_user_test_oob+0xac/0xec8
[   24.571861]  kunit_try_run_case+0x170/0x3f0
[   24.571906]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.571958]  kthread+0x328/0x630
[   24.572015]  ret_from_fork+0x10/0x20
[   24.572126] 
[   24.572180] The buggy address belongs to the object at fff00000c641b000
[   24.572180]  which belongs to the cache kmalloc-128 of size 128
[   24.572274] The buggy address is located 0 bytes to the right of
[   24.572274]  allocated 120-byte region [fff00000c641b000, fff00000c641b078)
[   24.572387] 
[   24.572414] The buggy address belongs to the physical page:
[   24.572451] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10641b
[   24.572547] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   24.572620] page_type: f5(slab)
[   24.572682] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   24.572770] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   24.572864] page dumped because: kasan: bad access detected
[   24.572940] 
[   24.572963] Memory state around the buggy address:
[   24.573002]  fff00000c641af00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   24.573065]  fff00000c641af80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   24.573138] >fff00000c641b000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   24.573182]                                                                 ^
[   24.573229]  fff00000c641b080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.573279]  fff00000c641b100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.573323] ==================================================================

[   15.123927] ==================================================================
[   15.124278] BUG: KASAN: slab-out-of-bounds in strncpy_from_user+0x1a5/0x1d0
[   15.124835] Write of size 1 at addr ffff888101addf78 by task kunit_try_catch/311
[   15.125125] 
[   15.125226] CPU: 0 UID: 0 PID: 311 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250618 #1 PREEMPT(voluntary) 
[   15.125273] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.125286] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   15.125308] Call Trace:
[   15.125322]  <TASK>
[   15.125337]  dump_stack_lvl+0x73/0xb0
[   15.125363]  print_report+0xd1/0x650
[   15.125385]  ? __virt_addr_valid+0x1db/0x2d0
[   15.125407]  ? strncpy_from_user+0x1a5/0x1d0
[   15.125431]  ? kasan_complete_mode_report_info+0x2a/0x200
[   15.125458]  ? strncpy_from_user+0x1a5/0x1d0
[   15.125481]  kasan_report+0x141/0x180
[   15.125503]  ? strncpy_from_user+0x1a5/0x1d0
[   15.125531]  __asan_report_store1_noabort+0x1b/0x30
[   15.125556]  strncpy_from_user+0x1a5/0x1d0
[   15.125581]  copy_user_test_oob+0x760/0x10f0
[   15.125606]  ? __pfx_copy_user_test_oob+0x10/0x10
[   15.125628]  ? finish_task_switch.isra.0+0x153/0x700
[   15.125650]  ? __switch_to+0x47/0xf50
[   15.125674]  ? __schedule+0x10cc/0x2b60
[   15.125694]  ? __pfx_read_tsc+0x10/0x10
[   15.125715]  ? ktime_get_ts64+0x86/0x230
[   15.125740]  kunit_try_run_case+0x1a5/0x480
[   15.125765]  ? __pfx_kunit_try_run_case+0x10/0x10
[   15.125787]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   15.125810]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   15.125833]  ? __kthread_parkme+0x82/0x180
[   15.125853]  ? preempt_count_sub+0x50/0x80
[   15.125875]  ? __pfx_kunit_try_run_case+0x10/0x10
[   15.125898]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   15.125921]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   15.125945]  kthread+0x337/0x6f0
[   15.125964]  ? trace_preempt_on+0x20/0xc0
[   15.125986]  ? __pfx_kthread+0x10/0x10
[   15.126007]  ? _raw_spin_unlock_irq+0x47/0x80
[   15.126028]  ? calculate_sigpending+0x7b/0xa0
[   15.126051]  ? __pfx_kthread+0x10/0x10
[   15.126073]  ret_from_fork+0x116/0x1d0
[   15.126091]  ? __pfx_kthread+0x10/0x10
[   15.126112]  ret_from_fork_asm+0x1a/0x30
[   15.126141]  </TASK>
[   15.126153] 
[   15.133016] Allocated by task 311:
[   15.133199]  kasan_save_stack+0x45/0x70
[   15.133404]  kasan_save_track+0x18/0x40
[   15.133567]  kasan_save_alloc_info+0x3b/0x50
[   15.133769]  __kasan_kmalloc+0xb7/0xc0
[   15.133942]  __kmalloc_noprof+0x1c9/0x500
[   15.134100]  kunit_kmalloc_array+0x25/0x60
[   15.134322]  copy_user_test_oob+0xab/0x10f0
[   15.134504]  kunit_try_run_case+0x1a5/0x480
[   15.134642]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   15.134885]  kthread+0x337/0x6f0
[   15.135045]  ret_from_fork+0x116/0x1d0
[   15.135214]  ret_from_fork_asm+0x1a/0x30
[   15.135396] 
[   15.135491] The buggy address belongs to the object at ffff888101addf00
[   15.135491]  which belongs to the cache kmalloc-128 of size 128
[   15.135934] The buggy address is located 0 bytes to the right of
[   15.135934]  allocated 120-byte region [ffff888101addf00, ffff888101addf78)
[   15.136565] 
[   15.136633] The buggy address belongs to the physical page:
[   15.136854] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101add
[   15.137086] flags: 0x200000000000000(node=0|zone=2)
[   15.137250] page_type: f5(slab)
[   15.137364] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   15.137589] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   15.137816] page dumped because: kasan: bad access detected
[   15.138055] 
[   15.138139] Memory state around the buggy address:
[   15.138360]  ffff888101adde00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   15.138665]  ffff888101adde80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.138968] >ffff888101addf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   15.139418]                                                                 ^
[   15.139665]  ffff888101addf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.139875]  ffff888101ade000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   15.140082] ==================================================================
[   15.106567] ==================================================================
[   15.106823] BUG: KASAN: slab-out-of-bounds in strncpy_from_user+0x2e/0x1d0
[   15.107409] Write of size 121 at addr ffff888101addf00 by task kunit_try_catch/311
[   15.107788] 
[   15.107886] CPU: 0 UID: 0 PID: 311 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250618 #1 PREEMPT(voluntary) 
[   15.107947] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.107960] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   15.107982] Call Trace:
[   15.107999]  <TASK>
[   15.108015]  dump_stack_lvl+0x73/0xb0
[   15.108041]  print_report+0xd1/0x650
[   15.108063]  ? __virt_addr_valid+0x1db/0x2d0
[   15.108086]  ? strncpy_from_user+0x2e/0x1d0
[   15.108111]  ? kasan_complete_mode_report_info+0x2a/0x200
[   15.108138]  ? strncpy_from_user+0x2e/0x1d0
[   15.108161]  kasan_report+0x141/0x180
[   15.108183]  ? strncpy_from_user+0x2e/0x1d0
[   15.108222]  kasan_check_range+0x10c/0x1c0
[   15.108245]  __kasan_check_write+0x18/0x20
[   15.108268]  strncpy_from_user+0x2e/0x1d0
[   15.108294]  copy_user_test_oob+0x760/0x10f0
[   15.108319]  ? __pfx_copy_user_test_oob+0x10/0x10
[   15.108341]  ? finish_task_switch.isra.0+0x153/0x700
[   15.108363]  ? __switch_to+0x47/0xf50
[   15.108389]  ? __schedule+0x10cc/0x2b60
[   15.108410]  ? __pfx_read_tsc+0x10/0x10
[   15.108430]  ? ktime_get_ts64+0x86/0x230
[   15.108455]  kunit_try_run_case+0x1a5/0x480
[   15.108478]  ? __pfx_kunit_try_run_case+0x10/0x10
[   15.108500]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   15.108523]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   15.108545]  ? __kthread_parkme+0x82/0x180
[   15.108565]  ? preempt_count_sub+0x50/0x80
[   15.108588]  ? __pfx_kunit_try_run_case+0x10/0x10
[   15.108611]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   15.108634]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   15.108660]  kthread+0x337/0x6f0
[   15.108680]  ? trace_preempt_on+0x20/0xc0
[   15.108703]  ? __pfx_kthread+0x10/0x10
[   15.108724]  ? _raw_spin_unlock_irq+0x47/0x80
[   15.108744]  ? calculate_sigpending+0x7b/0xa0
[   15.108768]  ? __pfx_kthread+0x10/0x10
[   15.108789]  ret_from_fork+0x116/0x1d0
[   15.108808]  ? __pfx_kthread+0x10/0x10
[   15.108829]  ret_from_fork_asm+0x1a/0x30
[   15.108858]  </TASK>
[   15.108870] 
[   15.115837] Allocated by task 311:
[   15.116103]  kasan_save_stack+0x45/0x70
[   15.116456]  kasan_save_track+0x18/0x40
[   15.116635]  kasan_save_alloc_info+0x3b/0x50
[   15.116782]  __kasan_kmalloc+0xb7/0xc0
[   15.116908]  __kmalloc_noprof+0x1c9/0x500
[   15.117041]  kunit_kmalloc_array+0x25/0x60
[   15.117232]  copy_user_test_oob+0xab/0x10f0
[   15.117434]  kunit_try_run_case+0x1a5/0x480
[   15.117636]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   15.117879]  kthread+0x337/0x6f0
[   15.118041]  ret_from_fork+0x116/0x1d0
[   15.118198]  ret_from_fork_asm+0x1a/0x30
[   15.118410] 
[   15.118484] The buggy address belongs to the object at ffff888101addf00
[   15.118484]  which belongs to the cache kmalloc-128 of size 128
[   15.118952] The buggy address is located 0 bytes inside of
[   15.118952]  allocated 120-byte region [ffff888101addf00, ffff888101addf78)
[   15.119409] 
[   15.119541] The buggy address belongs to the physical page:
[   15.119746] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101add
[   15.119980] flags: 0x200000000000000(node=0|zone=2)
[   15.120136] page_type: f5(slab)
[   15.120260] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   15.120545] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   15.120870] page dumped because: kasan: bad access detected
[   15.121110] 
[   15.121195] Memory state around the buggy address:
[   15.121563]  ffff888101adde00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   15.121855]  ffff888101adde80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.122066] >ffff888101addf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   15.122542]                                                                 ^
[   15.122848]  ffff888101addf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.123118]  ffff888101ade000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   15.123439] ==================================================================