Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 1 May 2020 14:22:29 +1000 (AEST)
From: James Morris <>
To: Mickaël Salaün <>
cc:, Aleksa Sarai <>,
        Alexei Starovoitov <>, Al Viro <>,
        Andy Lutomirski <>,
        Christian Heimes <>,
        Daniel Borkmann <>,
        Deven Bowers <>,
        Eric Chiang <>,
        Florian Weimer <>, Jan Kara <>,
        Jann Horn <>, Jonathan Corbet <>,
        Kees Cook <>, Matthew Garrett <>,
        Matthew Wilcox <>,
        Michael Kerrisk <>,
        Mickaël Salaün <>,
        Mimi Zohar <>,
        Philippe Trébuchet <>,
        Scott Shell <>,
        Sean Christopherson <>,
        Shuah Khan <>, Steve Dower <>,
        Steve Grubb <>,
        Thibaut Sautereau <>,
        Vincent Strubel <>,,,,
Subject: Re: [PATCH v3 3/5] fs: Enable to enforce noexec mounts or file exec

On Tue, 28 Apr 2020, Mickaël Salaün wrote:

> Enable to either propagate the mount options from the underlying VFS
> mount to prevent execution, or to propagate the file execute permission.
> This may allow a script interpreter to check execution permissions
> before reading commands from a file.

I'm finding the description of this patch difficult to understand.

In the first case, this seems to mean: if you open a file with 
RESOLVE_MAYEXEC from a noexec mount, then it will fail. Correct?

In the second case, do you mean a RESOLVE_MAYEXEC open will fail if the 
file does not have +x set for the user?

> The main goal is to be able to protect the kernel by restricting
> arbitrary syscalls that an attacker could perform with a crafted binary
> or certain script languages.

This sounds like the job of seccomp. Why is this part of MAYEXEC?

>  It also improves multilevel isolation
> by reducing the ability of an attacker to use side channels with
> specific code.  These restrictions can natively be enforced for ELF
> binaries (with the noexec mount option) but require this kernel
> extension to properly handle scripts (e.g., Python, Perl).

Again, not sure why you're talking about side channels and MAYEXEC and 
mount options. Are you more generally talking about being able to prevent 
execution of arbitrary script files included by an interpreter?

> Add a new sysctl fs.open_mayexec_enforce to control this behavior.
> Indeed, because of compatibility with installed systems, only the system
> administrator is able to check that this new enforcement is in line with
> the system mount points and file permissions.  A following patch adds
> documentation.

I don't like the idea of any of this feature set being configurable. 
RESOLVE_MAYEXEC as a new flag should have well-defined, stable semantics.

James Morris

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.