[klibc] [PATCH 1/2] ia64: Fix invalid memory access in vfork

James Clarke jrtc27 at jrtc27.com
Fri Feb 1 17:35:56 PST 2019


Commit 8418552 ("[klibc] ia64: Fix shared build") missed this use of the
GP register, although the code appears to have been dubious anyway,
assuming the address of errno was the first thing pointed to by GP.
---
 usr/klibc/arch/ia64/vfork.S | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/usr/klibc/arch/ia64/vfork.S b/usr/klibc/arch/ia64/vfork.S
index 7e76a71..e513188 100644
--- a/usr/klibc/arch/ia64/vfork.S
+++ b/usr/klibc/arch/ia64/vfork.S
@@ -26,16 +26,12 @@ vfork:
 	mov	r15=__NR_clone
 	mov	out0=CLONE_VM|CLONE_VFORK|SIGCHLD
 	mov     out1=0
-	;;
 	break 0x100000      // Do the syscall
-	;;
-	addl	r15=0,r1
 	cmp.eq  p7,p6 = -1,r10
 	;;
-	ld8	r14=[r15]
+(p7)	movl r14 = errno
 	;;
 (p7)	st4	[r14]=r8
-	;;
 (p7)	mov	r8=-1
 	br.ret.sptk.many b0
 	.endp vfork
-- 
1.8.5.3



More information about the klibc mailing list