Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Feb 2017 19:22:07 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-fs@FreeBSD.org
Subject:   [Bug 217062] for file systems mounted with -o noexec, exec=off property does not work for mmap
Message-ID:  <bug-217062-3630-UzXhwaljK8@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-217062-3630@https.bugs.freebsd.org/bugzilla/>
References:  <bug-217062-3630@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D217062

--- Comment #4 from Konstantin Belousov <kib@FreeBSD.org> ---
(In reply to shamaz.mazum from comment #3)
The fragment you cited is exactly the cause why mprotect(2) call in your te=
st
program fails.  mprotect(2) checks that new protection is a subset of the
maxprot.

That said, my opinion is that disallowing PROT_EXEC for mappings from -o no=
exec
mounts is useless.  If you determined, there is nothing which could prevent=
 you
from mapping anonymous memory, copying data from the file into it, and then
executing.

OTOH, I admit that there is inconsistency between mmap(2) and mprotect(2),
which was introduced by r127187.  The patch I attached fixes that, but I wo=
nder
would it be more useful to revert the mentioned revision instead.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-217062-3630-UzXhwaljK8>