Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

keys: ensure that ->match_free() is called in request_key_and_link()

If check_cached_key() returns a non-NULL value, we still need to call
key_type::match_free() to undo key_type::match_preparse().

Fixes: 7743c48e54ee ("keys: Cache result of request_key*() temporarily in task_struct")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Eric Biggers and committed by
Linus Torvalds
846d2db3 e8d6766f

+1 -1
+1 -1
security/keys/request_key.c
··· 595 595 596 596 key = check_cached_key(&ctx); 597 597 if (key) 598 - return key; 598 + goto error_free; 599 599 600 600 /* search all the process keyrings for a key */ 601 601 rcu_read_lock();