Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp315852pxj; Thu, 20 May 2021 09:58:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTPRbYRxaQmJ+k2FO3Ftd/8ejOaExpmQSuZzyR+OZNZPN05lqUu2+6MLeuJDZfwIqcgSOh X-Received: by 2002:a05:6e02:ea8:: with SMTP id u8mr6155626ilj.67.1621529886141; Thu, 20 May 2021 09:58:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621529886; cv=none; d=google.com; s=arc-20160816; b=SLQevILduAH3VygJYg8QceIj+WI0h2R4a9v30410NBtSbTA74f589mYBSED2mW1Pyc FRlGW5xotVn1IS9oaVWZl1aNKehlBPeuJ024FQI3LsSqy3EuS2qeX4wwWGizilsQxCTB uuPfd9j/wVhEL9eT7PyJwbQ+D+Qx+J6S307PU3QoEu4hGWhDi6fxOSCBwGU+I3mJEdMD WwyJSNtQfZhhSKuWJurWHyBi+CgFWXfxK306kxLUkL2pbEtLnKLIMk+rXkWU5QGXJR5x p6dW5x6W6Uvh3ckPqAiif1Z9HRSPghJWVJa07YeA9ikh5KoU1sRMUqj07xayV5F43/te Qfeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=4L+iVftLoIzDBYmBhpe9b+AVYbw2k47zSr8oAwADx64=; b=UGQQWItGXdrJSk2qC4LYR/xfZPPiBIQO62cPe+7iDPCEjtSGLr9UghMGF9wFKbeKIC k23A4qB0zEEwv8jd3uCrAupX/oVu3FIizU2x2yVMDfOM/yo8OnazDXvfkS2lItViwQ2+ LzoAWrumnWocVn/jSyCHOi9YLr5fXf9IbmkD/xCz7ke66eEDolbn7AueWgAr0Pyh04Cu LhOsNsMXZp0UoFE/hqXqR++qPP089TkCRbRUEQG/hVAvTZTsdKwOICndO2PoCeijnGHw rRTu9VSWEPjTyYEM2xkGuGBOCwfOzeLQIPP4ZmZftNxHo4SZ9F75hqh/AiXz3xUJ3vqp Zh7w== 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 p14si3502797ils.62.2021.05.20.09.57.52; Thu, 20 May 2021 09:58:06 -0700 (PDT) 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 S234532AbhETJ6p (ORCPT + 99 others); Thu, 20 May 2021 05:58:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:54742 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234898AbhETJzE (ORCPT ); Thu, 20 May 2021 05:55:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CC5CD613E1; Thu, 20 May 2021 09:37:02 +0000 (UTC) Date: Thu, 20 May 2021 11:36:59 +0200 From: Christian Brauner To: Roberto Sassu Cc: zohar@linux.ibm.com, mjg59@srcf.ucam.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/7] ima: Introduce template fields mntuidmap and mntgidmap Message-ID: <20210520093659.oeeytegx2tvzp33e@wittgenstein> References: <20210520085701.465369-1-roberto.sassu@huawei.com> <20210520085701.465369-4-roberto.sassu@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210520085701.465369-4-roberto.sassu@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 20, 2021 at 10:56:57AM +0200, Roberto Sassu wrote: > This patch introduces the new template fields mntuidmap and mntgidmap, > which include respectively the UID and GID mappings of the idmapped mount, > if the user namespace is not the initial one. > > These template fields, which should be included whenever the iuid and the > igid fields are included, allow remote verifiers to find the original UID > and GID of the inode during signature verification. The iuid and igid > fields include the mapped UID and GID when the inode is in an idmapped > mount. > > This solution has been preferred to providing always the original UID and > GID, regardless of whether the inode is in an idmapped mount or not, as > the mapped UID and GID are those seen by processes and matched with the IMA > policy. Hm, looking at the code this doesn't seem like a good idea to me. I think we should avoid that and just rely on the original uid and gid.