[Bug 217062] for file systems mounted with -o noexec, exec=off property does not work for mmap

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Feb 14 19:22:07 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217062

--- Comment #4 from Konstantin Belousov <kib at FreeBSD.org> ---
(In reply to shamaz.mazum from comment #3)
The fragment you cited is exactly the cause why mprotect(2) call in your test
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 noexec
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 wonder
would it be more useful to revert the mentioned revision instead.

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


More information about the freebsd-fs mailing list