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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BF4EC6379F for ; Mon, 20 Feb 2023 09:50:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230235AbjBTJu2 (ORCPT ); Mon, 20 Feb 2023 04:50:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbjBTJu1 (ORCPT ); Mon, 20 Feb 2023 04:50:27 -0500 Received: from frasgout12.his.huawei.com (frasgout12.his.huawei.com [14.137.139.154]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A05D3EF9A; Mon, 20 Feb 2023 01:50:25 -0800 (PST) Received: from mail02.huawei.com (unknown [172.18.147.227]) by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4PKy9T11bDz9xtV3; Mon, 20 Feb 2023 17:41:33 +0800 (CST) Received: from roberto-ThinkStation-P620 (unknown [10.204.63.22]) by APP1 (Coremail) with SMTP id LxC2BwC3QAw4QvNjBIw5AQ--.54153S2; Mon, 20 Feb 2023 10:49:55 +0100 (CET) Message-ID: Subject: Re: [PATCH v7 6/6] evm: Support multiple LSMs providing an xattr From: Roberto Sassu To: Mimi Zohar , mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, dmitry.kasatkin@gmail.com, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, stephen.smalley.work@gmail.com, eparis@parisplace.org, casey@schaufler-ca.com Cc: ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-kernel@vger.kernel.org, keescook@chromium.org, nicolas.bouchinet@clip-os.org, Roberto Sassu Date: Mon, 20 Feb 2023 10:49:37 +0100 In-Reply-To: <1f252850086a39e3c15736f252600d388f6b9c24.camel@linux.ibm.com> References: <20221201104125.919483-1-roberto.sassu@huaweicloud.com> <20221201104125.919483-7-roberto.sassu@huaweicloud.com> <1f252850086a39e3c15736f252600d388f6b9c24.camel@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-CM-TRANSID: LxC2BwC3QAw4QvNjBIw5AQ--.54153S2 X-Coremail-Antispam: 1UD129KBjvJXoW7Aw4rGr45WF1DGr1xKF4xtFb_yoW8GrWDpF WfG3W2vF1kJF1xGry3ZayxZayfKrW8Gr43Xws0yw15ArnxCr1akrySkF43uFyUurWUJasY va1jkFnxZ3Z8Aa7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUk0b4IE77IF4wAFF20E14v26ryj6rWUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4 vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xIIjxv20xvEc7Cj xVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIEc7CjxV AFwI0_Gr0_Gr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40E x7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x 0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lFIxGxcIEc7CjxVA2Y2ka0xkIwI1l42xK82IYc2Ij 64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x 8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r4a6rW5MIIYrxkI7VAKI48JMIIF0xvE 2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42 xK8VAvwI8IcIk0rVWrJr0_WFyUJwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv 6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUFDGOUUUUU X-CM-SenderInfo: purev21wro2thvvxqx5xdzvxpfor3voofrz/1tbiAgAOBF1jj4UwqgABsn X-CFilter-Loop: Reflected Precedence: bulk List-ID: On Sun, 2023-02-19 at 14:42 -0500, Mimi Zohar wrote: > On Thu, 2022-12-01 at 11:41 +0100, Roberto Sassu wrote: > > From: Roberto Sassu > > > > Currently, evm_inode_init_security() processes a single LSM xattr from > > the array passed by security_inode_init_security(), and calculates the > > HMAC on it and other inode metadata. > > > > Given that initxattrs() callbacks, called by > > security_inode_init_security(), expect that this array is terminated when > > the xattr name is set to NULL, reuse the same assumption to scan all xattrs > > and to calculate the HMAC on all of them. > > > > Signed-off-by: Roberto Sassu > > Reviewed-by: Casey Schaufler > > Normally changing the contents of the EVM HMAC calculation would break > existing systems. Assuming for the time being this is safe, at what > point will it affect backwards compatability? Should it be documented > now or then? Actually, the current patch set continues to fullfill user space expectation on the EVM behavior. If the LSM infrastructure created more xattrs and EVM calculated the HMAC on just one, there would be a problem on subsequent xattr operations and on IMA verification. By updating both the LSM infrastructure and EVM to support multiple xattrs, everything will continue to work. Thanks Roberto