Skip to contentSkip to conversation

KEYS: Return more accurate error codes

PATCH In review David Howells 3 participants 3 messages May 17, 2010 – May 24, 2010

Subsystems (2)
lore
Share & tools
lore

David Howells

author maintainer
#0 lore raw

PATCH 1/1 KEYS: Return more accurate error codes

From: Dan Carpenter <[email protected]>

We were using the wrong variable here so the error codes weren't being returned properly. The original code returns -ENOKEY.

---

 security/keys/process_keys.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
security/keys/process_keys.c +3 -3
index 06c2ccf..20a38fe 100644
@@ -508,7 +508,7 @@ try_again:
 
 			ret = install_thread_keyring();
 			if (ret < 0) {
-				key = ERR_PTR(ret);
+				key_ref = ERR_PTR(ret);
 				goto error;
 			}
 			goto reget_creds;
@@ -526,7 +526,7 @@ try_again:
 
 			ret = install_process_keyring();
 			if (ret < 0) {
-				key = ERR_PTR(ret);
+				key_ref = ERR_PTR(ret);
 				goto error;
 			}
 			goto reget_creds;
@@ -585,7 +585,7 @@ try_again:
 
 	case KEY_SPEC_GROUP_KEYRING:
 		/* group keyrings are not yet supported */
-		key = ERR_PTR(-EINVAL);
+		key_ref = ERR_PTR(-EINVAL);
 		goto error;
 
 	case KEY_SPEC_REQKEY_AUTH_KEY:
maintainer
#1 lore raw
Quoted 7 lines · David Howells

From: Dan Carpenter <[email protected]>

We were using the wrong variable here so the error codes weren't being returned properly. The original code returns -ENOKEY.

Queued for Linus -- is also likely a -stable candidate.

Quoted 37 lines

---

 security/keys/process_keys.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
security/keys/process_keys.c +3 -3
index 06c2ccf..20a38fe 100644
@@ -508,7 +508,7 @@ try_again:
 
 			ret = install_thread_keyring();
 			if (ret < 0) {
-				key = ERR_PTR(ret);
+				key_ref = ERR_PTR(ret);
 				goto error;
 			}
 			goto reget_creds;
@@ -526,7 +526,7 @@ try_again:
 
 			ret = install_process_keyring();
 			if (ret < 0) {
-				key = ERR_PTR(ret);
+				key_ref = ERR_PTR(ret);
 				goto error;
 			}
 			goto reget_creds;
@@ -585,7 +585,7 @@ try_again:
 
 	case KEY_SPEC_GROUP_KEYRING:
 		/* group keyrings are not yet supported */
-		key = ERR_PTR(-EINVAL);
+		key_ref = ERR_PTR(-EINVAL);
 		goto error;
 
 	case KEY_SPEC_REQKEY_AUTH_KEY:
Signature · 2 lines
James Morris
<[email protected]>
#2 lore raw
Quoted 11 lines · James Morris
Quoted 7 lines · David Howells

From: Dan Carpenter <[email protected]>

We were using the wrong variable here so the error codes weren't being returned properly. The original code returns -ENOKEY.

Queued for Linus -- is also likely a -stable candidate.

If so, please just put a:
Cc: stable <[email protected]>
to the signed-off-by area of the patch. That way I automatically get notified when it goes into Linus's tree, and I don't have to go dig and try to match up a random email reference like this one with the actual patch in Linus's tree...

thanks,

greg k-h