[PATCH v11 3/6] s390/cert_store: Skip keys that disappeared during invalidation

Jarkko Sakkinen jarkko at kernel.org
Sat Nov 14 16:12:08 UTC 2026


key_lookup() can return NULL for an unlinked key. Skip such keys instead.

Cc: David Howells <dhowells at redhat.com>
Cc: stable at vger.kernel.org # v6.6+
Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates")
Signed-off-by: Jarkko Sakkinen <jarkko at kernel.org>
---
 arch/s390/kernel/cert_store.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/s390/kernel/cert_store.c b/arch/s390/kernel/cert_store.c
index 0a10b31d68af..bc682216fa7f 100644
--- a/arch/s390/kernel/cert_store.c
+++ b/arch/s390/kernel/cert_store.c
@@ -333,6 +333,9 @@ static int invalidate_keyring_keys(struct key *keyring)
 
 	for (key_index = 0; key_index < num_keys; key_index++) {
 		current_key = key_lookup(key_array[key_index]);
+		if (!current_key)
+			continue;
+
 		pr_dbf_msg("Invalidating key %08x", current_key->serial);
 
 		key_invalidate(current_key);
-- 
2.47.3




More information about the Linux-security-module-archive mailing list