-/* $OpenBSD: copy.S,v 1.3 2021/05/15 00:04:32 drahn Exp $ */
+/* $OpenBSD: copy.S,v 1.4 2021/05/15 20:14:05 deraadt Exp $ */
/*
* Copyright (c) 2020 Brian Bamsch <bbamsch@google.com>
bltu a3, a0, .Lcopyiofault_nopcb
/* Check that source+len is in userspace. */
li a4, VM_MAXUSER_ADDRESS
- bgt a3, a4, .Lcopyiofault_nopcb
+ bgtu a3, a4, .Lcopyiofault_nopcb
la a3, .Lcopyiofault_user
SWAP_FAULT_HANDLER(a3, a4, a5)
bltu a3, a1, .Lcopyiofault_nopcb
/* Check that source+len is in userspace. */
li a4, VM_MAXUSER_ADDRESS
- bgt a3, a4, .Lcopyiofault_nopcb
+ bgtu a3, a4, .Lcopyiofault_nopcb
la a3, .Lcopyiofault_user
SWAP_FAULT_HANDLER(a3, a4, a5)
-/* $OpenBSD: copystr.S,v 1.2 2021/05/12 01:20:52 jsg Exp $ */
+/* $OpenBSD: copystr.S,v 1.3 2021/05/15 20:14:05 deraadt Exp $ */
/*
* Copyright (c) 2015 Dale Rahn <drahn@dalerahn.com>
mv a5, x0
li t1, VM_MAXUSER_ADDRESS
-1: bgt a0, t1, .Lcopyiostrfault_user
+1: bgtu a0, t1, .Lcopyiostrfault_user
lb t0, 0(a0)
addi a0, a0, 1
sb t0, 0(a1)
mv a5, x0
li t1, VM_MAXUSER_ADDRESS
-1: bgt a1, t1, .Lcopyiostrfault_user
+1: bgtu a1, t1, .Lcopyiostrfault_user
lb t0, 0(a0)
addi a0, a0, 1
sb t0, 0(a1)