[klibc] [klibc:master] ia64: Fix invalid memory access in vfork

klibc-bot for Jessica Clarke jrtc27 at jrtc27.com
Sat Aug 29 10:57:04 PDT 2020


Commit-ID:  faf48679047c91ac27dbb435d9189d0f0d59cb70
Gitweb:     http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=faf48679047c91ac27dbb435d9189d0f0d59cb70
Author:     Jessica Clarke <jrtc27 at jrtc27.com>
AuthorDate: Sat, 2 Feb 2019 02:29:47 +0100
Committer:  Ben Hutchings <ben at decadent.org.uk>
CommitDate: Sat, 29 Aug 2020 18:53:30 +0100

[klibc] ia64: Fix invalid memory access in vfork

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.

Signed-off-by: Jessica Clarke <jrtc27 at jrtc27.com>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>

---
 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 7e76a714..e513188b 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


More information about the klibc mailing list