[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181213103450.w3csc4uomafnqa64@gondor.apana.org.au>
Date: Thu, 13 Dec 2018 18:34:50 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Eric Biggers <ebiggers@...nel.org>
Cc: linux-crypto@...r.kernel.org,
"David S . Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
LABBE Corentin <clabbe@...libre.com>,
Steffen Klassert <steffen.klassert@...unet.com>
Subject: Re: [PATCH] crypto: user - support incremental algorithm dumps
On Thu, Dec 06, 2018 at 03:55:41PM -0800, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@...gle.com>
>
> CRYPTO_MSG_GETALG in NLM_F_DUMP mode sometimes doesn't return all
> registered crypto algorithms, because it doesn't support incremental
> dumps. crypto_dump_report() only permits itself to be called once, yet
> the netlink subsystem allocates at most ~64 KiB for the skb being dumped
> to. Thus only the first recvmsg() returns data, and it may only include
> a subset of the crypto algorithms even if the user buffer passed to
> recvmsg() is large enough to hold all of them.
>
> Fix this by using one of the arguments in the netlink_callback structure
> to keep track of the current position in the algorithm list. Then
> userspace can do multiple recvmsg() on the socket after sending the dump
> request. This is the way netlink dumps work elsewhere in the kernel;
> it's unclear why this was different (probably just an oversight).
>
> Also fix an integer overflow when calculating the dump buffer size hint.
>
> Fixes: a38f7907b926 ("crypto: Add userspace configuration API")
> Signed-off-by: Eric Biggers <ebiggers@...gle.com>
> ---
> crypto/crypto_user_base.c | 37 ++++++++++++++++++++-----------------
> 1 file changed, 20 insertions(+), 17 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists