Skip to content

Commit

Permalink
KEYS: trusted: Avoid calling null function trusted_key_exit
Browse files Browse the repository at this point in the history
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: 5d0682b ("KEYS: trusted: Add generic trusted keys framework")
Signed-off-by: Dave Kleikamp <[email protected]>
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]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Reviewed-by: Jarkko Sakkinen <[email protected]>
Signed-off-by: Jarkko Sakkinen <[email protected]>
  • Loading branch information
kleikamp authored and jarkkojs committed Mar 8, 2022
1 parent 969a264 commit c5d1ed8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/keys/trusted-keys/trusted_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c5d1ed8

Please sign in to comment.