Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp22481rdb; Wed, 7 Feb 2024 19:31:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtjF4vx6J4P3ix0zMTPG4l63JLere/CVDWq/jsw4ir/bercedELwSKlU5AHQJnEojFjh6G X-Received: by 2002:a92:d6cc:0:b0:363:bfc7:74b1 with SMTP id z12-20020a92d6cc000000b00363bfc774b1mr7452188ilp.32.1707363072103; Wed, 07 Feb 2024 19:31:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707363072; cv=pass; d=google.com; s=arc-20160816; b=QIWwmpMDIp7rWs50r/fVmHvAC35Et4KmjjKsiq8nGdu/EUXYQVFgsW3TuHdByaYrVT MxWCHKtQIEeXibWepTdXrBJz4gQ72tvF0CXXRBZsCsfJ9NrVYKrN4/PR5YJtjYDvmpkT to3bJI/WPGS/t1E2yZ9gZRKV7VNCAcms8QIpIFLTdGhmQ+QF837ZkfJ4ck6g90fMqfjb ZnTL8yytf92ORoPW79p2xMzyag1aZ3SXCeOd9A5IMI7PNnjuMbiJXlqeRUxuRVnP+kPP NhBo2BxsEREHp4s5AI9T9Qsg2wmdb/fJ/pjGrRR1l30sO8HWf0BPKy4uJhBJbsh1pSCV xixQ== 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=7jlGv8JHUSR10sS3dfCJsrgR+VqC9NQSIZQ6VcWAY+8=; fh=1eFeEmxj8RiFWI3R6TbyKTZd4Ep5xsA/hDLv40klEbo=; b=HQuytO/vAstYxYojlEj/pRKb3swiKiprKgkcMeltW5SQ9ekg+mSHTAVYWo9Nf7Tl6f gfCnpzVGESxwp5khq9VakRCXOXNHfTSEAyaD3ED33IlFxQKnX//mwE0jWc5sihCVqZCB htDwRayoKt69m5vbza8uHOQiQxXx6BVKFtlMqhzkLDQT4jAeb2i12beHKvIxxFYuoYxT +Q++NTmLwWgsT69U6QRXkQnKQm5sQWVVJrtnXG0upPf+h6PaoU4AnLP800oj31K/frhv FclJtkENk63ENBB8sbIw7URWhtMfdQbL1pjdo+n9UU/huZjmA+ZlQ1/M3rUMtneSywEQ ij5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=MEZRjnfC; 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-1851-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1851-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; AJvYcCXZVpQii3H+E6H3mcK0wkr0ucDnWBeAwY3avWdJB8VgrvGryFVc9kFhh4DVoarVMQt5/2ODHaT3FWHkKqyVeeJ+ZCU1yto7zn/bJnG6Og== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t23-20020a63b257000000b005dbcfec59a8si3021870pgo.632.2024.02.07.19.31.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 19:31:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-1851-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=MEZRjnfC; 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-1851-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-1851-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 17216B21810 for ; Thu, 8 Feb 2024 03:24:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 246543BB5E; Thu, 8 Feb 2024 03:19:00 +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="MEZRjnfC" X-Original-To: linux-nfs@vger.kernel.org Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (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 BECAC1D526 for ; Thu, 8 Feb 2024 03:18:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707362339; cv=none; b=AO8N+fmfLqyvqZSf2geFoMsKvlkXr15XgqSJB80e9xrek4acBEC3ldZwWI+XfqPCElLxR78KQvZExe8mLhwQjH+vJDJ6Lj1Ik7lO9t7Dl9k8WpoAMrRqpbcK0Iq5BrMTsJuGA17deQ3K1NsuDVsGiL64NTeuhyAnHXMuKBpGiCI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707362339; c=relaxed/simple; bh=QxXYto16RKwpKe0WAuqyyFSv8bZEk+rYAhFfJZDWHpc=; h=Date:Message-ID:MIME-Version:Content-Type:Content-Disposition: From:To:Cc:Subject:References:In-Reply-To; b=Ai716PqG2pk76vuDzherQmCh0MIrAWB62z9QGXVN+/m6gfe6HqUqCq4IkSebpKQLEgqrzmAL8WPfLYBRZRmyzYN8R4cod3mTx8ZKk6yrEMD/HljfQ5K4k8hXcjkMnS2et1npbSLjTZUX0h/E4uCIY0unEGU4qwMGOaPSuYtFmHY= 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=MEZRjnfC; arc=none smtp.client-ip=209.85.219.51 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-qv1-f51.google.com with SMTP id 6a1803df08f44-68c8790aeadso9324396d6.1 for ; Wed, 07 Feb 2024 19:18:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1707362331; x=1707967131; 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=7jlGv8JHUSR10sS3dfCJsrgR+VqC9NQSIZQ6VcWAY+8=; b=MEZRjnfCzlNL1kxcTjyVoRyMIz7o3KzC5/e53Ha+GSsH2L7wfAjXQNocGT6106lLik DxWhr+cpIUfMub7P6whw+/YZrAGS9XmHG8OclvqoFLP7J6YAVmM74HayHuhIuWURtRTl cXXKowO0eMnF3SMIJGfHm5lmGKEWgGmWQ7uIoo8Efl2xWd/Ii+D+hXMjjGFrggZ/iZO2 g4yaGFsyRY0k4cbtEf8/0o+rCvCOs+GVcp41sE8mm6AMqZQlKQgHh2nEG5yWS9yHuIhw LE3CScm9hAx5qLy1uIaUbWGqohN09i2UWt/tLXCs8jfgh+Tjfw+cloL1acBdkAGQPE2F lXxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707362331; x=1707967131; 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=7jlGv8JHUSR10sS3dfCJsrgR+VqC9NQSIZQ6VcWAY+8=; b=TWPyLjkYivDq379gS6+WAV+Td9jxuT27/LY8lsjcT7A526zk3AQYVYul4CFm+qwr/h v7mBxhnTXwb8//5tZGg+cfXPmFKhR9Cp/cxmDVzErPtJ/Pnp7Zr2l0EtJ5o6GDon0T7h DagNKBiXwsd7+koUlIDeP/EJadrpf1LRntMp57UN35TLRgppWbXimuY5edLGiuTAvDNL 77zS9mWyLBrsaOCWti8eT8T/4XZKcA7Wn4MO6LNrQ5VlNBEq8rm2WkPasWnXLi/in3Y5 zaX4H+lnc4OX0l42BNR4dzc77rah/I6Xd/Lu69ezBKOQV+hOu8IjjVB2wGHywaeeYauh Oopw== X-Gm-Message-State: AOJu0YyRdGHPdm+a0UH55vE7ryBSZ9vt/WP1nwCnTFR4XSNx73mKAvHB loPlu16LSqWKU9XGDxF6yNlZ01T712ESqZE8HWH3pO8FDRdu7LKudsWIoizd7A== X-Received: by 2002:a0c:dd08:0:b0:68c:a6e2:d2e1 with SMTP id u8-20020a0cdd08000000b0068ca6e2d2e1mr6625187qvk.46.1707362331602; Wed, 07 Feb 2024 19:18:51 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWXMo0UYophNRTNvt8tfg3/HdVHpjmGmQ9deqmf1QT63LWvT9XuJx4IN6kMOJQHpDxnE+SCJZihnmMuwpbfMdrFe1qIry7MoLQFoikl8h7+eoUpf0tXm0LzAFKRA1mlQyhEUfHznsAeKFZCWmKwrrRBtIb2pkjyYI6eL2vNxFc1VweebpAwHJcxTSvSmZ5PmBmx6zPfUtPKgKF4+H/VAX8cHRgRAWjvLDBYoREEajIQ694zSjS2B/PvhKlNVdWjy6zpBftKImqq4ZmTNrTPQHF9FADXzRkvV9LLJGoiJebz6aUfB6EaDxpG4xpZfQ3uKDO3QLssEmIwaavR61GyE+l+u/KUyB2mSjql2h+ArY966oAO4hQDSe3htEkkxUYxv1WbOsuSl7ueC6IfFF4aRitSWncPeJIZBif+95SS/0HjyE62Uc2vBfVdJ53vy0cJkvGjcsVPdFeMfodBemTrAbt6Pg7UbpOoz8/SYDI6yTV9QENb4t9Z+taGPZ0AtMGFwxcaeT3yR5cTpVZhn0COFFDnedFyn0cm4ALJTMTo+nj94EXf/1w9w81cM5Ntd3cGHlOgcK/iHzP7D7+C2L1sw8At+KciSyy6xpM24PONb3jMniSWcd6j/EUhsXb/LYWWOeIzxmADrVE6KZl+kf2S2URIvfRzz/hPmxgPv51zV2zoGLMcnwjQV3cRmcGeGeY7KoXuU+Q+vi5IX91HDFNFUQ4izsCzLrqeFzWz4tC7qa0u0HUVzXZoDlCgJcaNg6T60+5LUKFmjNQeIvzEvAxfAw1EUtQWwO/10mGohm4atXzXp7JQq/+V7J36s7weZF/OBdtucnJ0YqnjgqaBpBzKYzsRUyA+LyTVcDuQruFJrMkdvrMKuC744DjCud0pmJjahAnZgWHARp5WH099cN6lKiePaVe7kji+xCkGEFeOetSYC461b89f Received: from localhost ([70.22.175.108]) by smtp.gmail.com with ESMTPSA id oi8-20020a05621443c800b0068cc16f33c4sm835291qvb.80.2024.02.07.19.18.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 19:18:51 -0800 (PST) Date: Wed, 07 Feb 2024 22:18:50 -0500 Message-ID: <1b538d1a73fd542c8463c398232091d5@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 19/25] integrity: Move integrity_kernel_module_request() to IMA References: <20240115181809.885385-20-roberto.sassu@huaweicloud.com> In-Reply-To: <20240115181809.885385-20-roberto.sassu@huaweicloud.com> On Jan 15, 2024 Roberto Sassu wrote: > > In preparation for removing the 'integrity' LSM, move > integrity_kernel_module_request() to IMA, and rename it to > ima_kernel_module_request(). > > Compile it conditionally if CONFIG_INTEGRITY_ASYMMETRIC_KEYS is enabled, > and call it from security.c (removed afterwards with the move of IMA to the > LSM infrastructure). > > Adding this hook cannot be avoided, since IMA has no control on the flags > passed to crypto_alloc_sig() in public_key_verify_signature(), and thus > cannot pass CRYPTO_NOLOAD, which solved the problem for EVM hashing with > commit e2861fa71641 ("evm: Don't deadlock if a crypto algorithm is > unavailable"). > > EVM alone does not need to implement this hook, first because there is no > mutex to deadlock, and second because even if it had it, there should be a > recursive call. However, since verification from EVM can be initiated only > by setting inode metadata, deadlock would occur if modprobe would do the > same while loading a kernel module (which is unlikely). > > Signed-off-by: Roberto Sassu > --- > include/linux/ima.h | 10 +++++++++ > include/linux/integrity.h | 13 ------------ > security/integrity/digsig_asymmetric.c | 23 -------------------- > security/integrity/ima/ima_main.c | 29 ++++++++++++++++++++++++++ > security/security.c | 2 +- > 5 files changed, 40 insertions(+), 37 deletions(-) Acked-by: Paul Moore -- paul-moore.com