Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/arch/x86_64 Exploit hidden __cerror
details: https://anonhg.NetBSD.org/src/rev/1e27798d214e
branches: trunk
changeset: 771303:1e27798d214e
user: joerg <joerg%NetBSD.org@localhost>
date: Fri Nov 18 20:43:01 2011 +0000
description:
Exploit hidden __cerror
diffstat:
lib/libc/arch/x86_64/SYS.h | 8 +-------
lib/libc/arch/x86_64/sys/__clone.S | 7 +------
lib/libc/arch/x86_64/sys/__vfork14.S | 9 ++-------
lib/libc/arch/x86_64/sys/brk.S | 7 +++----
lib/libc/arch/x86_64/sys/exect.S | 9 ++-------
lib/libc/arch/x86_64/sys/ptrace.S | 9 ++-------
lib/libc/arch/x86_64/sys/sbrk.S | 7 +++----
7 files changed, 14 insertions(+), 42 deletions(-)
diffs (186 lines):
diff -r b38122264ad5 -r 1e27798d214e lib/libc/arch/x86_64/SYS.h
--- a/lib/libc/arch/x86_64/SYS.h Fri Nov 18 20:39:18 2011 +0000
+++ b/lib/libc/arch/x86_64/SYS.h Fri Nov 18 20:43:01 2011 +0000
@@ -30,7 +30,7 @@
* SUCH DAMAGE.
*
* from: @(#)SYS.h 5.5 (Berkeley) 5/7/91
- * $NetBSD: SYS.h,v 1.10 2007/11/23 07:36:05 dsl Exp $
+ * $NetBSD: SYS.h,v 1.11 2011/11/18 20:43:01 joerg Exp $
*/
#include <machine/asm.h>
@@ -49,14 +49,8 @@
ENTRY(x); \
SYSTRAP(y)
-#ifdef PIC
#define _SYSCALL_ERR \
- mov PIC_GOT(CERROR), %rcx; \
- jmp *%rcx
-#else
-#define _SYSCALL_ERR \
jmp CERROR
-#endif
#define _SYSCALL(x,y) \
.text; _ALIGN_TEXT; \
diff -r b38122264ad5 -r 1e27798d214e lib/libc/arch/x86_64/sys/__clone.S
--- a/lib/libc/arch/x86_64/sys/__clone.S Fri Nov 18 20:39:18 2011 +0000
+++ b/lib/libc/arch/x86_64/sys/__clone.S Fri Nov 18 20:43:01 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: __clone.S,v 1.2 2002/06/06 20:51:17 fvdl Exp $ */
+/* $NetBSD: __clone.S,v 1.3 2011/11/18 20:43:01 joerg Exp $ */
/*
* Copyright (c) 2002 Wasabi Systems, Inc.
@@ -93,9 +93,4 @@
5:
popq %r13
popq %r12
-#ifdef PIC
- movq PIC_GOT(CERROR),%rdx
- jmp *%rdx
-#else
jmp CERROR
-#endif
diff -r b38122264ad5 -r 1e27798d214e lib/libc/arch/x86_64/sys/__vfork14.S
--- a/lib/libc/arch/x86_64/sys/__vfork14.S Fri Nov 18 20:39:18 2011 +0000
+++ b/lib/libc/arch/x86_64/sys/__vfork14.S Fri Nov 18 20:43:01 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: __vfork14.S,v 1.3 2003/08/07 16:42:37 agc Exp $ */
+/* $NetBSD: __vfork14.S,v 1.4 2011/11/18 20:43:01 joerg Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
- RCSID("$NetBSD: __vfork14.S,v 1.3 2003/08/07 16:42:37 agc Exp $")
+ RCSID("$NetBSD: __vfork14.S,v 1.4 2011/11/18 20:43:01 joerg Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
@@ -57,9 +57,4 @@
jmp *%r9
err:
pushq %r9
-#ifdef PIC
- movq PIC_GOT(CERROR), %rcx
- jmp *%rcx
-#else
jmp CERROR
-#endif
diff -r b38122264ad5 -r 1e27798d214e lib/libc/arch/x86_64/sys/brk.S
--- a/lib/libc/arch/x86_64/sys/brk.S Fri Nov 18 20:39:18 2011 +0000
+++ b/lib/libc/arch/x86_64/sys/brk.S Fri Nov 18 20:43:01 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: brk.S,v 1.3 2003/08/07 16:42:37 agc Exp $ */
+/* $NetBSD: brk.S,v 1.4 2011/11/18 20:43:01 joerg Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
- RCSID("$NetBSD: brk.S,v 1.3 2003/08/07 16:42:37 agc Exp $")
+ RCSID("$NetBSD: brk.S,v 1.4 2011/11/18 20:43:01 joerg Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
@@ -68,8 +68,7 @@
xorl %eax,%eax
ret
err:
- movq PIC_GOT(CERROR),%rdx
- jmp *%rdx
+ jmp CERROR
#else
cmpq %rdi,_C_LABEL(__minbrk)(%rip)
jb 1f
diff -r b38122264ad5 -r 1e27798d214e lib/libc/arch/x86_64/sys/exect.S
--- a/lib/libc/arch/x86_64/sys/exect.S Fri Nov 18 20:39:18 2011 +0000
+++ b/lib/libc/arch/x86_64/sys/exect.S Fri Nov 18 20:43:01 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exect.S,v 1.2 2003/08/07 16:42:37 agc Exp $ */
+/* $NetBSD: exect.S,v 1.3 2011/11/18 20:43:01 joerg Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
- RCSID("$NetBSD: exect.S,v 1.2 2003/08/07 16:42:37 agc Exp $")
+ RCSID("$NetBSD: exect.S,v 1.3 2011/11/18 20:43:01 joerg Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
@@ -47,9 +47,4 @@
orb $(PSL_T>>8),1(%rsp)
popfq
SYSTRAP(execve)
-#ifdef PIC
- movq PIC_GOT(CERROR), %rcx
- jmp *%rcx
-#else
jmp CERROR
-#endif
diff -r b38122264ad5 -r 1e27798d214e lib/libc/arch/x86_64/sys/ptrace.S
--- a/lib/libc/arch/x86_64/sys/ptrace.S Fri Nov 18 20:39:18 2011 +0000
+++ b/lib/libc/arch/x86_64/sys/ptrace.S Fri Nov 18 20:43:01 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.S,v 1.2 2003/08/07 16:42:37 agc Exp $ */
+/* $NetBSD: ptrace.S,v 1.3 2011/11/18 20:43:01 joerg Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
- RCSID("$NetBSD: ptrace.S,v 1.2 2003/08/07 16:42:37 agc Exp $")
+ RCSID("$NetBSD: ptrace.S,v 1.3 2011/11/18 20:43:01 joerg Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
@@ -54,9 +54,4 @@
jc err
ret
err:
-#ifdef PIC
- movq PIC_GOT(CERROR), %rcx
- jmp *%rcx
-#else
jmp CERROR
-#endif
diff -r b38122264ad5 -r 1e27798d214e lib/libc/arch/x86_64/sys/sbrk.S
--- a/lib/libc/arch/x86_64/sys/sbrk.S Fri Nov 18 20:39:18 2011 +0000
+++ b/lib/libc/arch/x86_64/sys/sbrk.S Fri Nov 18 20:43:01 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sbrk.S,v 1.3 2008/07/02 20:07:43 rmind Exp $ */
+/* $NetBSD: sbrk.S,v 1.4 2011/11/18 20:43:01 joerg Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
#include <machine/asm.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
- RCSID("$NetBSD: sbrk.S,v 1.3 2008/07/02 20:07:43 rmind Exp $")
+ RCSID("$NetBSD: sbrk.S,v 1.4 2011/11/18 20:43:01 joerg Exp $")
#endif /* SYSLIBC_SCCS and not lint */
#include "SYS.h"
@@ -67,8 +67,7 @@
out:
ret
err:
- mov PIC_GOT(CERROR),%rdx
- jmp *%rdx
+ jmp CERROR
#else
movq CURBRK(%rip),%rax
test %rdi,%rdi
Home |
Main Index |
Thread Index |
Old Index