Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp920432pxb; Thu, 19 Nov 2020 17:55:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBXRztkj3qA0MY4xXjRIvPsDEotHtMamyK179YkSGEZmanGE/j1RLrL0+t96vHsqleTWEu X-Received: by 2002:a17:906:179a:: with SMTP id t26mr4118414eje.49.1605837336056; Thu, 19 Nov 2020 17:55:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605837336; cv=none; d=google.com; s=arc-20160816; b=Amm43KEMNeiZYVc6sIxYGk372QoqNBnZxymlZaQ+mmcu555edjICU8D3flPxFadj43 88/F/knfQj75keqcb/Me99p2ZA3oh9c339Uj8ymAa7UDPVn8L74yu4pIb88YQ7CjM1vm L2zeNOdyuUycjYVwV6KdFg5JXEFlVXVOqc1laWwTihBrodbpWRCi7e9O+zcRhhlMCB5u dPXlEWFbUjw1fBeoddbxXkl4foXDncf2xI60HSYRXDpie8Sn5JwGGyZ5N97aPQpBM9xp 53CGMMH+Khux1szDrp9TRTDj39rzooZ9Dzr/i7rEJgNIxUXw/qjXeYxtJBfoO8nveFMR 3pDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=FfkHMtIezG/zWPUfBrRbVxO+mB05KeYrLO48j5BK9Hg=; b=YfMosHO1wrawB98BlUhS7OukX+alcC5I27VMLlSQnTLrvSIeY5Og0MfgDSETVsKLW+ ysHosRVNCNrEIJ//83DDQaIsTiHrPAIzzN7/RRevL4+ZlrZZBjCqL1PxCAL9UrVZAr0k 2J+xANKGBESKagtjG/lkq9Hk7as7lCF8/APECVjgFpq5gdSksZtpqbsDPT+ZUTK/sEIs BBNlzZBDSkYNw+SVhVgMTD+97p1qaUEOsrRsuXaZmnkJZidJX8QjJuiJNqAl8WgCeMFK 6bZQ7bioXe1szeFixDqO/X1JB1N3no75q/A5gpgITj3c8rhy/e4CDaoxyhxUgmjbHodD /pkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u20si905994edr.287.2020.11.19.17.55.12; Thu, 19 Nov 2020 17:55:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727037AbgKTBxc (ORCPT + 99 others); Thu, 19 Nov 2020 20:53:32 -0500 Received: from namei.org ([65.99.196.166]:54324 "EHLO namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726122AbgKTBxb (ORCPT ); Thu, 19 Nov 2020 20:53:31 -0500 Received: from localhost (localhost [127.0.0.1]) by namei.org (8.14.4/8.14.4) with ESMTP id 0AK1qcDI017804; Fri, 20 Nov 2020 01:52:38 GMT Date: Fri, 20 Nov 2020 12:52:38 +1100 (AEDT) From: James Morris To: =?ISO-8859-15?Q?Micka=EBl_Sala=FCn?= , Jann Horn cc: "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, =?ISO-8859-15?Q?Micka=EBl_Sala=FCn?= Subject: Re: [PATCH v24 02/12] landlock: Add ruleset and domain management In-Reply-To: <20201112205141.775752-3-mic@digikod.net> Message-ID: References: <20201112205141.775752-1-mic@digikod.net> <20201112205141.775752-3-mic@digikod.net> User-Agent: Alpine 2.21 (LRH 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1665246916-1401825409-1605837159=:15634" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1665246916-1401825409-1605837159=:15634 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Thu, 12 Nov 2020, Mickaël Salaün wrote: > Cc: James Morris > Cc: Jann Horn > Cc: Kees Cook > Cc: Serge E. Hallyn > Signed-off-by: Mickaël Salaün > --- > > Changes since v23: > * Always intersect access rights. Following the filesystem change > logic, make ruleset updates more consistent by always intersecting > access rights (boolean AND) instead of combining them (boolean OR) for > the same layer. This defensive approach could also help avoid user > space to inadvertently allow multiple access rights for the same > object (e.g. write and execute access on a path hierarchy) instead of > dealing with such inconsistency. This can happen when there is no > deduplication of objects (e.g. paths and underlying inodes) whereas > they get different access rights with landlock_add_rule(2). > * Add extra checks to make sure that: > - there is always an (allocated) object in each used rules; > - when updating a ruleset with a new rule (i.e. not merging two > rulesets), the ruleset doesn't contain multiple layers. > * Hide merge parameter from the public landlock_insert_rule() API. This > helps avoid misuse of this function. > * Replace a remaining hardcoded 1 with SINGLE_DEPTH_NESTING. Jann: any chance you could review this patch again given the changes above? Thanks. -- James Morris --1665246916-1401825409-1605837159=:15634--