From: Chun-Yi Lee Date: Wed, 4 Oct 2017 08:45:09 +0000 (+0800) Subject: KEYS: checking the input id parameters before finding asymmetric key X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b3811d36a3e7e7e8ed660bf01151496cf99cf9ed;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git KEYS: checking the input id parameters before finding asymmetric key 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 Cc: Herbert Xu Cc: "David S. Miller" Signed-off-by: Chun-Yi Lee Signed-off-by: David Howells --- diff --git a/crypto/asymmetric_keys/asymmetric_type.c b/crypto/asymmetric_keys/asymmetric_type.c index a597f5c5a222..39aecad286fe 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;