Index: sys/amd64/linux/linux_sysvec.c =================================================================== --- sys/amd64/linux/linux_sysvec.c +++ sys/amd64/linux/linux_sysvec.c @@ -109,6 +109,10 @@ u_long stack); static int linux_vsyscall(struct thread *td); +static int linux_exec_unbranded = 1; +SYSCTL_INT(_compat_linux, OID_AUTO, exec_unbranded, CTLFLAG_RWTUN, + &linux_exec_unbranded, 0, "Execute binaries which lack proper brand"); + #define LINUX_T_UNKNOWN 255 static int _bsd_to_linux_trapcode[] = { LINUX_T_UNKNOWN, /* 0 */ @@ -789,6 +793,16 @@ return (true); } +static boolean_t +linux_nobrand_supported(struct image_params *imgp) +{ + + if (linux_exec_unbranded) + return (TRUE); + + return (FALSE); +} + static Elf_Brandnote linux64_brandnote = { .hdr.n_namesz = sizeof(GNULINUX_ABI_VENDOR), .hdr.n_descsz = 16, @@ -834,10 +848,24 @@ .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; +static Elf64_Brandinfo linux_nobrand = { + .brand = ELFOSABI_NONE, + .machine = EM_X86_64, + .compat_3_brand = NULL, + .emul_path = "/compat/linux", + .interp_path = NULL, + .sysvec = &elf_linux_sysvec, + .interp_newpath = NULL, + .brand_note = NULL, + .flags = BI_CAN_EXEC_DYN, + .header_supported= linux_nobrand_supported +}; + Elf64_Brandinfo *linux_brandlist[] = { &linux_glibc2brand, &linux_glibc2brandshort, &linux_muslbrand, + &linux_nobrand, NULL };