Skip to contentSkip to conversation

KEYS: trusted: Avoid calling null function trusted_key_exit

PATCH Applied Dave Kleikamp 2 participants 4 messages Jan 26, 2022 – Feb 21, 2022

Subsystems (4)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
Cc Sumit Garg <[email protected]>
Cc James Bottomley <[email protected]>
Cc Jarkko Sakkinen <[email protected]>
Cc Mimi Zohar <[email protected]>
Cc David Howells <[email protected]>
Cc James Morris <[email protected]>
Cc "Serge E. Hallyn" <[email protected]>
---
 security/keys/trusted-keys/trusted_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/keys/trusted-keys/trusted_core.c +1 -1
index d5c891d8d353..8c14e04e2112 100644
@@ -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);
Signature · 1 line
2.35.0
maintainer
#1 lore raw
Quoted 6 lines · Dave Kleikamp

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")

Please re-send with cc stable and the empty line removed and I'll pick it.

BR, Jarkko

#2 lore raw
Quoted 9 lines · Jarkko Sakkinen
Quoted 6 lines · Dave Kleikamp

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")

Please re-send with cc stable and the empty line removed and I'll pick it.

I re-sent a v2, but haven't seen any response from you.

I can send it again, or feel free to clean up those lines yourself.

Thanks,
Shaggy

Quoted 2 lines

BR, Jarkko

maintainer Applied
#3 lore raw
Quoted 9 lines · Dave Kleikamp
Quoted 8 lines · Jarkko Sakkinen
Quoted 6 lines · Dave Kleikamp

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")
Quoted 8 lines
Quoted 1 line

Please re-send with cc stable and the empty line removed and I'll pick it.

I re-sent a v2, but haven't seen any response from you.

I can send it again, or feel free to clean up those lines yourself.

Thanks,
Shaggy

I've applied the patch. Thank you, and apologies for the latency.

BR, Jarkko