This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
posix_fadvise64 crashes
- From: Momchil Velikov <velco at fadata dot bg>
- To: libc-alpha at sources dot redhat dot com
- Date: 22 Feb 2004 19:48:45 +0200
- Subject: 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