* [PATCH] keys: ensure that ->match_free() is called in request_key_and_link()
@ 2019-08-22 15:29 Eric Biggers
2019-08-30 15:52 ` David Howells
0 siblings, 1 reply; 3+ messages in thread
From: Eric Biggers @ 2019-08-22 15:29 UTC (permalink / raw)
To: keyrings
From: Eric Biggers <ebiggers@google.com>
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>
---
security/keys/request_key.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/keys/request_key.c b/security/keys/request_key.c
index 46c5187ce03f..6d628a5a8d10 100644
--- a/security/keys/request_key.c
+++ b/security/keys/request_key.c
@@ -589,7 +589,7 @@ struct key *request_key_and_link(struct key_type *type,
key = check_cached_key(&ctx);
if (key)
- return key;
+ goto error_free;
/* search all the process keyrings for a key */
rcu_read_lock();
--
2.22.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] keys: ensure that ->match_free() is called in request_key_and_link()
@ 2019-08-30 15:52 ` David Howells
0 siblings, 0 replies; 3+ messages in thread
From: David Howells @ 2019-08-30 15:52 UTC (permalink / raw)
To: torvalds
Cc: Eric Biggers, dhowells, keyrings, linux-security-module,
linux-kernel
From: Eric Biggers <ebiggers@google.com>
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>
---
security/keys/request_key.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/keys/request_key.c b/security/keys/request_key.c
index 7325f382dbf4..957b9e3e1492 100644
--- a/security/keys/request_key.c
+++ b/security/keys/request_key.c
@@ -595,7 +595,7 @@ struct key *request_key_and_link(struct key_type *type,
key = check_cached_key(&ctx);
if (key)
- return key;
+ goto error_free;
/* search all the process keyrings for a key */
rcu_read_lock();
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] keys: ensure that ->match_free() is called in request_key_and_link()
@ 2019-08-30 15:52 ` David Howells
0 siblings, 0 replies; 3+ messages in thread
From: David Howells @ 2019-08-30 15:52 UTC (permalink / raw)
To: torvalds
Cc: Eric Biggers, dhowells, keyrings, linux-security-module,
linux-kernel
From: Eric Biggers <ebiggers@google.com>
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>
---
security/keys/request_key.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/keys/request_key.c b/security/keys/request_key.c
index 7325f382dbf4..957b9e3e1492 100644
--- a/security/keys/request_key.c
+++ b/security/keys/request_key.c
@@ -595,7 +595,7 @@ struct key *request_key_and_link(struct key_type *type,
key = check_cached_key(&ctx);
if (key)
- return key;
+ goto error_free;
/* search all the process keyrings for a key */
rcu_read_lock();
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-08-30 15:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-22 15:29 [PATCH] keys: ensure that ->match_free() is called in request_key_and_link() Eric Biggers
2019-08-30 15:52 ` David Howells
2019-08-30 15:52 ` David Howells
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.