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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E4A8C63697 for ; Mon, 16 Nov 2020 21:36:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0812620781 for ; Mon, 16 Nov 2020 21:36:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729699AbgKPVgW (ORCPT ); Mon, 16 Nov 2020 16:36:22 -0500 Received: from smtp-42a8.mail.infomaniak.ch ([84.16.66.168]:43977 "EHLO smtp-42a8.mail.infomaniak.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726035AbgKPVgW (ORCPT ); Mon, 16 Nov 2020 16:36:22 -0500 Received: from smtp-2-0001.mail.infomaniak.ch (unknown [10.5.36.108]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4CZj7S2n4nzlhKBs; Mon, 16 Nov 2020 22:36:20 +0100 (CET) Received: from ns3096276.ip-94-23-54.eu (unknown [94.23.54.103]) by smtp-2-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4CZj7P4XQrzlh8TF; Mon, 16 Nov 2020 22:36:17 +0100 (CET) Subject: Re: [PATCH v22 01/12] landlock: Add object management To: Pavel Machek Cc: James Morris , "Serge E . Hallyn" , Al Viro , Andy Lutomirski , Anton Ivanov , Arnd Bergmann , Casey Schaufler , Jann Horn , Jeff Dike , Jonathan Corbet , Kees Cook , Michael Kerrisk , Richard Weinberger , Shuah Khan , Vincent Dagonneau , kernel-hardening@lists.openwall.com, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, x86@kernel.org, =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= References: <20201027200358.557003-1-mic@digikod.net> <20201027200358.557003-2-mic@digikod.net> <20201116212609.GA13063@amd> From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= Message-ID: <523d2141-e6f9-354d-d102-ae8345c84686@digikod.net> Date: Mon, 16 Nov 2020 22:36:17 +0100 User-Agent: MIME-Version: 1.0 In-Reply-To: <20201116212609.GA13063@amd> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On 16/11/2020 22:26, Pavel Machek wrote: > Hi! > >> A Landlock object enables to identify a kernel object (e.g. an inode). >> A Landlock rule is a set of access rights allowed on an object. Rules >> are grouped in rulesets that may be tied to a set of processes (i.e. >> subjects) to enforce a scoped access-control (i.e. a domain). >> >> Because Landlock's goal is to empower any process (especially >> unprivileged ones) to sandbox themselves, we cannot rely on a >> system-wide object identification such as file extended attributes. > > >> +config SECURITY_LANDLOCK >> + bool "Landlock support" >> + depends on SECURITY >> + select SECURITY_PATH >> + help >> + Landlock is a safe sandboxing mechanism which enables processes to >> + restrict themselves (and their future children) by gradually >> + enforcing tailored access control policies. A security policy is a >> + set of access rights (e.g. open a file in read-only, make a >> + directory, etc.) tied to a file hierarchy. Such policy can be configured >> + and enforced by any processes for themselves thanks to dedicated system >> + calls: landlock_create_ruleset(), landlock_add_rule(), and >> + landlock_enforce_ruleset_current(). > > How does it interact with setuid binaries? Being able to exec passwd > in a sandbox sounds like ... fun way to get root? :-). It works like seccomp: if you run with CAP_SYS_ADMIN in the current namespace, then SUID binaries may be allowed, otherwise if you use PR_SET_NO_NEW_PRIVS, then executing a SUID binary is denied. The 24th version is here: https://lore.kernel.org/lkml/20201112205141.775752-1-mic@digikod.net/ > > Best regards, > Pavel > >