Skip to contentSkip to conversation

KEYS: asymmetric: return ENOMEM if akcipher_request_alloc() fails

PATCH RESEND Applied Eric Biggers 3 participants 9 messages May 29, 2019 – Dec 12, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 KEYS: asymmetric: return ENOMEM if akcipher_request_alloc() fails

From: Eric Biggers <[email protected]>

No error code was being set on this error path.

Fixes ad4b1eb5fb33 ("KEYS: asym_tpm: Implement encryption operation [ver #2]")
Fixes c08fed737126 ("KEYS: Implement encrypt, decrypt and sign for software asymmetric key [ver #2]")
---
 crypto/asymmetric_keys/asym_tpm.c   | 1 +
 crypto/asymmetric_keys/public_key.c | 1 +
 2 files changed, 2 insertions(+)
crypto/asymmetric_keys/asym_tpm.c +1 -0
index 76d2ce3a1b5b1..5154e280ada22 100644
@@ -486,6 +486,7 @@ static int tpm_key_encrypt(struct tpm_key *tk,
 	if (ret < 0)
 		goto error_free_tfm;
 
+	ret = -ENOMEM;
 	req = akcipher_request_alloc(tfm, GFP_KERNEL);
 	if (!req)
 		goto error_free_tfm;
crypto/asymmetric_keys/public_key.c +1 -0
index 364b9df9d631f..d7f43d4ea925a 100644
@@ -184,6 +184,7 @@ static int software_key_eds_op(struct kernel_pkey_params *params,
 	if (IS_ERR(tfm))
 		return PTR_ERR(tfm);
 
+	ret = -ENOMEM;
 	req = akcipher_request_alloc(tfm, GFP_KERNEL);
 	if (!req)
 		goto error_free_tfm;
Signature · 1 line
2.22.0.rc1.257.g3120a18244-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Eric Biggers

From: Eric Biggers <[email protected]>

No error code was being set on this error path.

Fixes ad4b1eb5fb33 ("KEYS: asym_tpm: Implement encryption operation [ver #2]")
Fixes c08fed737126 ("KEYS: Implement encrypt, decrypt and sign for software asymmetric key [ver #2]")
Signature · 2 lines
James Morris
<[email protected]>
#2 lore raw

PATCH RESEND 1/1 KEYS: asymmetric: return ENOMEM if akcipher_request_alloc() fails

In reply to Eric Biggers

From: Eric Biggers <[email protected]>

No error code was being set on this error path.

Fixes ad4b1eb5fb33 ("KEYS: asym_tpm: Implement encryption operation [ver #2]")
Fixes c08fed737126 ("KEYS: Implement encrypt, decrypt and sign for software asymmetric key [ver #2]")
---
 crypto/asymmetric_keys/asym_tpm.c   | 1 +
 crypto/asymmetric_keys/public_key.c | 1 +
 2 files changed, 2 insertions(+)
crypto/asymmetric_keys/asym_tpm.c +1 -0
index 76d2ce3a1b5b..5154e280ada2 100644
@@ -486,6 +486,7 @@ static int tpm_key_encrypt(struct tpm_key *tk,
 	if (ret < 0)
 		goto error_free_tfm;
 
+	ret = -ENOMEM;
 	req = akcipher_request_alloc(tfm, GFP_KERNEL);
 	if (!req)
 		goto error_free_tfm;
crypto/asymmetric_keys/public_key.c +1 -0
index 364b9df9d631..d7f43d4ea925 100644
@@ -184,6 +184,7 @@ static int software_key_eds_op(struct kernel_pkey_params *params,
 	if (IS_ERR(tfm))
 		return PTR_ERR(tfm);
 
+	ret = -ENOMEM;
 	req = akcipher_request_alloc(tfm, GFP_KERNEL);
 	if (!req)
 		goto error_free_tfm;
Signature · 1 line
2.22.1
#3 lore raw

PATCH RESEND 1/1 KEYS: asymmetric: return ENOMEM if akcipher_request_alloc() fails

In reply to Eric Biggers

From: Eric Biggers <[email protected]>

No error code was being set on this error path.

Fixes ad4b1eb5fb33 ("KEYS: asym_tpm: Implement encryption operation [ver #2]")
Fixes c08fed737126 ("KEYS: Implement encrypt, decrypt and sign for software asymmetric key [ver #2]")
---
 crypto/asymmetric_keys/asym_tpm.c   | 1 +
 crypto/asymmetric_keys/public_key.c | 1 +
 2 files changed, 2 insertions(+)
crypto/asymmetric_keys/asym_tpm.c +1 -0
index 76d2ce3a1b5b1..5154e280ada22 100644
@@ -486,6 +486,7 @@ static int tpm_key_encrypt(struct tpm_key *tk,
 	if (ret < 0)
 		goto error_free_tfm;
 
+	ret = -ENOMEM;
 	req = akcipher_request_alloc(tfm, GFP_KERNEL);
 	if (!req)
 		goto error_free_tfm;
crypto/asymmetric_keys/public_key.c +1 -0
index 364b9df9d631f..d7f43d4ea925a 100644
@@ -184,6 +184,7 @@ static int software_key_eds_op(struct kernel_pkey_params *params,
 	if (IS_ERR(tfm))
 		return PTR_ERR(tfm);
 
+	ret = -ENOMEM;
 	req = akcipher_request_alloc(tfm, GFP_KERNEL);
 	if (!req)
 		goto error_free_tfm;
Signature · 1 line
2.23.0.581.g78d2f28ef7-goog
Reviewed-by on v1 1/1
#4 lore raw
In reply to Eric Biggers
Quoted 8 lines · Eric Biggers

From: Eric Biggers <[email protected]>

No error code was being set on this error path.

Fixes ad4b1eb5fb33 ("KEYS: asym_tpm: Implement encryption operation [ver #2]")
Fixes c08fed737126 ("KEYS: Implement encrypt, decrypt and sign for software asymmetric key [ver #2]")

I can pick this up to my tree given the TPM association. David?

/Jarkko

#5 lore raw
In reply to Eric Biggers
Quoted 10 lines · Jarkko Sakkinen
Quoted 8 lines · Eric Biggers

From: Eric Biggers <[email protected]>

No error code was being set on this error path.

Fixes ad4b1eb5fb33 ("KEYS: asym_tpm: Implement encryption operation [ver #2]")
Fixes c08fed737126 ("KEYS: Implement encrypt, decrypt and sign for software asymmetric key [ver #2]")
Quoted 6 lines

I can pick this up to my tree given the TPM association. David?

/Jarkko

Ping.

#6 lore raw
In reply to Eric Biggers
Quoted 11 lines · Eric Biggers
Quoted 10 lines · Jarkko Sakkinen
Quoted 8 lines · Eric Biggers

From: Eric Biggers <[email protected]>

No error code was being set on this error path.

Fixes ad4b1eb5fb33 ("KEYS: asym_tpm: Implement encryption operation [ver #2]")
Fixes c08fed737126 ("KEYS: Implement encrypt, decrypt and sign for software asymmetric key [ver #2]")
Quoted 8 lines
Quoted 6 lines

I can pick this up to my tree given the TPM association. David?

/Jarkko

Ping.

I can pick this up to my v5.5-rc2 PR (already sent one for rc1).

/Jarkko

#7 lore raw
In reply to Eric Biggers
Quoted 17 lines · Jarkko Sakkinen
Quoted 16 lines · Eric Biggers
Quoted 15 lines · Jarkko Sakkinen
Quoted 8 lines · Eric Biggers

From: Eric Biggers <[email protected]>

No error code was being set on this error path.

Fixes ad4b1eb5fb33 ("KEYS: asym_tpm: Implement encryption operation [ver #2]")
Fixes c08fed737126 ("KEYS: Implement encrypt, decrypt and sign for software asymmetric key [ver #2]")

I can pick this up to my tree given the TPM association. David?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

/Jarkko

Ping.

I can pick this up to my v5.5-rc2 PR (already sent one for rc1).

/Jarkko

Ping.

#8 lore raw
In reply to Eric Biggers
Quoted 8 lines · Eric Biggers

From: Eric Biggers <[email protected]>

No error code was being set on this error path.

Fixes ad4b1eb5fb33 ("KEYS: asym_tpm: Implement encryption operation [ver #2]")
Fixes c08fed737126 ("KEYS: Implement encrypt, decrypt and sign for software asymmetric key [ver #2]")

Applied to git://git.infradead.org/users/jjs/linux-tpmdd.git

/Jarkko