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 2C512C3DA49 for ; Tue, 16 Jul 2024 15:13:55 +0000 (UTC) Received: (qmail 24208 invoked by uid 550); 16 Jul 2024 15:13:43 -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 16296 invoked from network); 16 Jul 2024 15:10:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=python.org; s=200901; t=1721142606; bh=DhMpYjEPORBLC4GppzbsY1w6CLAkXay9uD3n69IW9ts=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Qf9qEUaOtaufyFY6qYUAFTXL4DoJm8PzWJvueNX2rhKJRt1JOuQfzn83CJfxOxNTz U7GK4UXBgM/hrcmiXyIfcd6koJi+dfG96/nqtTbcW1sUA47uU/HPRHndlGC++bMo/O DuyO4Q+8KNvM+M9WqwwYRy4gR647CYKuAMonGCGQ= Message-ID: <70d67323-c568-4861-ab93-8e013854eb32@python.org> Date: Tue, 16 Jul 2024 16:10:00 +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: Jeff Xu , =?UTF-8?Q?Micka=C3=ABl_Sala=C3=BCn?= Cc: Kees Cook , Al Viro , Christian Brauner , 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: <20240708.quoe8aeSaeRi@digikod.net> <20240709.aech3geeMoh0@digikod.net> <20240710.eiKohpa4Phai@digikod.net> <202407100921.687BE1A6@keescook> <20240711.sequuGhee0th@digikod.net> From: Steve Dower In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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