|
Message-ID: <CAP22eLEy5nc4u6gPHtY56afrvF9oTNBwRwNAc7Le=Y_8V49nqQ@mail.gmail.com> Date: Sun, 17 May 2020 19:57:51 +0300 From: "Lev R. Oshvang ." <levonshe@...il.com> To: Kees Cook <keescook@...omium.org> Cc: Mickaël Salaün <mic@...ikod.net>, linux-kernel@...r.kernel.org, Aleksa Sarai <cyphar@...har.com>, Alexei Starovoitov <ast@...nel.org>, Al Viro <viro@...iv.linux.org.uk>, Andy Lutomirski <luto@...nel.org>, Christian Heimes <christian@...hon.org>, Daniel Borkmann <daniel@...earbox.net>, Deven Bowers <deven.desai@...ux.microsoft.com>, 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>, 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>, 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, LSM List <linux-security-module@...r.kernel.org>, linux-fsdevel@...r.kernel.org Subject: Re: [PATCH v5 2/6] fs: Add a MAY_EXECMOUNT flag to infer the noexec mount property On Thu, May 14, 2020 at 6:48 PM Kees Cook <keescook@...omium.org> wrote: > > On Thu, May 14, 2020 at 11:14:04AM +0300, Lev R. Oshvang . wrote: > > New sysctl is indeed required to allow userspace that places scripts > > or libs under noexec mounts. > > But since this is a not-uncommon environment, we must have the sysctl > otherwise this change would break those systems. > But I proposed sysctl on a line below. > > fs.mnt_noexec_strict =1 (allow, e) , 1 (deny any file with --x > > permission), 2 (deny when O_MAYEXEC absent), for any file with ---x > > permissions) > > I don't think we want another mount option -- this is already fully > expressed with noexec and the system-wide sysctl. > > -- The intended use of proposed sysctl is to ebable sysadmin to decide whar is desired semantics mount with NO_EXEC option. fs.mnt_noexec_scope =0 |1|2|3 0 - means old behaviour i.e do nor run executables and scripts (default) 1 - deny any file with --x permissions, i.e executables , script and libs 2 - deny any file when O_MAYEXEC is present. I think this is enough to handle all use cases and to not break current sysadmin file mounts setting I oppose the new O_MAY_EXECMOUNT flag, kernel already has MNT_NO_EXEC, SB_NOEXEC and SB_I_NOEXEC and I frankly do not understand why so many variants exist. Lev
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.