Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp23872rdb; Wed, 7 Feb 2024 19:35:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IHgmATOcbyrHP4xvW2YQyYbx6YkBAN8nTZ+9JRJrkHqLoAn5e2Kt+4+hJ4DipDoDnOGlgFm X-Received: by 2002:a05:6122:4216:b0:4c0:e4d:6b2 with SMTP id cm22-20020a056122421600b004c00e4d06b2mr5029958vkb.8.1707363315618; Wed, 07 Feb 2024 19:35:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707363315; cv=pass; d=google.com; s=arc-20160816; b=lxwchLm/eXG+sMncuyUjI5qDE39BQSeqGwv7KBopxJv2479YAQlceRVGJjiHYOaD/t xMiVtGo0ObEUA/v32pWFGRf6RJefLB5yZ3EFDqCqdDJkxbihIui3kQ1Bcb1usGGqb4PW XelO0UvkP5yKi+nMVugjb+uIlhPwLey1Vp3kDuDI2Tyc7DGNNKn3yGarW/rmu06kf47v rsepJ7RAKrx7XcsW1p86ukgmFfnypDHaBmjfnghSViW3o6MUfz/AlHq1WndKj2ZUkpxk udkxPD0crWmZ3UwieiaBnc2Aaq0hT9GRo+9fBYy6/eUehGoXyAsHv56N80Oe2K09m4Xf qT7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:date:dkim-signature; bh=otFcps0stZB4weUc21xAn/KKbQgQbMJ9m7dxETe93ls=; fh=8YmiWi7mFQlbyxkQXs1K9XwjnhidqGhmn16bxbI/YW0=; b=i6Ha2FGEnGZMi8VAiZddzjA0h/g5/Vy/ky9StFLLaOZ67jk1FqtqXGnZ0IRyJaxZUj do8oaOOMau1reUJjPadnJnHitwVPCcPnxFqH+6LCZkyrXG+72IVCvk+W3UkHfv2GsFS7 pra7EBwDOvBeJ7dwjTvqRO3PGz00Z52viboYG50dNjl9o5acc06IqwGFTC4FvEv3QarV CB6RSB6JMsc76YDmjCYJQPs1jxrmH0JIvC2AL4Wal2swsJlWwDNogU2XgAYeGnuQJcC0 W12w+FLp7G7osq0EsB7qHKn2NyCHv+cBpLmzacfcrEHKAJ+Io5Wl742JNbRzYcUzHnPK FETw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b="acyS8Z/R"; arc=pass (i=1 spf=pass spfdomain=paul-moore.com dkim=pass dkdomain=paul-moore.com dmarc=pass fromdomain=paul-moore.com); spf=pass (google.com: domain of linux-nfs+bounces-1852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1852-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com X-Forwarded-Encrypted: i=2; AJvYcCW7aYopyIw2H+4Hx+eSmpurbI5qy4w+iehftzYFS9L3UzXr5D6FKVWE943hsuZhSO+kwcR2WNeEvnIOvNXawsdTcrna77AV68vzEVh2Xg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y13-20020a0cec0d000000b0068cb7c04c0csi2473680qvo.186.2024.02.07.19.35.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 19:35:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b="acyS8Z/R"; arc=pass (i=1 spf=pass spfdomain=paul-moore.com dkim=pass dkdomain=paul-moore.com dmarc=pass fromdomain=paul-moore.com); spf=pass (google.com: domain of linux-nfs+bounces-1852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1852-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2ED961C23F3C for ; Thu, 8 Feb 2024 03:25:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 41F1E3F9C4; Thu, 8 Feb 2024 03:19:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b="acyS8Z/R" X-Original-To: linux-nfs@vger.kernel.org Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 044AE3838F for ; Thu, 8 Feb 2024 03:18:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707362342; cv=none; b=ZPfinnTxTAORjoG4yc0A4YkRUFumr+6k1RE0hPywM3eQ1tdeEFlko4PwHo/gEf5AoOLScuzGJ3oQOtJIsIfQoWFddLRQ2TA+O/fE+F4X9eE1z9hRz3cnSp4JNTqkTBRW3QGQVu3EztTS9M2olBK3XQmqL8Y0WI9Y6Nq2/MWSohQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707362342; c=relaxed/simple; bh=GXUPBwjyTapvWjNtvBJBKoFYSFcsWJwH+eGj4SD5Q70=; h=Date:Message-ID:MIME-Version:Content-Type:Content-Disposition: From:To:Cc:Subject:References:In-Reply-To; b=A63nAtsVcJINEXd4XANL9z3+cIG4DMhZg3rBDZlbsQzeJxF4yUd/RQugxjPLZXEBRVsVCqE5urWREobUeyh1Inz2uwWwF2+z4aO+cC3Dqo3QkqzXGOuMcyrm/p7y+pHdmq88EUI4aSaLiArI8CidWRxcPLpK+p7utFlWwrr4WYw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com; spf=pass smtp.mailfrom=paul-moore.com; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b=acyS8Z/R; arc=none smtp.client-ip=209.85.160.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=paul-moore.com Received: by mail-qt1-f173.google.com with SMTP id d75a77b69052e-42a029c8e76so8294041cf.2 for ; Wed, 07 Feb 2024 19:18:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1707362334; x=1707967134; darn=vger.kernel.org; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :content-disposition:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=otFcps0stZB4weUc21xAn/KKbQgQbMJ9m7dxETe93ls=; b=acyS8Z/R0dIZh2wswvf1lWx1CspWtvaaeeEQnLFFQOYo/sptS81IGt/ltXbhMd2YQt Wq0LYq6i0fi3JLbcKsavndaGtsRcXGmRZx8nanIx+GVfARsqkIcyQShyM3cqMWVzm3h9 mqAbuD5yYHRnSAOMbCUU6rgDFoqCUmlAw2czFl6mIjP0yrRP7yFYfq9PI/guxg/Nprs3 1calN35kgJaeeFt2L8lj/eWXaopf+l4cToJ4gv//KlshW+RN8oNZjY2hC71vfkntzb10 VzCew6kVKGJ4WSYW2zonsLMVtxlIjuNDCYSw81eaf84pkYnsrqvdmG15Z3jPILdScTQB GQzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707362334; x=1707967134; h=in-reply-to:references:subject:cc:to:from:content-transfer-encoding :content-disposition:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=otFcps0stZB4weUc21xAn/KKbQgQbMJ9m7dxETe93ls=; b=c3rUxAYadW455uC84K3pdZgsChLnZUd6ar7uGL4+N9wpuB3YbyGw2B1Bw7ZZTJzhGD rbHZCpJizksKuEkzKpWtSb/W2WiJkjYNUd17BBRr9dL6v7FIGlaW9WKVGG1fFtsLSYXt v3iHDcf/fSYA4GVhHY9Ce+Hhn6AdTSLOExuz2d1ZpRtPcsdEIFxUMywWnwT0V0MONwJ1 xYrL0p07OSm5PeKkuTx0juo1bSfSHEzICbMXkuSSKt4O7O4LRkfK2m1GXmmnkjoZd7/4 M37lirFjMUWkfsYShaLcOFe62/3flmmbWyen46mbRYiPAWG6bL3HrX8ghCUHAUPg0wQm W5CQ== X-Gm-Message-State: AOJu0YxE8Jq1HqOtARzaeyEl7CJhdBLwXULTNYmpyPCCEzFViVYAnsdM QyNya+MXfxnS0pwTw6fnYM0kHh1SSUiBqdmHYKm2GRNEevGcVIQeciM4OQUj/g== X-Received: by 2002:a05:622a:1792:b0:42c:b22:adc9 with SMTP id s18-20020a05622a179200b0042c0b22adc9mr8878842qtk.17.1707362334418; Wed, 07 Feb 2024 19:18:54 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCX2SgqtyeXiRmraFSrm1+eGdFPAcILDt0E5xylLbpk4Pi8w1VK4WPvznufD108x+ZbDZUBSLiAYLOZ7ApTPH8K4po/ppreHz7WEwVjACdXoMMqO3PseGP/7ykN5TTJnpON+fslpE4zGsLYwOleANje1kGpMswXeREKcLFWgS75g6zxYbJqnUv/bi5JpCMW7IIzyqYHwG2gZNu+mVvjlrXLBog/82+mlPN7PM8KD/GpXhPv30Z/UZiQqMd8+GQTJUa7gd9OVrlr+8WhwM1ft0jOic2h2eT0T1pGZhzw57uy0oMm2n15wjGiBhhtuvkmyojFWSJ+778gaI76IHTlkxvQpGuu4lqGW1GxUwGWvx5VxpvHtSOy3mG7cdiLJ6yNJRzudwuY1LOYKCkyIZwSJC9eEs8uD2T7XYxKMjt68Vg2KYCyUY1+ZmhNd6WsdwayeEmpk2wDZ6vVLk6X6AeTDoiGmC0ToyJMVtPWV8znKT5cbhVddtpRHduAVJUZlAuaTl8wdb/Sl7VDzM0QDaHBQDEYi9sy9WdVRdIprMksHzvEsulbekjXa7Ttt3+jeiNuGZtyvAkK4jNUgF8gdJMSK4s0jtXEC3ezFJWihgleEqrvQ+ryyFaC333diwEVO6FrxH7uRjglu6iYshOeJPlxh0jrsMea+z7nslMo6YkAIFjIoSCbGVqb5Fl57uD9k/SipBrXILQHqQHCm7eQ+nocR6TkanmfRD4Ym+yMPzVVOO8WHqGtvXAqj/eIYT5pM9owBnDlHA//SjiC5nv4byvbO3AbMPXEJcaqNYJ8rr2H8qKyfWMhp37kWzmcSRBQRXS/RhK0sITI5lKrJGoOTE3S7sB3YfRIIKm5dp2YBDAcs+53VQcqmUdpJBPCcVVlIKJE95Id9/KYGLD2TKkZuZblCuTWhf+DuPCOeD62w/NVpXWNLveCMoIZ+ Received: from localhost ([70.22.175.108]) by smtp.gmail.com with ESMTPSA id g3-20020ac84803000000b00429bd898838sm1062943qtq.47.2024.02.07.19.18.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 19:18:54 -0800 (PST) Date: Wed, 07 Feb 2024 22:18:53 -0500 Message-ID: <4e96a5f2552a51e386f327689f64dae0@paul-moore.com> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit From: Paul Moore To: Roberto Sassu , viro@zeniv.linux.org.uk, brauner@kernel.org, chuck.lever@oracle.com, jlayton@kernel.org, neilb@suse.de, kolga@netapp.com, Dai.Ngo@oracle.com, tom@talpey.com, jmorris@namei.org, serge@hallyn.com, zohar@linux.ibm.com, dmitry.kasatkin@gmail.com, eric.snowberg@oracle.com, dhowells@redhat.com, jarkko@kernel.org, stephen.smalley.work@gmail.com, eparis@parisplace.org, casey@schaufler-ca.com, shuah@kernel.org, mic@digikod.net Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-security-module@vger.kernel.org, linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, selinux@vger.kernel.org, linux-kselftest@vger.kernel.org, Roberto Sassu Subject: Re: [PATCH v9 22/25] evm: Move to LSM infrastructure References: <20240115181809.885385-23-roberto.sassu@huaweicloud.com> In-Reply-To: <20240115181809.885385-23-roberto.sassu@huaweicloud.com> On Jan 15, 2024 Roberto Sassu wrote: > > As for IMA, move hardcoded EVM function calls from various places in the > kernel to the LSM infrastructure, by introducing a new LSM named 'evm' > (last and always enabled like 'ima'). The order in the Makefile ensures > that 'evm' hooks are executed after 'ima' ones. Let's add a comment to the Makefile about this so everyone knows not to mix up the ordering, otherwise this looks good to me. At some point I think we may want to introduce the concept of numerical priorities to security_add_hooks() to add some additional granularity beyond the LSM_ORDER_XXX priority, but that is something we can do later. Acked-by: Paul Moore > Make EVM functions as static (except for evm_inode_init_security(), which > is exported), and register them as hook implementations in init_evm_lsm(). > Also move the inline functions evm_inode_remove_acl(), > evm_inode_post_remove_acl(), and evm_inode_post_set_acl() from the public > evm.h header to evm_main.c. > > Unlike before (see commit to move IMA to the LSM infrastructure), > evm_inode_post_setattr(), evm_inode_post_set_acl(), > evm_inode_post_remove_acl(), and evm_inode_post_removexattr() are not > executed for private inodes. > > Finally, add the LSM_ID_EVM case in lsm_list_modules_test.c > > Signed-off-by: Roberto Sassu > Reviewed-by: Casey Schaufler > --- > fs/attr.c | 2 - > fs/posix_acl.c | 3 - > fs/xattr.c | 2 - > include/linux/evm.h | 113 ----------------- > include/uapi/linux/lsm.h | 1 + > security/integrity/evm/evm_main.c | 118 +++++++++++++++--- > security/security.c | 43 ++----- > .../selftests/lsm/lsm_list_modules_test.c | 3 + > 8 files changed, 116 insertions(+), 169 deletions(-) -- paul-moore.com