|
Message-ID: <038639b1-92da-13c1-b3e5-8f13639a815e@infradead.org> Date: Tue, 14 Jul 2020 11:40:34 -0700 From: Randy Dunlap <rdunlap@...radead.org> To: Mickaël Salaün <mic@...ikod.net>, linux-kernel@...r.kernel.org Cc: Aleksa Sarai <cyphar@...har.com>, Alexei Starovoitov <ast@...nel.org>, Al Viro <viro@...iv.linux.org.uk>, Andrew Morton <akpm@...ux-foundation.org>, Andy Lutomirski <luto@...nel.org>, Christian Brauner <christian.brauner@...ntu.com>, Christian Heimes <christian@...hon.org>, Daniel Borkmann <daniel@...earbox.net>, Deven Bowers <deven.desai@...ux.microsoft.com>, Dmitry Vyukov <dvyukov@...gle.com>, Eric Biggers <ebiggers@...nel.org>, Eric Chiang <ericchiang@...gle.com>, Florian Weimer <fweimer@...hat.com>, James Morris <jmorris@...ei.org>, Jan Kara <jack@...e.cz>, Jann Horn <jannh@...gle.com>, Jonathan Corbet <corbet@....net>, Kees Cook <keescook@...omium.org>, Lakshmi Ramasubramanian <nramas@...ux.microsoft.com>, Matthew Garrett <mjg59@...gle.com>, Matthew Wilcox <willy@...radead.org>, Michael Kerrisk <mtk.manpages@...il.com>, Mickaël Salaün <mickael.salaun@....gouv.fr>, Mimi Zohar <zohar@...ux.ibm.com>, Philippe Trébuchet <philippe.trebuchet@....gouv.fr>, Scott Shell <scottsh@...rosoft.com>, Sean Christopherson <sean.j.christopherson@...el.com>, Shuah Khan <shuah@...nel.org>, Steve Dower <steve.dower@...hon.org>, Steve Grubb <sgrubb@...hat.com>, Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>, Thibaut Sautereau <thibaut.sautereau@....gouv.fr>, Vincent Strubel <vincent.strubel@....gouv.fr>, kernel-hardening@...ts.openwall.com, linux-api@...r.kernel.org, linux-integrity@...r.kernel.org, linux-security-module@...r.kernel.org, linux-fsdevel@...r.kernel.org Subject: Re: [PATCH v6 5/7] fs,doc: Enable to enforce noexec mounts or file exec through O_MAYEXEC Hi, On 7/14/20 11:16 AM, Mickaël Salaün wrote: > --- > Documentation/admin-guide/sysctl/fs.rst | 45 +++++++++++++++++++++++++ > fs/namei.c | 29 +++++++++++++--- > include/linux/fs.h | 1 + > kernel/sysctl.c | 12 +++++-- > 4 files changed, 80 insertions(+), 7 deletions(-) > > diff --git a/Documentation/admin-guide/sysctl/fs.rst b/Documentation/admin-guide/sysctl/fs.rst > index 2a45119e3331..02ec384b8bbf 100644 > --- a/Documentation/admin-guide/sysctl/fs.rst > +++ b/Documentation/admin-guide/sysctl/fs.rst Reviewed-by: Randy Dunlap <rdunlap@...radead.org> with one tiny nit: > @@ -165,6 +166,50 @@ system needs to prune the inode list instead of allocating > +The ability to restrict code execution must be thought as a system-wide policy, > +which first starts by restricting mount points with the ``noexec`` option. > +This option is also automatically applied to special filesystems such as /proc > +. This prevents files on such mount points to be directly executed by the Can you move that period from the beginning of the line to the end of the previous line? > +kernel or mapped as executable memory (e.g. libraries). With script > +interpreters using the ``O_MAYEXEC`` flag, the executable permission can then > +be checked before reading commands from files. This makes it possible to > +enforce the ``noexec`` at the interpreter level, and thus propagates this > +security policy to scripts. To be fully effective, these interpreters also > +need to handle the other ways to execute code: command line parameters (e.g., > +option ``-e`` for Perl), module loading (e.g., option ``-m`` for Python), > +stdin, file sourcing, environment variables, configuration files, etc. > +According to the threat model, it may be acceptable to allow some script > +interpreters (e.g. Bash) to interpret commands from stdin, may it be a TTY or a > +pipe, because it may not be enough to (directly) perform syscalls. thanks. -- ~Randy
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.