Hay
Date
Dec. 5, 2024, 2:07 p.m.

Environment
qemu-x86_64

[   35.143660] ==================================================================
[   35.145033] BUG: KASAN: slab-out-of-bounds in _copy_from_user+0x33/0xa0
[   35.145758] Write of size 121 at addr ffff888101ac8600 by task kunit_try_catch/292
[   35.146363] 
[   35.146652] CPU: 0 UID: 0 PID: 292 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241205 #1
[   35.147474] Tainted: [B]=BAD_PAGE, [N]=TEST
[   35.148051] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   35.149020] Call Trace:
[   35.149299]  <TASK>
[   35.149954]  dump_stack_lvl+0x73/0xb0
[   35.150258]  print_report+0xd1/0x640
[   35.150661]  ? __virt_addr_valid+0x1db/0x2d0
[   35.151281]  ? kasan_complete_mode_report_info+0x2a/0x200
[   35.152260]  kasan_report+0x102/0x140
[   35.153210]  ? _copy_from_user+0x33/0xa0
[   35.153781]  ? _copy_from_user+0x33/0xa0
[   35.154213]  kasan_check_range+0x10c/0x1c0
[   35.154619]  __kasan_check_write+0x18/0x20
[   35.155822]  _copy_from_user+0x33/0xa0
[   35.156228]  copy_user_test_oob+0x2bf/0x10f0
[   35.156933]  ? __pfx_copy_user_test_oob+0x10/0x10
[   35.157601]  ? finish_task_switch.isra.0+0x153/0x700
[   35.158300]  ? __switch_to+0x5d9/0xf60
[   35.158935]  ? irqentry_exit+0x2a/0x60
[   35.159453]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   35.160476]  ? trace_hardirqs_on+0x37/0xe0
[   35.161096]  ? __pfx_read_tsc+0x10/0x10
[   35.161541]  ? ktime_get_ts64+0x86/0x230
[   35.162787]  kunit_try_run_case+0x1b3/0x490
[   35.163276]  ? __pfx_kunit_try_run_case+0x10/0x10
[   35.164253]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   35.164708]  ? __kthread_parkme+0x82/0x160
[   35.165568]  ? preempt_count_sub+0x50/0x80
[   35.166073]  ? __pfx_kunit_try_run_case+0x10/0x10
[   35.166630]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   35.167438]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   35.168229]  kthread+0x257/0x310
[   35.168492]  ? __pfx_kthread+0x10/0x10
[   35.169046]  ret_from_fork+0x41/0x80
[   35.169363]  ? __pfx_kthread+0x10/0x10
[   35.169875]  ret_from_fork_asm+0x1a/0x30
[   35.170244]  </TASK>
[   35.170649] 
[   35.171144] Allocated by task 292:
[   35.171413]  kasan_save_stack+0x3d/0x60
[   35.171624]  kasan_save_track+0x18/0x40
[   35.171945]  kasan_save_alloc_info+0x3b/0x50
[   35.172288]  __kasan_kmalloc+0xb7/0xc0
[   35.173369]  __kmalloc_noprof+0x1c4/0x500
[   35.174084]  kunit_kmalloc_array+0x25/0x60
[   35.174461]  copy_user_test_oob+0xac/0x10f0
[   35.174823]  kunit_try_run_case+0x1b3/0x490
[   35.175263]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   35.175830]  kthread+0x257/0x310
[   35.176450]  ret_from_fork+0x41/0x80
[   35.176783]  ret_from_fork_asm+0x1a/0x30
[   35.177328] 
[   35.177556] The buggy address belongs to the object at ffff888101ac8600
[   35.177556]  which belongs to the cache kmalloc-128 of size 128
[   35.179280] The buggy address is located 0 bytes inside of
[   35.179280]  allocated 120-byte region [ffff888101ac8600, ffff888101ac8678)
[   35.180450] 
[   35.180735] The buggy address belongs to the physical page:
[   35.181474] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101ac8
[   35.182914] flags: 0x200000000000000(node=0|zone=2)
[   35.183324] page_type: f5(slab)
[   35.183755] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   35.184445] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   35.185866] page dumped because: kasan: bad access detected
[   35.187073] 
[   35.187425] Memory state around the buggy address:
[   35.188184]  ffff888101ac8500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   35.189069]  ffff888101ac8580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   35.190260] >ffff888101ac8600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   35.191139]                                                                 ^
[   35.191772]  ffff888101ac8680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   35.192584]  ffff888101ac8700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   35.193763] ==================================================================