This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

posix_fadvise64 crashes


... because it pushes more than it pops in the EOVERFLOW case.

~velco
2004-02-22  Momchil Velikov  <velco@fadata.bg>

	* sysdeps/unix/sysv/linux/i386/posix_fadvise64.S: Check for
	overflow before saving registers.

--- posix_fadvise64.S.~1.3.~	2003-08-19 11:29:26.000000000 +0300
+++ posix_fadvise64.S	2004-02-22 19:19:35.000000000 +0200
@@ -78,15 +78,15 @@ ENTRY (BP_SYM (__posix_fadvise64_l64))
 
 #if defined __NR_fadvise64 \
     && (!defined __ASSUME_FADVISE64_64_SYSCALL || !defined __NR_fadvise64_64)
-1:	/* Save registers.  */
+1:	/* Overflow check.  */
+	cmpl	$0, LENHI(%esp)
+	jne	L(overflow)
+
+	/* Save registers.  */
 	pushl	%ebx
 	pushl	%esi
 	pushl	%edi
 
-	/* Overflow check.  */
-	cmpl	$0, LENHI(%esp)
-	jne	L(overflow)
-
 	movl	FD(%esp), %ebx
 	movl	OFFLO(%esp), %ecx
 	movl	OFFHI(%esp), %edx

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]