* [PATCH] KEYS: checking the input id parameters before finding asymmetric key
@ 2017-10-04 8:45 ` Lee, Chun-Yi
0 siblings, 0 replies; 2+ messages in thread
From: Lee, Chun-Yi @ 2017-10-04 8:45 UTC (permalink / raw)
To: David Howells
Cc: keyrings, linux-crypto, linux-kernel, Lee, Chun-Yi, Herbert Xu,
David S. Miller
For finding asymmetric key, the input id_0 and id_1 parameters can
not be NULL at the same time. This patch adds the BUG_ON checking
for id_0 and id_1.
Cc: David Howells <dhowells@redhat.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: "Lee, Chun-Yi" <jlee@suse.com>
---
crypto/asymmetric_keys/asymmetric_type.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/crypto/asymmetric_keys/asymmetric_type.c b/crypto/asymmetric_keys/asymmetric_type.c
index e4b0ed3..3a3b028 100644
--- a/crypto/asymmetric_keys/asymmetric_type.c
+++ b/crypto/asymmetric_keys/asymmetric_type.c
@@ -57,6 +57,8 @@ struct key *find_asymmetric_key(struct key *keyring,
char *req, *p;
int len;
+ BUG_ON(!id_0 && !id_1);
+
if (id_0) {
lookup = id_0->data;
len = id_0->len;
--
2.10.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] KEYS: checking the input id parameters before finding asymmetric key
@ 2017-10-04 8:45 ` Lee, Chun-Yi
0 siblings, 0 replies; 2+ messages in thread
From: Lee, Chun-Yi @ 2017-10-04 8:45 UTC (permalink / raw)
To: David Howells
Cc: keyrings, linux-crypto, linux-kernel, Lee, Chun-Yi, Herbert Xu,
David S. Miller
For finding asymmetric key, the input id_0 and id_1 parameters can
not be NULL at the same time. This patch adds the BUG_ON checking
for id_0 and id_1.
Cc: David Howells <dhowells@redhat.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: "Lee, Chun-Yi" <jlee@suse.com>
---
crypto/asymmetric_keys/asymmetric_type.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/crypto/asymmetric_keys/asymmetric_type.c b/crypto/asymmetric_keys/asymmetric_type.c
index e4b0ed3..3a3b028 100644
--- a/crypto/asymmetric_keys/asymmetric_type.c
+++ b/crypto/asymmetric_keys/asymmetric_type.c
@@ -57,6 +57,8 @@ struct key *find_asymmetric_key(struct key *keyring,
char *req, *p;
int len;
+ BUG_ON(!id_0 && !id_1);
+
if (id_0) {
lookup = id_0->data;
len = id_0->len;
--
2.10.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-04 8:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-04 8:45 [PATCH] KEYS: checking the input id parameters before finding asymmetric key Lee, Chun-Yi
2017-10-04 8:45 ` Lee, Chun-Yi
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.