]> asedeno.scripts.mit.edu Git - linux.git/commit
keys: Reuse keyring_index_key::desc_len in lookup_user_key()
authorEric Biggers <ebiggers@google.com>
Wed, 29 May 2019 21:01:52 +0000 (14:01 -0700)
committerDavid Howells <dhowells@redhat.com>
Thu, 30 May 2019 21:54:43 +0000 (22:54 +0100)
commit47546208657f28007f41574c2d27a3fe760f987d
treed6186a25fdd0cc9ee0c9a8249221a5806dc2fbd9
parentf7f1394576563b7096fe858fb178bcaedfa0b245
keys: Reuse keyring_index_key::desc_len in lookup_user_key()

When lookup_user_key() checks whether the key is possessed, it should
use the key's existing index_key including the 'desc_len' field, rather
than recomputing the 'desc_len'.  This doesn't change the behavior; this
way is just simpler and faster.

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