2004-02-22  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/linux/i386/posix_fadvise64.S: Pop register
	content also in case of an overflow in the parameter.
	Reported by Momchil Velikov <velco@fadata.bg>.
This commit is contained in:
Ulrich Drepper 2004-02-22 19:37:31 +00:00
parent c91b8752c3
commit a8fd5a02d9
5 changed files with 38 additions and 26 deletions

View File

@ -1,3 +1,9 @@
2004-02-22 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/posix_fadvise64.S: Pop register
content also in case of an overflow in the parameter.
Reported by Momchil Velikov <velco@fadata.bg>.
2004-02-21 Ulrich Drepper <drepper@redhat.com> 2004-02-21 Ulrich Drepper <drepper@redhat.com>
* elf/dynamic-link.h (elf_get_dynamic_info): Recognize DF_1_NOW. * elf/dynamic-link.h (elf_get_dynamic_info): Recognize DF_1_NOW.

View File

@ -1,3 +1,11 @@
2004-02-22 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
(__lll_mutex_lock_wait): Rewrite so that only one locked memory
operation per round is needed.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
(__lll_mutex_lock_wait): Likewise.
2004-02-20 Ulrich Drepper <drepper@redhat.com> 2004-02-20 Ulrich Drepper <drepper@redhat.com>
* tst-cancel9.c (cleanup): Don't print to stderr. * tst-cancel9.c (cleanup): Don't print to stderr.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. /* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@ -50,26 +50,25 @@ __lll_mutex_lock_wait:
xorl %esi, %esi /* No timeout. */ xorl %esi, %esi /* No timeout. */
xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */ xorl %ecx, %ecx /* movl $FUTEX_WAIT, %ecx */
1: cmpl %edx, %eax /* NB: %edx == 2 */ cmpl %edx, %eax /* NB: %edx == 2 */
je 3f je 1f
movl $1, %eax movl %edx, %eax
LOCK xchgl %eax, (%ebx) /* NB: lock is implied */
cmpxchgl %edx, (%ebx)
testl %eax, %eax testl %eax, %eax
je 2f je 2f
3: movl $SYS_futex, %eax 1: movl $SYS_futex, %eax
ENTER_KERNEL ENTER_KERNEL
xorl %eax, %eax movl %edx, %eax
2: LOCK xchgl %eax, (%ebx) /* NB: lock is implied */
cmpxchgl %edx, (%ebx)
testl %eax, %eax
jnz,pn 1b jnz,pn 1b
popl %esi 2: popl %esi
popl %ebx popl %ebx
popl %edx popl %edx
ret ret

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. /* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@ -50,24 +50,25 @@ __lll_mutex_lock_wait:
movl $2, %edx movl $2, %edx
movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */ movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
1: cmpl %edx, %eax /* NB: %edx == 2 */
movl $1, %eax je 1f
LOCK
cmpxchgl %edx, (%rdi) movl %edx, %eax
xchgl %eax, (%rdi) /* NB: lock is implied */
testl %eax, %eax testl %eax, %eax
je 2f je 2f
movq $SYS_futex, %rax 1: movq $SYS_futex, %rax
syscall syscall
xorl %eax, %eax movl %edx, %eax
2: LOCK xchgl %eax, (%rdi) /* NB: lock is implied */
cmpxchgl %edx, (%rdi)
testl %eax, %eax
jnz 1b jnz 1b
popq %rdx 2: popq %rdx
popq %r10 popq %r10
retq retq
.size __lll_mutex_lock_wait,.-__lll_mutex_lock_wait .size __lll_mutex_lock_wait,.-__lll_mutex_lock_wait

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1995,96,97,98,99,2000,2002,2003 Free Software Foundation, Inc. /* Copyright (C) 1995-2000,2002,2003,2004 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -85,6 +85,7 @@ ENTRY (BP_SYM (__posix_fadvise64_l64))
/* Overflow check. */ /* Overflow check. */
cmpl $0, LENHI(%esp) cmpl $0, LENHI(%esp)
movl $-EOVERFLOW, %eax
jne L(overflow) jne L(overflow)
movl FD(%esp), %ebx movl FD(%esp), %ebx
@ -97,6 +98,7 @@ ENTRY (BP_SYM (__posix_fadvise64_l64))
ENTER_KERNEL ENTER_KERNEL
/* Restore registers. */ /* Restore registers. */
L(overflow):
popl %edi popl %edi
popl %esi popl %esi
popl %ebx popl %ebx
@ -106,10 +108,6 @@ ENTRY (BP_SYM (__posix_fadvise64_l64))
/* Successful; return the syscall's value. */ /* Successful; return the syscall's value. */
ret ret
L(overflow):
movl $EOVERFLOW, %eax
ret
#else #else
movl $ENOSYS, %eax movl $ENOSYS, %eax
ret ret