Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 11 Aug 2020 00:43:52 +0200
From: Mickaël Salaün <>
To: Al Viro <>
Cc: Kees Cook <>,
 Andrew Morton <>,,
 Aleksa Sarai <>, Alexei Starovoitov <>,
 Andy Lutomirski <>,
 Christian Brauner <>,
 Christian Heimes <>,
 Daniel Borkmann <>,
 Deven Bowers <>,
 Dmitry Vyukov <>, Eric Biggers <>,
 Eric Chiang <>, Florian Weimer <>,
 James Morris <>, Jan Kara <>,
 Jann Horn <>, Jonathan Corbet <>,
 Lakshmi Ramasubramanian <>,
 Matthew Garrett <>, Matthew Wilcox <>,
 Michael Kerrisk <>, Mimi Zohar <>,
 Philippe Trébuchet <>,
 Scott Shell <>,
 Sean Christopherson <>,
 Shuah Khan <>, Steve Dower <>,
 Steve Grubb <>,
 Tetsuo Handa <>,
 Thibaut Sautereau <>,
 Vincent Strubel <>,,,,,
Subject: Re: [PATCH v7 0/7] Add support for O_MAYEXEC

On 10/08/2020 22:21, Al Viro wrote:
> On Mon, Aug 10, 2020 at 10:11:53PM +0200, Mickaël Salaün wrote:
>> It seems that there is no more complains nor questions. Do you want me
>> to send another series to fix the order of the S-o-b in patch 7?
> There is a major question regarding the API design and the choice of
> hooking that stuff on open().  And I have not heard anything resembling
> a coherent answer.

Hooking on open is a simple design that enables processes to check files
they intend to open, before they open them. From an API point of view,
this series extends openat2(2) with one simple flag: O_MAYEXEC. The
enforcement is then subject to the system policy (e.g. mount points,
file access rights, IMA, etc.).

Checking on open enables to not open a file if it does not meet some
requirements, the same way as if the path doesn't exist or (for whatever
reasons, including execution permission) if access is denied. It is a
good practice to check as soon as possible such properties, and it may
enables to avoid (user space) time-of-check to time-of-use (TOCTOU)
attacks (i.e. misuse of already open resources). It is important to keep
in mind that the use cases we are addressing consider that the (user
space) script interpreters (or linkers) are trusted and unaltered (i.e.
integrity/authenticity checked). These are similar sought defensive
properties as for SUID/SGID binaries: attackers can still launch them
with malicious inputs (e.g. file paths, file descriptors, environment
variables, etc.), but the binaries can then have a way to check if they
can extend their trust to some file paths.

Checking file descriptors may help in some use cases, but not the ones
motivating this series. Checking (already) opened resources could be a
*complementary* way to check execute permission, but it is not in the
scope of this series.

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.