From nobody Sat Feb 7 07:12:01 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2149238F225; Tue, 13 Jan 2026 12:37:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768307867; cv=none; b=JE85qp0j3he9c4Gk37vpzdnnTgtptqU6t+ABu+9PPwHL3wU6ByhQfg2gx6IC8LR3RQGr5SHvcazwSUs4ggcT7p/vU2UOAU3szcrkGFnDC5FhkZmSorJmfrQKCYuYeXN8jpKJjTUyTLIAPEv/AE7amcNRqdHNzwvaiNmkh7Nv/q8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768307867; c=relaxed/simple; bh=3mMY1GM1VQS8nWhP55kjhRmx1RnZj3EJmp3vjjgzg8M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=b0zVOnlEvyDXwXDmmy5movXenHs4Yge/6PyZ35V9jpWIMCHd/QOVpIMvBky8hkZP4C/k/ilAqZHbTQSIKulbopqBIl1fP4muyGHcRT2bZVnSFmohpEa8KsxNhS98DmsWbJzPLKdtRmGe8BIAbDjLq9vxDUxeaK3Eq3OfC74Rydc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=rKo9Ainu; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="rKo9Ainu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1768307859; bh=3mMY1GM1VQS8nWhP55kjhRmx1RnZj3EJmp3vjjgzg8M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=rKo9Ainu3XohS3vDOhDSBVDMKqoArsw3k6VH6Rq2OcD6WPWA0c6vsb0GoDtVSXluv sgo/XicYHPxC7xBe5EgzHnfehmzjKt4EAac0PhhkT1cn/koDo8ejH70xmQx3KomGYL /OfN167o6WiGNK2fmRsgBoWzSVQABRqeZL7Ntj6U= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 13 Jan 2026 13:28:45 +0100 Subject: [PATCH v4 01/17] module: Only declare set_module_sig_enforced when CONFIG_MODULE_SIG=y Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260113-module-hashes-v4-1-0b932db9b56b@weissschuh.net> References: <20260113-module-hashes-v4-0-0b932db9b56b@weissschuh.net> In-Reply-To: <20260113-module-hashes-v4-0-0b932db9b56b@weissschuh.net> To: Nathan Chancellor , Arnd Bergmann , Luis Chamberlain , Petr Pavlu , Sami Tolvanen , Daniel Gomez , Paul Moore , James Morris , "Serge E. Hallyn" , Jonathan Corbet , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Naveen N Rao , Mimi Zohar , Roberto Sassu , Dmitry Kasatkin , Eric Snowberg , Nicolas Schier , Daniel Gomez , Aaron Tomlin , "Christophe Leroy (CS GROUP)" , Nicolas Schier , Nicolas Bouchinet , Xiu Jianfeng , Nicolas Schier , Christophe Leroy Cc: =?utf-8?q?Fabian_Gr=C3=BCnbichler?= , Arnout Engelen , Mattia Rizzolo , kpcyrd , Christian Heusel , =?utf-8?q?C=C3=A2ju_Mihai-Drosi?= , Sebastian Andrzej Siewior , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-modules@vger.kernel.org, linux-security-module@vger.kernel.org, linux-doc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-integrity@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Coiby Xu , kernel test robot X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768307859; l=2701; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=LKgyKjITAXJ1z3S+DyfR5AT2mA+k6KdtH/VMhlJUCys=; b=5Saf759AOy7OgxG9vCafXOFEi9YsNl9IxQ4NXimYkvoPD101bf62Qlcvkk3kzegkDK+79KIxZ R78B0PNlMSPDAG06hzuwwcndV6Fs1j6RV8THFOsAFuXJ+B/Q/fJxYAR X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= From: Coiby Xu Currently if set_module_sig_enforced is called with CONFIG_MODULE_SIG=3Dn e.g. [1], it can lead to a linking error, ld: security/integrity/ima/ima_appraise.o: in function `ima_appraise_me= asurement': security/integrity/ima/ima_appraise.c:587:(.text+0xbbb): undefined refe= rence to `set_module_sig_enforced' This happens because the actual implementation of set_module_sig_enforced comes from CONFIG_MODULE_SIG but both the function declaration and the empty stub definition are tied to CONFIG_MODULES. So bind set_module_sig_enforced to CONFIG_MODULE_SIG instead. This allows (future) users to call set_module_sig_enforced directly without the "if IS_ENABLED(CONFIG_MODULE_SIG)" safeguard. Note this issue hasn't caused a real problem because all current callers of set_module_sig_enforced e.g. security/integrity/ima/ima_efi.c use "if IS_ENABLED(CONFIG_MODULE_SIG)" safeguard. [1] https://lore.kernel.org/lkml/20250928030358.3873311-1-coxu@redhat.com/ Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202510030029.VRKgik99-lkp@int= el.com/ Reviewed-by: Aaron Tomlin Reviewed-by: Daniel Gomez Signed-off-by: Coiby Xu Signed-off-by: Sami Tolvanen --- From modules/modules-next --- include/linux/module.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index d80c3ea57472..f288ca5cd95b 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -770,8 +770,6 @@ static inline bool is_livepatch_module(struct module *m= od) #endif } =20 -void set_module_sig_enforced(void); - void module_for_each_mod(int(*func)(struct module *mod, void *data), void = *data); =20 #else /* !CONFIG_MODULES... */ @@ -866,10 +864,6 @@ static inline bool module_requested_async_probing(stru= ct module *module) } =20 =20 -static inline void set_module_sig_enforced(void) -{ -} - /* Dereference module function descriptor */ static inline void *dereference_module_function_descriptor(struct module *mod, void *ptr) @@ -925,6 +919,8 @@ static inline bool retpoline_module_ok(bool has_retpoli= ne) #ifdef CONFIG_MODULE_SIG bool is_module_sig_enforced(void); =20 +void set_module_sig_enforced(void); + static inline bool module_sig_ok(struct module *module) { return module->sig_ok; @@ -935,6 +931,10 @@ static inline bool is_module_sig_enforced(void) return false; } =20 +static inline void set_module_sig_enforced(void) +{ +} + static inline bool module_sig_ok(struct module *module) { return true; --=20 2.52.0