diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-01-16 15:46:21 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-01-16 15:46:21 +0000 |
commit | 1fd973600cdb4f9cd716a6c2feeb1700bd84373c (patch) | |
tree | 72eeb5c63b585a0479782707e3272714ec76b439 /sys/kern | |
parent | 5e14a6f7d6d4acd8b6b68e95da53fcfbeb1dae96 (diff) |
Add a check for MNT_NOEXEC that was in exec_elf.c but not here.
I am not sure if it is necessary, but it will not hurt either.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/exec_elf64.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/exec_elf64.c b/sys/kern/exec_elf64.c index 517323f8fcd..5812623db83 100644 --- a/sys/kern/exec_elf64.c +++ b/sys/kern/exec_elf64.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf64.c,v 1.9 2000/12/14 16:54:41 art Exp $ */ +/* $OpenBSD: exec_elf64.c,v 1.10 2001/01/16 15:46:20 art Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -384,6 +384,10 @@ elf64_load_file(p, path, epp, ap, last) } if ((error = VOP_GETATTR(vp, epp->ep_vap, p->p_ucred, p)) != 0) goto bad; + if (vp->v_mount->mnt_flag & MNT_NOEXEC) { + error = EACCES; + goto bad; + } if ((error = VOP_ACCESS(vp, VREAD, p->p_ucred, p)) != 0) goto bad1; if ((error = elf64_read_from(p, nd.ni_vp, 0, |