Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3599136pxj; Tue, 11 May 2021 07:56:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5cuJrOoCY0f/Z+2HHOQrhuZ9FtBths+4S8Kszn1ZCzc2qraUt49J/a0EK+i/Y986HV71k X-Received: by 2002:a17:906:590b:: with SMTP id h11mr32200585ejq.147.1620745017489; Tue, 11 May 2021 07:56:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620745017; cv=none; d=google.com; s=arc-20160816; b=bgRVrDqi3anx0ecxnFZcEtYn0FApbQwU+eIZVbce9nsSaiZqCOuO0Bxd27VziC39UO 5Ala8WX9rWFT2gKWFJ1aZz9+fuyt8aKQXaM/VLMGmtduIFymv8Qc/e4MirVPFGLqEGdt i7nrQ8ynZE4/QshYV7fl8CGtHbAiebQpVByHB3HO551DUZmvVYZK8y9AWckAfZPf+4+7 GUmFY1+1J2EAXMbAvo34xkXDR8ZPDcHgt/26fhbjjU0ELLiiW9BOK6LJ3Ao7pbcKyppH ly6s327yM7FvlI9wQuXoFFXvVnbQCtpOu0mQ6H436ToJwM6mgK3bnYxYK9IcdmftI2Bs HPJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=N9Vlgz1bslZCOekK5U+cWJtkOSyaJjHr0/BBWuxuGRo=; b=xk/b2/TsyJ6xz3kpO5jN0UPzQ0kI9mi145z2liQ1ynHGm6bCee1lS11Bo/Ri4xqyhP 6dDO+BkxrP0Vu9FI5vN6lUI6gJyU5PJ5GilpjIMaCBAS34ElJznuV2zTwSeZKqyEiC6k KmiS2q1xtUwCdJtR/5mAr1fnnkpX2lYZ8yF/LwNna6r4KoqRKs0MERYWQjrH7h8ZfxXb GvfrOB98TXQu8cYXHslFg19kr396bWK6hmMiU5DyldNlc9kQfbtpSpD0VGCn6oIm/Jlq 04iZGen1TwJ8z33GFpJR3ODtirbzbTsNsTLS3hEFoOMJO57Du1HOwEVsA5JTouUd13DF 3vBw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si886044edn.564.2021.05.11.07.56.32; Tue, 11 May 2021 07:56:57 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231808AbhEKO4S convert rfc822-to-8bit (ORCPT + 99 others); Tue, 11 May 2021 10:56:18 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3062 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231643AbhEKO4L (ORCPT ); Tue, 11 May 2021 10:56:11 -0400 Received: from fraeml713-chm.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Ffgf63p4gz6wkjh; Tue, 11 May 2021 22:43:42 +0800 (CST) Received: from fraeml714-chm.china.huawei.com (10.206.15.33) by fraeml713-chm.china.huawei.com (10.206.15.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 11 May 2021 16:54:58 +0200 Received: from fraeml714-chm.china.huawei.com ([10.206.15.33]) by fraeml714-chm.china.huawei.com ([10.206.15.33]) with mapi id 15.01.2176.012; Tue, 11 May 2021 16:54:58 +0200 From: Roberto Sassu To: Mimi Zohar , "mjg59@google.com" CC: "linux-integrity@vger.kernel.org" , "linux-security-module@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Christian Brauner , Andreas Gruenbacher , kernel test robot Subject: RE: [PATCH v6 08/11] evm: Allow setxattr() and setattr() for unmodified metadata Thread-Topic: [PATCH v6 08/11] evm: Allow setxattr() and setattr() for unmodified metadata Thread-Index: AQHXQaKHvFPvOA7oV0m5qAvk17yFuareOl6AgAAjMeD//+TqAIAAInMw Date: Tue, 11 May 2021 14:54:58 +0000 Message-ID: <0d0fcd3619e64bb9aaf1656ef066d043@huawei.com> References: <20210505112935.1410679-1-roberto.sassu@huawei.com> <20210505113329.1410943-4-roberto.sassu@huawei.com> <735bae46f0772b40ef6ecfb3c6fe0267b3ebbee8.camel@linux.ibm.com> <1a5d2a37be31f7971374c01ed8e799e003c96f9d.camel@linux.ibm.com> In-Reply-To: <1a5d2a37be31f7971374c01ed8e799e003c96f9d.camel@linux.ibm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.221.98.153] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Mimi Zohar [mailto:zohar@linux.ibm.com] > Sent: Tuesday, May 11, 2021 4:41 PM > On Tue, 2021-05-11 at 14:21 +0000, Roberto Sassu wrote: > > > > > > On Wed, 2021-05-05 at 13:33 +0200, Roberto Sassu wrote: > > > > With the patch to allow xattr/attr operations if a portable signature > > > > verification fails, cp and tar can copy all xattrs/attrs so that at the > > > > end of the process verification succeeds. > > > > > > > > However, it might happen that the xattrs/attrs are already set to the > > > > correct value (taken at signing time) and signature verification succeeds > > > > before the copy has completed. For example, an archive might contains > files > > > > owned by root and the archive is extracted by root. > > > > > > > > Then, since portable signatures are immutable, all subsequent operations > > > > fail (e.g. fchown()), even if the operation is legitimate (does not alter > > > > the current value). > > > > > > > > This patch avoids this problem by reporting successful operation to user > > > > space when that operation does not alter the current value of > xattrs/attrs. > > > > > > I must be missing something. If both the IMA and EVM status flags are > > > reset after xattr or attr modification, do we really need to prevent > > > any metadata - same or different - changes? Both evm_protect_xattr() > > > and evm_inode_setattr() would need to be modified to allow > > > INTEGRITY_PASS_IMMUTABLE. > > > > yes, given that the IMA and EVM flags are reset, it should not be > > a problem to allow changes. However, I think it is useful to keep > > the current behavior. For example, it would prevent an accidental > > change of the SELinux label during the relabeling process. > > I understand we might want to prevent accidental or malicious changes, > but that isn't the purpose of this patch set. The patch description > would also need to be updated to reflect the real purpose. We would be changing the expectation that metadata changes are denied, which was defined with the original patches. I would prefer to keep the current behavior, but if your suggestion is to allow metadata changes, I will modify the patch set. Roberto HUAWEI TECHNOLOGIES Duesseldorf GmbH, HRB 56063 Managing Director: Li Peng, Li Jian, Shi Yanli > thanks, > > Mimi