summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-05-11 19:59:26 +0000
committerderaadt <deraadt@openbsd.org>2019-05-11 19:59:26 +0000
commit6cd8480a213100f64e0ddae7edb389a6bf42ac15 (patch)
tree2e8a1fad89e71aaa47cfa431aa668ff75ef784d4
parentadd missing comment about VM_STATE_SHUTDOWN; as discussed with ccardenas@ (diff)
downloadwireguard-openbsd-6cd8480a213100f64e0ddae7edb389a6bf42ac15.tar.xz
wireguard-openbsd-6cd8480a213100f64e0ddae7edb389a6bf42ac15.zip
wxneeded binaries on wxallowed filesystems were refused execution. We have
encountered a wxneeded binary that attempts correct operation when started on a nowxallowed filesystem (it tries mprotect with RWX, notices ENOTSUP and acts in a different way). So permit execution (but of course don't allow W^X violating mappings) ok sthen kettenis robert
-rw-r--r--sys/kern/exec_elf.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c
index 727785cc8bf..9d5639a24a7 100644
--- a/sys/kern/exec_elf.c
+++ b/sys/kern/exec_elf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_elf.c,v 1.149 2019/05/09 22:25:42 guenther Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.150 2019/05/11 19:59:26 deraadt Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
@@ -852,7 +852,6 @@ int
elf_os_pt_note(struct proc *p, struct exec_package *epp, Elf_Ehdr *eh,
char *os_name, size_t name_size, size_t desc_size)
{
- char pathbuf[MAXPATHLEN];
Elf_Phdr *hph, *ph;
Elf_Note *np = NULL;
size_t phsize;
@@ -866,18 +865,6 @@ elf_os_pt_note(struct proc *p, struct exec_package *epp, Elf_Ehdr *eh,
for (ph = hph; ph < &hph[eh->e_phnum]; ph++) {
if (ph->p_type == PT_OPENBSD_WXNEEDED) {
- int wxallowed = (epp->ep_vp->v_mount &&
- (epp->ep_vp->v_mount->mnt_flag & MNT_WXALLOWED));
-
- if (!wxallowed) {
- error = copyinstr(epp->ep_name, &pathbuf,
- sizeof(pathbuf), NULL);
- log(LOG_NOTICE,
- "%s(%d): W^X binary outside wxallowed mountpoint\n",
- error ? "" : pathbuf, p->p_p->ps_pid);
- error = EACCES;
- goto out1;
- }
epp->ep_flags |= EXEC_WXNEEDED;
break;
}