stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KEYS: trusted: Avoid calling null function trusted_key_exit
@ 2022-01-26 18:41 Dave Kleikamp
  2022-01-26 20:21 ` Jarkko Sakkinen
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Kleikamp @ 2022-01-26 18:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Sumit Garg, James Bottomley, Jarkko Sakkinen, Mimi Zohar,
	David Howells, James Morris, Serge E. Hallyn, linux-integrity,
	keyrings, linux-security-module, stable

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@oracle.com>
Cc: Sumit Garg <sumit.garg@linaro.org>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Mimi Zohar <zohar@linux.ibm.com>
Cc: David Howells <dhowells@redhat.com>
Cc: James Morris <jmorris@namei.org>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: linux-integrity@vger.kernel.org
Cc: keyrings@vger.kernel.org
Cc: linux-security-module@vger.kernel.org
Cc: stable@vger.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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] KEYS: trusted: Avoid calling null function trusted_key_exit
  2022-01-26 18:41 [PATCH] KEYS: trusted: Avoid calling null function trusted_key_exit Dave Kleikamp
@ 2022-01-26 20:21 ` Jarkko Sakkinen
  2022-02-07 17:40   ` Dave Kleikamp
  0 siblings, 1 reply; 4+ messages in thread
From: Jarkko Sakkinen @ 2022-01-26 20:21 UTC (permalink / raw)
  To: Dave Kleikamp
  Cc: linux-kernel, Sumit Garg, James Bottomley, Mimi Zohar,
	David Howells, James Morris, Serge E. Hallyn, linux-integrity,
	keyrings, linux-security-module, stable

On Wed, Jan 26, 2022 at 12:41:55PM -0600, Dave Kleikamp wrote:
> 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@oracle.com>

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

BR, Jarkko

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] KEYS: trusted: Avoid calling null function trusted_key_exit
  2022-01-26 20:21 ` Jarkko Sakkinen
@ 2022-02-07 17:40   ` Dave Kleikamp
  2022-02-21  1:57     ` Jarkko Sakkinen
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Kleikamp @ 2022-02-07 17:40 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: linux-kernel, Sumit Garg, James Bottomley, Mimi Zohar,
	David Howells, James Morris, Serge E. Hallyn, linux-integrity,
	keyrings, linux-security-module, stable

On 1/26/22 2:21PM, Jarkko Sakkinen wrote:
> On Wed, Jan 26, 2022 at 12:41:55PM -0600, Dave Kleikamp wrote:
>> 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@oracle.com>
> 
> 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

> 
> BR, Jarkko

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] KEYS: trusted: Avoid calling null function trusted_key_exit
  2022-02-07 17:40   ` Dave Kleikamp
@ 2022-02-21  1:57     ` Jarkko Sakkinen
  0 siblings, 0 replies; 4+ messages in thread
From: Jarkko Sakkinen @ 2022-02-21  1:57 UTC (permalink / raw)
  To: Dave Kleikamp
  Cc: linux-kernel, Sumit Garg, James Bottomley, Mimi Zohar,
	David Howells, James Morris, Serge E. Hallyn, linux-integrity,
	keyrings, linux-security-module, stable

On Mon, Feb 07, 2022 at 11:40:23AM -0600, Dave Kleikamp wrote:
> On 1/26/22 2:21PM, Jarkko Sakkinen wrote:
> > On Wed, Jan 26, 2022 at 12:41:55PM -0600, Dave Kleikamp wrote:
> > > 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@oracle.com>
> > 
> > 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-21  1:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 18:41 [PATCH] KEYS: trusted: Avoid calling null function trusted_key_exit Dave Kleikamp
2022-01-26 20:21 ` Jarkko Sakkinen
2022-02-07 17:40   ` Dave Kleikamp
2022-02-21  1:57     ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).