Do not set a default ELF syscall ABI fallback.
If one runs an un-branded Linux static binary that calls Linux's fcntl the machine will reboot when interupted by the FreeBSD syscall ABI.
This commit is contained in:
parent
8428d214ad
commit
1814a78315
@ -438,9 +438,12 @@ fail:
|
||||
return error;
|
||||
}
|
||||
|
||||
static int fallback_elf_brand = ELFOSABI_FREEBSD;
|
||||
/*
|
||||
* non static, as it can be overridden by start_init()
|
||||
*/
|
||||
int fallback_elf_brand = -1;
|
||||
SYSCTL_INT(_kern, OID_AUTO, fallback_elf_brand, CTLFLAG_RW,
|
||||
&fallback_elf_brand, ELFOSABI_FREEBSD,
|
||||
&fallback_elf_brand, -1,
|
||||
"ELF brand of last resort");
|
||||
|
||||
static int
|
||||
@ -612,10 +615,6 @@ exec_elf_imgact(struct image_params *imgp)
|
||||
}
|
||||
}
|
||||
|
||||
/* XXX - Assume FreeBSD after the branding method change. */
|
||||
if (brand_info == NULL)
|
||||
brand_info = &freebsd_brand_info;
|
||||
|
||||
if (brand_info == NULL) {
|
||||
uprintf("ELF binary type \"%u\" not known.\n",
|
||||
hdr->e_ident[EI_OSABI]);
|
||||
|
@ -93,6 +93,7 @@ struct proc *initproc;
|
||||
|
||||
int cmask = CMASK;
|
||||
extern struct user *proc0paddr;
|
||||
extern int fallback_elf_brand;
|
||||
|
||||
struct vnode *rootvp;
|
||||
int boothowto = 0; /* initialized so that it can be patched */
|
||||
@ -480,6 +481,8 @@ start_init(void *dummy)
|
||||
strncpy(init_path, var, sizeof init_path);
|
||||
init_path[sizeof init_path - 1] = 0;
|
||||
}
|
||||
if ((var = getenv("kern.fallback_elf_brand")) != NULL)
|
||||
fallback_elf_brand = strtol(var, NULL, 0);
|
||||
|
||||
for (path = init_path; *path != '\0'; path = next) {
|
||||
while (*path == ':')
|
||||
|
Loading…
x
Reference in New Issue
Block a user