Re: [PATCH v6 1/9] keys/trusted_keys: propagate wrapping key generation errors

From
Srish Srinivasan <ssrish@linux.ibm.com>
Date
2026-11-10 03:35:54
Also in
keyrings, linux-integrity, linux-security-module, lkml, stable
Reply to
Jarkko Sakkinen, 2026-11-05
Hi Jarkko,
Thanks for taking a look.

On 11/5/26 10:41 PM, Jarkko Sakkinen wrote:
On Thu, Nov 05, 2026 at 08:13:12PM +0530, Srish Srinivasan wrote:
quoted
plpks_gen_wrapping_key() returns a negative errno when default wrapping key
generation fails. However, trusted_pkwm_init() returns -EINVAL for all such
failures, discarding the original error.

Propagate the error returned by plpks_gen_wrapping_key() unchanged.

Fixes: c99fcb0d735b ("keys/trusted_keys: establish PKWM as a trusted source")
Cc: <redacted> # 7.0
Signed-off-by: Srish Srinivasan <ssrish@linux.ibm.com>
Tested-by: R Nageswara Sastry <redacted>
Nit: I'd put the SOB as last.

Sure, I will make this change.

quoted
---
  security/keys/trusted-keys/trusted_pkwm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/keys/trusted-keys/trusted_pkwm.c b/security/keys/trusted-keys/trusted_pkwm.c
index bf42c6679245..422f752598e1 100644
--- a/security/keys/trusted-keys/trusted_pkwm.c
+++ b/security/keys/trusted-keys/trusted_pkwm.c
@@ -170,7 +170,7 @@ static int trusted_pkwm_init(void)
  	ret = plpks_gen_wrapping_key();
  	if (ret) {
  		pr_err("Failed to generate default wrapping key\n");
-		return -EINVAL;
+		return ret;
  	}
  
  	return register_key_type(&key_type_trusted);
-- 
2.52.0
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

Thank you for the Rb.

Br, Jarkko

Thanks,
Srish.

Thread (14 messages) 14 messages, 2 authors, last reply 12d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help