Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <70d67323-c568-4861-ab93-8e013854eb32@python.org>
Date: Tue, 16 Jul 2024 16:10:00 +0100
From: Steve Dower <steve.dower@...hon.org>
To: Jeff Xu <jeffxu@...gle.com>, Mickaël Salaün
 <mic@...ikod.net>
Cc: Kees Cook <kees@...nel.org>, Al Viro <viro@...iv.linux.org.uk>,
 Christian Brauner <brauner@...nel.org>,
 Linus Torvalds <torvalds@...ux-foundation.org>,
 Paul Moore <paul@...l-moore.com>, Theodore Ts'o <tytso@....edu>,
 Alejandro Colomar <alx@...nel.org>, Aleksa Sarai <cyphar@...har.com>,
 Andrew Morton <akpm@...ux-foundation.org>, Andy Lutomirski
 <luto@...nel.org>, Arnd Bergmann <arnd@...db.de>,
 Casey Schaufler <casey@...aufler-ca.com>,
 Christian Heimes <christian@...hon.org>, Dmitry Vyukov <dvyukov@...gle.com>,
 Eric Biggers <ebiggers@...nel.org>, Eric Chiang <ericchiang@...gle.com>,
 Fan Wu <wufan@...ux.microsoft.com>, Florian Weimer <fweimer@...hat.com>,
 Geert Uytterhoeven <geert@...ux-m68k.org>,
 James Morris <jamorris@...ux.microsoft.com>, Jan Kara <jack@...e.cz>,
 Jann Horn <jannh@...gle.com>, Jonathan Corbet <corbet@....net>,
 Jordan R Abrahams <ajordanr@...gle.com>,
 Lakshmi Ramasubramanian <nramas@...ux.microsoft.com>,
 Luca Boccassi <bluca@...ian.org>, Luis Chamberlain <mcgrof@...nel.org>,
 "Madhavan T . Venkataraman" <madvenka@...ux.microsoft.com>,
 Matt Bobrowski <mattbobrowski@...gle.com>,
 Matthew Garrett <mjg59@...f.ucam.org>, Matthew Wilcox <willy@...radead.org>,
 Miklos Szeredi <mszeredi@...hat.com>, Mimi Zohar <zohar@...ux.ibm.com>,
 Nicolas Bouchinet <nicolas.bouchinet@....gouv.fr>,
 Scott Shell <scottsh@...rosoft.com>, Shuah Khan <shuah@...nel.org>,
 Stephen Rothwell <sfr@...b.auug.org.au>, Steve Grubb <sgrubb@...hat.com>,
 Thibaut Sautereau <thibaut.sautereau@....gouv.fr>,
 Vincent Strubel <vincent.strubel@....gouv.fr>,
 Xiaoming Ni <nixiaoming@...wei.com>, Yin Fengwei <fengwei.yin@...el.com>,
 kernel-hardening@...ts.openwall.com, linux-api@...r.kernel.org,
 linux-fsdevel@...r.kernel.org, linux-integrity@...r.kernel.org,
 linux-kernel@...r.kernel.org, linux-security-module@...r.kernel.org
Subject: Re: [RFC PATCH v19 2/5] security: Add new SHOULD_EXEC_CHECK and
 SHOULD_EXEC_RESTRICT securebits

On 16/07/2024 16:02, Jeff Xu wrote:
> For below two cases: will they be restricted by one (or some) mode above ?
> 
> 1> cat /tmp/a.sh | sh
> 
> 2> sh -c "$(cat /tmp/a.sh)"

It will almost certainly depend on your context, but to properly lock 
down a system, they must be restricted. "We were unable to check the 
file" ought to be treated the same as "the file failed the check".

If your goal is to only execute files that have been pre-approved in 
some manner, you're implying that you don't want interactive execution 
at all (since that is not a file that's been pre-approved). So a mere 
"sh" or "sh -c ..." would be restricted without checking anything other 
than the secure bit.

Cheers,
Steve

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.