summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorMathias Krause <minipli@googlemail.com>2016-06-22 20:29:37 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2016-06-23 17:39:25 +0800
commitaf900a7ee6a17784a9a343421ef0e3fe67f264fc (patch)
treeff7e7dfaa359a90ecd085887f53d9c7b38b0004e /crypto
parentb415b57f7e77e032c4c6174b47eb658d19c8b36e (diff)
downloadlinux-crypto-af900a7ee6a17784a9a343421ef0e3fe67f264fc.tar.gz
linux-crypto-af900a7ee6a17784a9a343421ef0e3fe67f264fc.zip
crypto: user - re-add size check for CRYPTO_MSG_GETALG
Commit 95c2e811146e ("crypto: user - Add CRYPTO_MSG_DELRNG") accidentally removed the minimum size check for CRYPTO_MSG_GETALG netlink messages. This allows userland to send a truncated CRYPTO_MSG_GETALG message as short as a netlink header only making crypto_report() operate on uninitialized memory by accessing data beyond the end of the netlink message. Fix this be re-adding the minimum required size of CRYPTO_MSG_GETALG messages to the crypto_msg_min[] array. Fixes: 95c2e811146e ("crypto: user - Add CRYPTO_MSG_DELRNG") Cc: stable@vger.kernel.org # v4.2 Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/crypto_user.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c
index 43fe85f2..7097a339 100644
--- a/crypto/crypto_user.c
+++ b/crypto/crypto_user.c
@@ -455,6 +455,7 @@ static const int crypto_msg_min[CRYPTO_NR_MSGTYPES] = {
[CRYPTO_MSG_NEWALG - CRYPTO_MSG_BASE] = MSGSIZE(crypto_user_alg),
[CRYPTO_MSG_DELALG - CRYPTO_MSG_BASE] = MSGSIZE(crypto_user_alg),
[CRYPTO_MSG_UPDATEALG - CRYPTO_MSG_BASE] = MSGSIZE(crypto_user_alg),
+ [CRYPTO_MSG_GETALG - CRYPTO_MSG_BASE] = MSGSIZE(crypto_user_alg),
[CRYPTO_MSG_DELRNG - CRYPTO_MSG_BASE] = 0,
};