Thread (5 messages) 5 messages, 4 authors, 2020-05-05

Re: [PATCH v3 0/5] Add support for RESOLVE_MAYEXEC

From: Jann Horn <jannh@google.com>
Date: 2020-04-28 22:02:12
Also in: linux-api, linux-fsdevel, lkml

Possibly related (same subject, not in this thread)

On Tue, Apr 28, 2020 at 11:21 PM Florian Weimer [off-list ref] wrote:
* Jann Horn:
quoted
Just as a comment: You'd probably also have to use RESOLVE_MAYEXEC in
the dynamic linker.
Absolutely.  In typical configurations, the kernel does not enforce
that executable mappings must be backed by files which are executable.
It's most obvious with using an explicit loader invocation to run
executables on noexec mounts.  RESOLVE_MAYEXEC is much more useful
than trying to reimplement the kernel permission checks (or what some
believe they should be) in userspace.
Oh, good point.

That actually seems like something Mickaël could add to his series? If
someone turns on that knob for "When an interpreter wants to execute
something, enforce that we have execute access to it", they probably
also don't want it to be possible to just map files as executable? So
perhaps when that flag is on, the kernel should either refuse to map
anything as executable if it wasn't opened with RESOLVE_MAYEXEC or
(less strict) if RESOLVE_MAYEXEC wasn't used, print a warning, then
check whether the file is executable and bail out if not?

A configuration where interpreters verify that scripts are executable,
but other things can just mmap executable pages, seems kinda
inconsistent...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help