Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6390179rwl; Tue, 4 Apr 2023 11:57:08 -0700 (PDT) X-Google-Smtp-Source: AKy350a4zKn9ylk/H8NOH0jWkcVDQjE64LEFbzIeQkhuLU1MsMoZNcGHT0JyUGM7xF/RHIPz4W5j X-Received: by 2002:a17:902:fa47:b0:1a1:bcf:db5f with SMTP id lb7-20020a170902fa4700b001a10bcfdb5fmr3173521plb.25.1680634628674; Tue, 04 Apr 2023 11:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680634628; cv=none; d=google.com; s=arc-20160816; b=RBiN6/RQJjpaUElgC++WQGz/hjS0WrEMgOw6sb+6bPTCQ2jxUNOXk678R5sUeluXKE 1nIzuMtW7og70bJZpPBlUZU46ScWRl3qzTCOQQtjvG381V9IGMalDW/9P9tnqyZCTTQw w2gBclZy0onojKznAfSijdnTiNHid5olFiR7Nn22oB6/pKxGm1OeXAGRV3Rb8wwE3OOR XxFyIyN2AZ1vf0ezWc9UARscb/6M7akuADy1iGXpHOqi4Ox6WRTtBCOE5heYLXOK/fSF Sq+fp2a1WxHC3TZmpvk9YxBhILFPkaYaAM0DWKkiRNhEnQh7WrRswBDqht0/yVwzksDE gVzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=yuYMP9oERucJ/O/ah5M668zvZcUxIDKJFH+6ndYhYhw=; b=qHyklv2sYzIOWZDJb5KLAAUaKYeZ61vOHA5Y7kINC5ADEZjzpV2mQeJfOAN2VApt7N 283ft7jwwbE16BdwG4PjdUo68Iw0ewaVIl0uuaTlvaRf9gezHjgiIwSwiZ3jgYSEgmPa cBSNt8RbhClI1+PWWcUjOFlH5J2ebS+MLFIBhGQkhOZTD7XAYNpuFDZDzMUMgcBbtYgJ +QkVXlUi/45osQ+XiGIIvcYA1onLcxfoeREZgL0TOFnYHtasxW0MUSD9EYPMoxpSS48z 5XX74BP2RAb5KSMHbTRoS0NDFTjX+sI3EAYvYY0QHztavDYc9L+MKaM2wrgMZER9siL9 9gsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=PQaRIIZk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s9-20020a63f049000000b0050fad17282dsi11015658pgj.217.2023.04.04.11.56.57; Tue, 04 Apr 2023 11:57:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=PQaRIIZk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236087AbjDDS4e (ORCPT + 99 others); Tue, 4 Apr 2023 14:56:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236056AbjDDS4a (ORCPT ); Tue, 4 Apr 2023 14:56:30 -0400 Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0B063A92 for ; Tue, 4 Apr 2023 11:56:28 -0700 (PDT) Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-54184571389so633358677b3.4 for ; Tue, 04 Apr 2023 11:56:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1680634588; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=yuYMP9oERucJ/O/ah5M668zvZcUxIDKJFH+6ndYhYhw=; b=PQaRIIZkpGihz6wkjt6tSlzCY4838BGeVloFrkgUy+TiPjGJbg3Xju0fSOz0ugEkLa 4M8JsBMaHjY8ojIZiBKrw25TFChUm/J4/9aimvN5zAF5yyzAJlL2UfxkMYrv/zAJW/nA jwyh8THBan3RpnhNHPD9gjX0xuKBf51UcePGUO7o0LaDMyF74f8YReyFbAXUUPkQpImX DC76fVSQD8bpquZb3y4h8S8ed1r8VitaUMVJbkb5wVqkWxpxh/fzAO9pT/D1XDoekIuz qjzS8hMqbNGhmWQaD035n8+tMbSOtDVlAbMYXFICMdWGmUL28QNylVAGMUDdcFBiprXN MQSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680634588; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yuYMP9oERucJ/O/ah5M668zvZcUxIDKJFH+6ndYhYhw=; b=Ry6X0Mc+JLDIUwip25zHe39pcslKPxaKwuD5MX2CfWOasGIPt+FDC0a47rlnC8P312 OaiVhYye9m35rXvsyrvx2VkVoVixuBlTqmNWkyInXyEpvMBG3TL2q945QsnMd0FXG5yR v0w2eR6B599QsNUVSohvOsfDr8T5c99EAdmGYW8jc7NKTN9EJyzeG4PmFq2wPR0G26eT VnbpZBv0JK+mRy6zlkPogYTPFAxlCf0oCXJZJL3rGvOtjZf1A6yZuaE4JZCWH4dOAcup zxOnpgs9lCuiwWvvWvpLd0J34zsx408nLD/UGkiFekBsyFZO+cYdxpo9RYwVGuvBdmmG pqVg== X-Gm-Message-State: AAQBX9fFdsr+qvE+M4hanxRZ2/DB1gZkPSZBzJeMo4Anu9naJTtGRzfv s++62ZlphvxuiW6zVB4uN6pOvmdM+ViHgUT6/e4+ X-Received: by 2002:a81:b389:0:b0:544:cd0e:2f80 with SMTP id r131-20020a81b389000000b00544cd0e2f80mr1986292ywh.8.1680634587849; Tue, 04 Apr 2023 11:56:27 -0700 (PDT) MIME-Version: 1.0 References: <20230331123221.3273328-1-roberto.sassu@huaweicloud.com> <20230331123221.3273328-4-roberto.sassu@huaweicloud.com> In-Reply-To: <20230331123221.3273328-4-roberto.sassu@huaweicloud.com> From: Paul Moore Date: Tue, 4 Apr 2023 14:56:17 -0400 Message-ID: Subject: Re: [PATCH v10 3/4] evm: Align evm_inode_init_security() definition with LSM infrastructure To: Roberto Sassu Cc: zohar@linux.ibm.com, dmitry.kasatkin@gmail.com, jmorris@namei.org, serge@hallyn.com, stephen.smalley.work@gmail.com, eparis@parisplace.org, casey@schaufler-ca.com, reiserfs-devel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, bpf@vger.kernel.org, kpsingh@kernel.org, keescook@chromium.org, nicolas.bouchinet@clip-os.org, Roberto Sassu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 31, 2023 at 8:33=E2=80=AFAM Roberto Sassu wrote: > > From: Roberto Sassu > > Change the evm_inode_init_security() definition to align with the LSM > infrastructure. Keep the existing behavior of including in the HMAC > calculation only the first xattr provided by LSMs. > > Changing the evm_inode_init_security() definition requires passing the > xattr array allocated by security_inode_init_security(), and the number o= f > xattrs filled by previously invoked LSMs. > > Use the newly introduced lsm_get_xattr_slot() to position EVM correctly i= n > the xattrs array, like a regular LSM, and to increment the number of fill= ed > slots. For now, the LSM infrastructure allocates enough xattrs slots to > store the EVM xattr, without using the reservation mechanism. > > Signed-off-by: Roberto Sassu > --- > include/linux/evm.h | 13 +++++++------ > security/integrity/evm/evm_main.c | 16 ++++++++++------ > security/security.c | 6 +++--- > 3 files changed, 20 insertions(+), 15 deletions(-) This seems reasonable to me, but I'll want to see a sign-off from Mimi for the EVM bits. Same thing for patch 4/4. --=20 paul-moore.com