HBSD: Re-establish ELF auxvec compat with FreeBSD

OPNsense doesn't use SHLIBRANDOM, so remove the ABI compat-breaking ELF
auxvec.

Signed-off-by:	Shawn Webb <shawn@opnsense.org>
This commit is contained in:
Shawn Webb 2019-12-08 11:11:43 -05:00
parent f6894fff31
commit e12ac620a4
No known key found for this signature in database
GPG Key ID: 411DCD7D5C3BFCB6
9 changed files with 8 additions and 25 deletions

View File

@ -436,14 +436,6 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
main_argc = argc;
main_argv = argv;
#ifdef HARDENEDBSD
/* Load PaX flags */
if (aux_info[AT_PAXFLAGS] != NULL) {
pax_flags = aux_info[AT_PAXFLAGS]->a_un.a_val;
aux_info[AT_PAXFLAGS]->a_un.a_val = 0;
}
#endif
trust = !issetugid();
md_abi_variant_hook(aux_info);

View File

@ -89,9 +89,8 @@ __ElfType(Auxinfo);
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
#define AT_PAXFLAGS 27 /* PaX / HardenedBSD flags */
#define AT_COUNT 28 /* Count of defined aux entry types. */
#define AT_COUNT 27 /* Count of defined aux entry types. */
#define R_ARM_COUNT 33 /* Count of defined relocation types. */

View File

@ -96,9 +96,8 @@ __ElfType(Auxinfo);
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
#define AT_PAXFLAGS 27 /* PaX / HardenedBSD flags */
#define AT_COUNT 28 /* Count of defined aux entry types. */
#define AT_COUNT 27 /* Count of defined aux entry types. */
/* Define "machine" characteristics */
#if __ELF_WORD_SIZE == 64

View File

@ -1277,7 +1277,6 @@ __elfN(freebsd_fixup)(register_t **stack_base, struct image_params *imgp)
AUXARGS_ENTRY(pos, AT_FLAGS, args->flags);
AUXARGS_ENTRY(pos, AT_ENTRY, args->entry);
AUXARGS_ENTRY(pos, AT_BASE, args->base);
AUXARGS_ENTRY(pos, AT_PAXFLAGS, args->pax_flags);
AUXARGS_ENTRY(pos, AT_EHDRFLAGS, args->hdr_eflags);
if (imgp->execpathp != 0)
AUXARGS_ENTRY(pos, AT_EXECPATH, imgp->execpathp);

View File

@ -149,9 +149,8 @@ __ElfType(Auxinfo);
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
#define AT_PAXFLAGS 27 /* PaX / HardenedBSD flags */
#define AT_COUNT 28 /* Count of defined aux entry types. */
#define AT_COUNT 27 /* Count of defined aux entry types. */
#define ET_DYN_LOAD_ADDR 0x0120000

View File

@ -116,9 +116,8 @@ __ElfType(Auxinfo);
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
#define AT_PAXFLAGS 27 /* PaX / HardenedBSD flags */
#define AT_COUNT 28 /* Count of defined aux entry types. */
#define AT_COUNT 27 /* Count of defined aux entry types. */
/*
* Relocation types.

View File

@ -93,9 +93,8 @@ __ElfType(Auxinfo);
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
#define AT_PAXFLAGS 27 /* HardenedBSD PaX flags */
#define AT_COUNT 28 /* Count of defined aux entry types. */
#define AT_COUNT 27 /* Count of defined aux entry types. */
/* Define "machine" characteristics */
#define ELF_TARG_CLASS ELFCLASS64

View File

@ -97,9 +97,8 @@ __ElfType(Auxinfo);
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
#define AT_PAXFLAGS 27 /* PaX / HardenedBSD flags */
#define AT_COUNT 28 /* Count of defined aux entry types. */
#define AT_COUNT 27 /* Count of defined aux entry types. */
/* Define "machine" characteristics */
#if __ELF_WORD_SIZE == 32

View File

@ -105,9 +105,8 @@ __ElfType(Auxinfo);
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
#define AT_PAXFLAGS 27 /* PaX / HardenedBSD flags */
#define AT_COUNT 28 /* Count of defined aux entry types. */
#define AT_COUNT 27 /* Count of defined aux entry types. */
/*
* Relocation types.
@ -194,9 +193,8 @@ __ElfType(Auxinfo);
#define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */
#define AT_HWCAP 25 /* CPU feature flags. */
#define AT_HWCAP2 26 /* CPU feature flags 2. */
#define AT_PAXFLAGS 27 /* PaX / HardenedBSD flags */
#define AT_COUNT 28 /* Count of defined aux entry types. */
#define AT_COUNT 27 /* Count of defined aux entry types. */
/*
* Relocation types.