From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by smtp.lore.kernel.org (Postfix) with SMTP id 2DAEEC3DA42 for ; Wed, 10 Jul 2024 16:36:21 +0000 (UTC) Received: (qmail 20317 invoked by uid 550); 10 Jul 2024 16:36:10 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Received: (qmail 15880 invoked from network); 10 Jul 2024 16:32:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=python.org; s=200901; t=1720629158; bh=h2ueXzl9+sWF3YmpYxvon1twDz2ALcDQP5/oXQTST5o=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=orCNdDWudCwG90M687meldIOq5/EKuuIheRaXFPgs6pRjZnOQvl0JDohh68MAjUiI s4xIkd1yVurO4t3vSs1/vto/eK5p0gW0i5Yz0uvn0sdyeMtjkbfXJE5u9zsPFpqDN1 iXEmSBDTMNFhv/jRjzG1bSRS5+61zKFeOr4ihtow= Message-ID: <296b11b2-5ff2-488b-ac4c-7945aabd7b3c@python.org> Date: Wed, 10 Jul 2024 17:32:36 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v19 2/5] security: Add new SHOULD_EXEC_CHECK and SHOULD_EXEC_RESTRICT securebits Content-Language: en-GB To: =?UTF-8?Q?Micka=C3=ABl_Sala=C3=BCn?= , Jeff Xu Cc: Al Viro , Christian Brauner , Kees Cook , Linus Torvalds , Paul Moore , Theodore Ts'o , Alejandro Colomar , Aleksa Sarai , Andrew Morton , Andy Lutomirski , Arnd Bergmann , Casey Schaufler , Christian Heimes , Dmitry Vyukov , Eric Biggers , Eric Chiang , Fan Wu , Florian Weimer , Geert Uytterhoeven , James Morris , Jan Kara , Jann Horn , Jonathan Corbet , Jordan R Abrahams , Lakshmi Ramasubramanian , Luca Boccassi , Luis Chamberlain , "Madhavan T . Venkataraman" , Matt Bobrowski , Matthew Garrett , Matthew Wilcox , Miklos Szeredi , Mimi Zohar , Nicolas Bouchinet , Scott Shell , Shuah Khan , Stephen Rothwell , Steve Grubb , Thibaut Sautereau , Vincent Strubel , Xiaoming Ni , Yin Fengwei , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org References: <20240704190137.696169-1-mic@digikod.net> <20240704190137.696169-3-mic@digikod.net> <20240708.quoe8aeSaeRi@digikod.net> <20240709.aech3geeMoh0@digikod.net> <20240710.eiKohpa4Phai@digikod.net> From: Steve Dower In-Reply-To: <20240710.eiKohpa4Phai@digikod.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 10/07/2024 10:58, Mickaël Salaün wrote: > On Tue, Jul 09, 2024 at 02:57:43PM -0700, Jeff Xu wrote: >>> Hmm, I'm not sure this "CHECK=0, RESTRICT=1" configuration would make >>> sense for a dynamic linker except maybe if we want to only allow static >>> binaries? >>> >>> The CHECK and RESTRICT securebits are designed to make it possible a >>> "permissive mode" and an enforcement mode with the related locked >>> securebits. This is why this "CHECK=0, RESTRICT=1" combination looks a >>> bit weird. We can replace these securebits with others but I didn't >>> find a better (and simple) option. I don't think this is an issue >>> because with any security policy we can create unusable combinations. >>> The three other combinations makes a lot of sense though. >>> >> If we need only handle 3 combinations, I would think something like >> below is easier to understand, and don't have wield state like >> CHECK=0, RESTRICT=1 > > The "CHECK=0, RESTRICT=1" is useful for script interpreter instances > that should not interpret any command from users e.g., but only execute > script files. I see this case as being most relevant to something that doesn't usually need any custom scripts, but may have it. For example, macros in a document, or pre/post-install scripts for a package manager. For something whose sole purpose is to execute scripts, it doesn't make much sense. But there are other cases that can be reasonably controlled with this option. Cheers, Steve