lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220126184155.220814-1-dave.kleikamp@oracle.com>
Date:   Wed, 26 Jan 2022 12:41:55 -0600
From:   Dave Kleikamp <dave.kleikamp@...cle.com>
To:     linux-kernel@...r.kernel.org
Cc:     Sumit Garg <sumit.garg@...aro.org>,
        James Bottomley <jejb@...ux.ibm.com>,
        Jarkko Sakkinen <jarkko@...nel.org>,
        Mimi Zohar <zohar@...ux.ibm.com>,
        David Howells <dhowells@...hat.com>,
        James Morris <jmorris@...ei.org>,
        "Serge E. Hallyn" <serge@...lyn.com>,
        linux-integrity@...r.kernel.org, keyrings@...r.kernel.org,
        linux-security-module@...r.kernel.org, stable@...r.kernel.org
Subject: [PATCH] KEYS: trusted: Avoid calling null function trusted_key_exit

If one loads and unloads the trusted module, trusted_key_exit can be
NULL. Call it through static_call_cond() to avoid a kernel trap.

Fixes: 5d0682be3189 ("KEYS: trusted: Add generic trusted keys framework")

Signed-off-by: Dave Kleikamp <dave.kleikamp@...cle.com>
Cc: Sumit Garg <sumit.garg@...aro.org>
Cc: James Bottomley <jejb@...ux.ibm.com>
Cc: Jarkko Sakkinen <jarkko@...nel.org>
Cc: Mimi Zohar <zohar@...ux.ibm.com>
Cc: David Howells <dhowells@...hat.com>
Cc: James Morris <jmorris@...ei.org>
Cc: "Serge E. Hallyn" <serge@...lyn.com>
Cc: linux-integrity@...r.kernel.org
Cc: keyrings@...r.kernel.org
Cc: linux-security-module@...r.kernel.org
Cc: stable@...r.kernel.org
---
 security/keys/trusted-keys/trusted_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/keys/trusted-keys/trusted_core.c b/security/keys/trusted-keys/trusted_core.c
index d5c891d8d353..8c14e04e2112 100644
--- a/security/keys/trusted-keys/trusted_core.c
+++ b/security/keys/trusted-keys/trusted_core.c
@@ -351,7 +351,7 @@ static int __init init_trusted(void)
 
 static void __exit cleanup_trusted(void)
 {
-	static_call(trusted_key_exit)();
+	static_call_cond(trusted_key_exit)();
 }
 
 late_initcall(init_trusted);
-- 
2.35.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ