This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[patch] ia64/clone2: make sure child_stack is non-NULL
- From: Mike Frysinger <vapier at gentoo dot org>
- To: libc-alpha at sources dot redhat dot com
- Cc: "H. J. Lu" <hjl at lucon dot org>
- Date: Wed, 22 Feb 2006 20:19:56 -0500
- Subject: [patch] ia64/clone2: make sure child_stack is non-NULL
- Geoman: IS A RETARD
playing with uClibc/ia64 and i noticed that a test case we have for testing
the return value of clone() when given bum arguments was failing ... seems
the clone2() function in ia64 never verifies child_stack like all other
architectures
attached patch adds a check for child_stack alongside the check for
child_fn ... i know squat about ia64 assembly so i'd be surprised if this was
correct :)
-mike
2006-02-22 Mike Frysinger <vapier@gentoo.org>
* sysdeps/unix/sysv/linux/ia64/clone2.S (__clone2): Make sure the child
stack is not NULL.
--- sysdeps/unix/sysv/linux/ia64/clone2.S
+++ sysdeps/unix/sysv/linux/ia64/clone2.S
@@ -32,10 +32,12 @@ ENTRY(__clone2)
.prologue
alloc r2=ar.pfs,8,1,6,0
cmp.eq p6,p0=0,in0
+ cmp.eq p7,p0=0,in1
mov r8=EINVAL
mov out0=in3 /* Flags are first syscall argument. */
mov out1=in1 /* Stack address. */
-(p6) br.cond.spnt.many __syscall_error
+(p6) br.cond.spnt.many __syscall_error /* no NULL function pointers */
+(p7) br.cond.spnt.many __syscall_error /* no NULL stack pointers */
;;
mov out2=in2 /* Stack size. */
mov out3=in5 /* Parent TID Pointer */