summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2012-09-11 15:44:15 +0000
committerderaadt <deraadt@openbsd.org>2012-09-11 15:44:15 +0000
commit2cf794e27eafe5cb030c28554136b425ea5bf780 (patch)
tree7cf026a5ef6c359ae67a6dff806ccae260666d2a
parentremove the session entry from the search tree when it's dead. (diff)
downloadwireguard-openbsd-2cf794e27eafe5cb030c28554136b425ea5bf780.tar.xz
wireguard-openbsd-2cf794e27eafe5cb030c28554136b425ea5bf780.zip
Remove the 'OLF method' used for the transition from a.out to ELF and
for all the compat layers which are now gone. Linux compat still works because it always used another method in any case, and nothing looks at p_os anymore. ok jsing
-rw-r--r--sys/arch/alpha/include/exec.h4
-rw-r--r--sys/arch/amd64/include/exec.h4
-rw-r--r--sys/arch/arm/include/exec.h4
-rw-r--r--sys/arch/hppa/include/exec.h3
-rw-r--r--sys/arch/hppa64/include/exec.h3
-rw-r--r--sys/arch/i386/include/exec.h4
-rw-r--r--sys/arch/ia64/include/exec.h4
-rw-r--r--sys/arch/mips64/include/exec.h3
-rw-r--r--sys/arch/powerpc/include/exec.h5
-rw-r--r--sys/arch/sh/include/exec.h4
-rw-r--r--sys/arch/sparc/include/exec.h4
-rw-r--r--sys/arch/sparc64/include/exec.h3
-rw-r--r--sys/compat/linux/linux_exec.c7
-rw-r--r--sys/compat/linux/linux_exec.h4
-rw-r--r--sys/kern/exec_elf.c28
-rw-r--r--sys/sys/exec_elf.h3
-rw-r--r--sys/sys/exec_olf.h58
-rw-r--r--sys/sys/proc.h4
18 files changed, 27 insertions, 122 deletions
diff --git a/sys/arch/alpha/include/exec.h b/sys/arch/alpha/include/exec.h
index 50a8417410f..cad397b9923 100644
--- a/sys/arch/alpha/include/exec.h
+++ b/sys/arch/alpha/include/exec.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.h,v 1.11 2011/03/23 16:54:34 pirofti Exp $ */
+/* $OpenBSD: exec.h,v 1.12 2012/09/11 15:44:15 deraadt Exp $ */
/* $NetBSD: exec.h,v 1.1 1995/02/13 23:07:37 cgd Exp $ */
/*
@@ -36,8 +36,6 @@
/* Size of a page in an object file. */
#define __LDPGSZ 8192
-#define NATIVE_EXEC_ELF
-
#define ARCH_ELFSIZE 64
#define ELF_TARG_CLASS ELFCLASS64
diff --git a/sys/arch/amd64/include/exec.h b/sys/arch/amd64/include/exec.h
index c57d61e4340..6d16439cbbd 100644
--- a/sys/arch/amd64/include/exec.h
+++ b/sys/arch/amd64/include/exec.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.h,v 1.3 2011/03/23 16:54:34 pirofti Exp $ */
+/* $OpenBSD: exec.h,v 1.4 2012/09/11 15:44:17 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> Public Domain
*/
@@ -8,8 +8,6 @@
#define __LDPGSZ 4096
-#define NATIVE_EXEC_ELF
-
#define ARCH_ELFSIZE 64
#define ELF_TARG_CLASS ELFCLASS64
diff --git a/sys/arch/arm/include/exec.h b/sys/arch/arm/include/exec.h
index d2ff44a438d..2f5545300f5 100644
--- a/sys/arch/arm/include/exec.h
+++ b/sys/arch/arm/include/exec.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.h,v 1.2 2011/11/08 17:06:51 deraadt Exp $ */
+/* $OpenBSD: exec.h,v 1.3 2012/09/11 15:44:17 deraadt Exp $ */
/* $NetBSD: exec.h,v 1.6 1994/10/27 04:16:05 cgd Exp $ */
/*
@@ -33,8 +33,6 @@
#define __LDPGSZ 4096
-#define NATIVE_EXEC_ELF
-
#define ARCH_ELFSIZE 32
#define ELF_TARG_CLASS ELFCLASS32
diff --git a/sys/arch/hppa/include/exec.h b/sys/arch/hppa/include/exec.h
index f94766e750c..6373e18e7fc 100644
--- a/sys/arch/hppa/include/exec.h
+++ b/sys/arch/hppa/include/exec.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.h,v 1.10 2008/06/14 14:42:55 miod Exp $ */
+/* $OpenBSD: exec.h,v 1.11 2012/09/11 15:44:17 deraadt Exp $ */
/*
* Copyright (c) 1994, The University of Utah and
@@ -37,7 +37,6 @@
#define ELF_TARG_DATA ELFDATA2MSB
#define ELF_TARG_MACH EM_PARISC
-#define NATIVE_EXEC_ELF
#define _NLIST_DO_ELF
#define _KERN_DO_ELF
diff --git a/sys/arch/hppa64/include/exec.h b/sys/arch/hppa64/include/exec.h
index 79a7cf4789f..af7abf6de51 100644
--- a/sys/arch/hppa64/include/exec.h
+++ b/sys/arch/hppa64/include/exec.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.h,v 1.3 2011/11/10 23:15:11 deraadt Exp $ */
+/* $OpenBSD: exec.h,v 1.4 2012/09/11 15:44:17 deraadt Exp $ */
/*
* Copyright (c) 1994, The University of Utah and
@@ -37,7 +37,6 @@
#define ELF_TARG_DATA ELFDATA2MSB
#define ELF_TARG_MACH EM_PARISC
-#define NATIVE_EXEC_ELF
#define _NLIST_DO_ELF
#define _KERN_DO_ELF64
diff --git a/sys/arch/i386/include/exec.h b/sys/arch/i386/include/exec.h
index 69091707d34..d655f867f65 100644
--- a/sys/arch/i386/include/exec.h
+++ b/sys/arch/i386/include/exec.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.h,v 1.10 2011/03/23 16:54:35 pirofti Exp $ */
+/* $OpenBSD: exec.h,v 1.11 2012/09/11 15:44:17 deraadt Exp $ */
/* $NetBSD: exec.h,v 1.6 1994/10/27 04:16:05 cgd Exp $ */
/*
@@ -33,8 +33,6 @@
#define __LDPGSZ 4096
-#define NATIVE_EXEC_ELF
-
#define ARCH_ELFSIZE 32
#define ELF_TARG_CLASS ELFCLASS32
diff --git a/sys/arch/ia64/include/exec.h b/sys/arch/ia64/include/exec.h
index d08a436f4f5..f4246250559 100644
--- a/sys/arch/ia64/include/exec.h
+++ b/sys/arch/ia64/include/exec.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.h,v 1.1 2011/07/04 23:29:08 pirofti Exp $ */
+/* $OpenBSD: exec.h,v 1.2 2012/09/11 15:44:17 deraadt Exp $ */
/*
* Written by Paul Irofti <pirofti@openbsd.org>. Public Domain.
@@ -7,8 +7,6 @@
#ifndef _IA64_EXEC_H_
#define _IA64_EXEC_H_
-#define NATIVE_EXEC_ELF
-
#define ARCH_ELFSIZE 64
#define _NLIST_DO_ELF
diff --git a/sys/arch/mips64/include/exec.h b/sys/arch/mips64/include/exec.h
index e1d9e903301..02447c309ff 100644
--- a/sys/arch/mips64/include/exec.h
+++ b/sys/arch/mips64/include/exec.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.h,v 1.4 2009/12/12 20:03:16 miod Exp $ */
+/* $OpenBSD: exec.h,v 1.5 2012/09/11 15:44:18 deraadt Exp $ */
/*
* Copyright (c) 1996-2004 Per Fogelstrom, Opsycon AB
@@ -34,7 +34,6 @@
/*
* Define what exec "formats" we should handle.
*/
-#define NATIVE_EXEC_ELF
#define NATIVE_ELFSIZE 64
#define EXEC_SCRIPT
diff --git a/sys/arch/powerpc/include/exec.h b/sys/arch/powerpc/include/exec.h
index 8b56f51ebbf..79b18733da8 100644
--- a/sys/arch/powerpc/include/exec.h
+++ b/sys/arch/powerpc/include/exec.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.h,v 1.10 2003/06/09 16:34:22 deraadt Exp $ */
+/* $OpenBSD: exec.h,v 1.11 2012/09/11 15:44:18 deraadt Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom, Opsycon AB.
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: exec.h,v 1.10 2003/06/09 16:34:22 deraadt Exp $
+ * $Id: exec.h,v 1.11 2012/09/11 15:44:18 deraadt Exp $
*/
#ifndef _POWERPC_EXEC_H_
@@ -35,7 +35,6 @@
/*
* Define what exec "formats" we should handle.
*/
-#define NATIVE_EXEC_ELF
#define EXEC_SCRIPT
#define ARCH_ELFSIZE 32
diff --git a/sys/arch/sh/include/exec.h b/sys/arch/sh/include/exec.h
index 48a968037f4..f4bc66f3923 100644
--- a/sys/arch/sh/include/exec.h
+++ b/sys/arch/sh/include/exec.h
@@ -1,10 +1,8 @@
-/* $OpenBSD: exec.h,v 1.2 2006/11/10 20:34:06 drahn Exp $ */
+/* $OpenBSD: exec.h,v 1.3 2012/09/11 15:44:18 deraadt Exp $ */
/* $NetBSD: elf_machdep.h,v 1.8 2002/04/28 17:10:34 uch Exp $ */
#define __LDPGSZ 4096
-#define NATIVE_EXEC_ELF
-
#define ARCH_ELFSIZE 32 /* MD native binary size */
#define ELF_TARG_CLASS ELFCLASS32
#ifdef __LITTLE_ENDIAN__
diff --git a/sys/arch/sparc/include/exec.h b/sys/arch/sparc/include/exec.h
index 24d512ca290..ecf35ae258e 100644
--- a/sys/arch/sparc/include/exec.h
+++ b/sys/arch/sparc/include/exec.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.h,v 1.14 2011/03/23 16:54:37 pirofti Exp $ */
+/* $OpenBSD: exec.h,v 1.15 2012/09/11 15:44:18 deraadt Exp $ */
/* $NetBSD: exec.h,v 1.7 1994/11/20 20:53:02 deraadt Exp $ */
/*
@@ -115,8 +115,6 @@ struct relocation_info_sparc {
#define R_TYPE(name) __CONCAT(R_SPARC_,name)
#endif
-#define NATIVE_EXEC_ELF
-
#define ARCH_ELFSIZE 32
#define ELF_TARG_CLASS ELFCLASS32
diff --git a/sys/arch/sparc64/include/exec.h b/sys/arch/sparc64/include/exec.h
index dc2bfc948f7..07fe611ce47 100644
--- a/sys/arch/sparc64/include/exec.h
+++ b/sys/arch/sparc64/include/exec.h
@@ -1,7 +1,6 @@
-/* $OpenBSD: exec.h,v 1.7 2006/02/22 22:06:38 miod Exp $ */
+/* $OpenBSD: exec.h,v 1.8 2012/09/11 15:44:18 deraadt Exp $ */
/* $NetBSD: elf_machdep.h,v 1.7 2001/02/11 00:18:49 eeh Exp $ */
-#define NATIVE_EXEC_ELF
#define _KERN_DO_ELF64
#define _NLIST_DO_ELF
diff --git a/sys/compat/linux/linux_exec.c b/sys/compat/linux/linux_exec.c
index c587445b246..22d0b2f424b 100644
--- a/sys/compat/linux/linux_exec.c
+++ b/sys/compat/linux/linux_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_exec.c,v 1.36 2012/06/20 11:37:21 pirofti Exp $ */
+/* $OpenBSD: linux_exec.c,v 1.37 2012/09/11 15:44:19 deraadt Exp $ */
/* $NetBSD: linux_exec.c,v 1.13 1996/04/05 00:01:10 christos Exp $ */
/*-
@@ -42,7 +42,6 @@
#include <sys/core.h>
#include <sys/exec.h>
#include <sys/exec_elf.h>
-#include <sys/exec_olf.h>
#include <sys/mman.h>
#include <sys/syscallargs.h>
@@ -473,7 +472,7 @@ exec_linux_elf32_makecmds(struct proc *p, struct exec_package *epp)
int
linux_elf_probe(struct proc *p, struct exec_package *epp, char *itp,
- u_long *pos, u_int8_t *os)
+ u_long *pos)
{
Elf32_Ehdr *eh = epp->ep_hdr;
char *bp, *brand;
@@ -513,8 +512,6 @@ recognized:
}
epp->ep_emul = &emul_linux_elf;
*pos = ELF32_NO_ADDR;
- if (*os == OOS_NULL)
- *os = OOS_LINUX;
mtx_init(&futex_lock, IPL_NONE);
futex_pool_init();
diff --git a/sys/compat/linux/linux_exec.h b/sys/compat/linux/linux_exec.h
index d4f0f14d2e1..b216205a5a6 100644
--- a/sys/compat/linux/linux_exec.h
+++ b/sys/compat/linux/linux_exec.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_exec.h,v 1.7 2011/04/05 22:54:30 pirofti Exp $ */
+/* $OpenBSD: linux_exec.h,v 1.8 2012/09/11 15:44:19 deraadt Exp $ */
/* $NetBSD: linux_exec.h,v 1.5 1995/10/07 06:27:01 mycroft Exp $ */
/*
@@ -70,6 +70,6 @@ int exec_linux_aout_makecmds(struct proc *, struct exec_package *);
int exec_linux_elf32_makecmds(struct proc *, struct exec_package *);
int linux_elf_probe(struct proc *, struct exec_package *, char *,
- u_long *, u_int8_t *);
+ u_long *);
#endif /* !_LINUX_EXEC_H_ */
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c
index 7cfa7d11ea6..e827787795d 100644
--- a/sys/kern/exec_elf.c
+++ b/sys/kern/exec_elf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_elf.c,v 1.87 2012/08/20 23:25:07 matthew Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.88 2012/09/11 15:44:19 deraadt Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
@@ -78,7 +78,6 @@
#include <sys/core.h>
#include <sys/exec.h>
#include <sys/exec_elf.h>
-#include <sys/exec_olf.h>
#include <sys/file.h>
#include <sys/ptrace.h>
#include <sys/syscall.h>
@@ -98,7 +97,7 @@
struct ELFNAME(probe_entry) {
int (*func)(struct proc *, struct exec_package *, char *,
- u_long *, u_int8_t *);
+ u_long *);
} ELFNAME(probes)[] = {
/* XXX - bogus, shouldn't be size independent.. */
#ifdef COMPAT_LINUX
@@ -519,7 +518,6 @@ ELFNAME2(exec,makecmds)(struct proc *p, struct exec_package *epp)
int error, i;
char *interp = NULL;
u_long pos = 0, phsize;
- u_int8_t os = OOS_NULL;
size_t randomizequota = ELF_RANDOMIZE_LIMIT;
if (epp->ep_hdrvalid < sizeof(Elf_Ehdr))
@@ -594,23 +592,12 @@ ELFNAME2(exec,makecmds)(struct proc *p, struct exec_package *epp)
* set the ep_emul field in the exec package structure.
*/
error = ENOEXEC;
- p->p_os = OOS_OPENBSD;
-#ifdef NATIVE_EXEC_ELF
- if (ELFNAME(os_pt_note)(p, epp, epp->ep_hdr, "OpenBSD", 8, 4) == 0) {
- goto native;
- }
-#endif
- for (i = 0; ELFNAME(probes)[i].func != NULL && error; i++) {
- error = (*ELFNAME(probes)[i].func)(p, epp, interp, &pos, &os);
+ if (ELFNAME(os_pt_note)(p, epp, epp->ep_hdr, "OpenBSD", 8, 4) != 0) {
+ for (i = 0; ELFNAME(probes)[i].func != NULL && error; i++)
+ error = (*ELFNAME(probes)[i].func)(p, epp, interp, &pos);
+ if (error)
+ goto bad;
}
- if (!error)
- p->p_os = os;
-#ifndef NATIVE_EXEC_ELF
- else
- goto bad;
-#else
-native:
-#endif /* NATIVE_EXEC_ELF */
/*
* Load all the necessary sections
@@ -760,7 +747,6 @@ native:
ap->arg_phentsize = eh->e_phentsize;
ap->arg_phnum = eh->e_phnum;
ap->arg_entry = eh->e_entry + exe_base;
- ap->arg_os = os;
epp->ep_emul_arg = ap;
epp->ep_interp_pos = pos;
diff --git a/sys/sys/exec_elf.h b/sys/sys/exec_elf.h
index 17288b80d93..565ebd22668 100644
--- a/sys/sys/exec_elf.h
+++ b/sys/sys/exec_elf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_elf.h,v 1.50 2012/08/20 23:25:07 matthew Exp $ */
+/* $OpenBSD: exec_elf.h,v 1.51 2012/09/11 15:44:18 deraadt Exp $ */
/*
* Copyright (c) 1995, 1996 Erik Theisen. All rights reserved.
*
@@ -626,7 +626,6 @@ struct elf_args {
u_long arg_phaddr; /* program header address */
u_long arg_phentsize; /* Size of program header */
u_long arg_phnum; /* Number of program headers */
- u_long arg_os; /* OS tag */
};
#endif
diff --git a/sys/sys/exec_olf.h b/sys/sys/exec_olf.h
deleted file mode 100644
index ea9b771e514..00000000000
--- a/sys/sys/exec_olf.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* $OpenBSD: exec_olf.h,v 1.10 2008/06/04 22:12:53 deraadt Exp $ */
-/*
- * Copyright (c) 1996 Erik Theisen. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * OLF is a modified ELF that attempts to fix two serious shortcomings in
- * the SVR4 ABI. Namely a lack of an operating system and strip tag.
- */
-
-#ifndef _SYS_EXEC_OLF_H_
-#define _SYS_EXEC_OLF_H_
-
-#include <sys/exec_elf.h>
-
-/*
- * Please help make this list definative.
- */
-/* e_ident[] system */
-#define OOS_NULL 0 /* invalid */
-#define OOS_OPENBSD 1 /* OpenBSD */
-#define OOS_NETBSD 2 /* NetBSD */
-#define OOS_FREEBSD 3 /* FreeBSD */
-#define OOS_44BSD 4 /* 4.4BSD */
-#define OOS_LINUX 5 /* Linux */
-#define OOS_SVR4 6 /* AT&T System V Release 4 */
-#define OOS_ESIX 7 /* esix UNIX */
-#define OOS_SOLARIS 8 /* SunSoft Solaris */
-#define OOS_IRIX 9 /* SGI IRIX */
-#define OOS_SCO 10 /* SCO UNIX */
-#define OOS_DELL 11 /* DELL SVR4 */
-#define OOS_NCR 12 /* NCR SVR4 */
-#define OOS_NUM 13 /* Number of systems */
-
-/* The rest of the types and defines come from the ELF header file */
-#endif /* _SYS_EXEC_OLF_H_ */
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index e0d8c60938d..da04d28451d 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.h,v 1.162 2012/08/02 03:18:48 guenther Exp $ */
+/* $OpenBSD: proc.h,v 1.163 2012/09/11 15:44:19 deraadt Exp $ */
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
/*-
@@ -263,7 +263,7 @@ struct proc {
int p_exitsig; /* Signal to send to parent on exit. */
int p_flag; /* P_* flags. */
- u_char p_os; /* OS tag */
+ u_char p_spare; /* unused */
char p_stat; /* S* process status. */
char p_pad1[1];
u_char p_descfd; /* if not 255, fdesc permits this fd */