diff options
author | Stephan Mueller <smueller@chronox.de> | 2016-05-15 20:53:36 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-05-31 04:41:47 -0400 |
commit | eed1e1afd8d542d9644534c1b712599b5d680007 (patch) | |
tree | 135955503d62c4da95dd5ab2e719802d6751f825 /crypto/crypto_user.c | |
parent | 1a445e8efaa4334457c4d1f48a5d1d829b503f0c (diff) |
crypto: user - no parsing of CRYPTO_MSG_GETALG
The CRYPTO_MSG_GETALG netlink message type provides a buffer to the
kernel to retrieve information from the kernel. The data buffer will not
provide any input and will not be read. Hence the nlmsg_parse is not
applicable to this netlink message type.
This patch fixes the following kernel log message when using this
netlink interface:
netlink: 208 bytes leftover after parsing attributes in process `XXX'.
Patch successfully tested with libkcapi from [1] which uses
CRYPTO_MSG_GETALG to obtain cipher-specific information from the kernel.
[1] http://www.chronox.de/libkcapi.html
Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/crypto_user.c')
-rw-r--r-- | crypto/crypto_user.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c index 43fe85f20d57..f71960dea882 100644 --- a/crypto/crypto_user.c +++ b/crypto/crypto_user.c | |||
@@ -516,10 +516,12 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
516 | return err; | 516 | return err; |
517 | } | 517 | } |
518 | 518 | ||
519 | err = nlmsg_parse(nlh, crypto_msg_min[type], attrs, CRYPTOCFGA_MAX, | 519 | if (type != (CRYPTO_MSG_GETALG - CRYPTO_MSG_BASE)) { |
520 | crypto_policy); | 520 | err = nlmsg_parse(nlh, crypto_msg_min[type], attrs, |
521 | if (err < 0) | 521 | CRYPTOCFGA_MAX, crypto_policy); |
522 | return err; | 522 | if (err < 0) |
523 | return err; | ||
524 | } | ||
523 | 525 | ||
524 | if (link->doit == NULL) | 526 | if (link->doit == NULL) |
525 | return -EINVAL; | 527 | return -EINVAL; |