From 1fd973600cdb4f9cd716a6c2feeb1700bd84373c Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Tue, 16 Jan 2001 15:46:21 +0000 Subject: 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. --- sys/kern/exec_elf64.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sys/kern') 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, -- cgit v1.2.3