]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
keys: Grant Link permission to possessers of request_key auth keys
authorDavid Howells <dhowells@redhat.com>
Mon, 20 May 2019 20:51:43 +0000 (21:51 +0100)
committerDavid Howells <dhowells@redhat.com>
Thu, 30 May 2019 21:54:43 +0000 (22:54 +0100)
Grant Link permission to the possessers of request_key authentication keys,
thereby allowing a daemon that is servicing upcalls to arrange things such
that only the necessary auth key is passed to the actual service program
and not all the daemon's pending auth keys.

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
security/keys/request_key_auth.c

index 572c7a60473a535bd412fc691585a7c08f0bbb38..ec5226557023159a3d39857335b43f72754ed421 100644 (file)
@@ -204,7 +204,7 @@ struct key *request_key_auth_new(struct key *target, const char *op,
 
        authkey = key_alloc(&key_type_request_key_auth, desc,
                            cred->fsuid, cred->fsgid, cred,
-                           KEY_POS_VIEW | KEY_POS_READ | KEY_POS_SEARCH |
+                           KEY_POS_VIEW | KEY_POS_READ | KEY_POS_SEARCH | KEY_POS_LINK |
                            KEY_USR_VIEW, KEY_ALLOC_NOT_IN_QUOTA, NULL);
        if (IS_ERR(authkey)) {
                ret = PTR_ERR(authkey);