summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/imgact_elf.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index b469898..1901591 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -97,6 +97,11 @@ SYSCTL_INT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO,
TUNABLE_INT("kern.elf" __XSTRING(__ELF_WORD_SIZE) ".fallback_brand",
&__elfN(fallback_brand));
+int __elfN(can_exec_dyn) = 0;
+SYSCTL_INT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO,
+ can_exec_dyn, CTLFLAG_RW, &__elfN(can_exec_dyn), 0,
+ __XSTRING(__CONCAT(ELF, __ELF_WORD_SIZE)) " can exec shared libraries");
+
static int elf_trace = 0;
SYSCTL_INT(_debug, OID_AUTO, __elfN(trace), CTLFLAG_RW, &elf_trace, 0, "");
@@ -660,7 +665,8 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
/*
* Do we have a valid ELF header ?
*/
- if (__elfN(check_header)(hdr) != 0 || hdr->e_type != ET_EXEC)
+ if (__elfN(check_header)(hdr) != 0 || (hdr->e_type != ET_EXEC
+ && (!__elfN(can_exec_dyn) || hdr->e_type != ET_DYN)))
return (-1);
/*
OpenPOWER on IntegriCloud