summaryrefslogtreecommitdiff
path: root/crypto/adiantum.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2018-12-06 15:55:41 -0800
committerHerbert Xu <herbert@gondor.apana.org.au>2018-12-13 18:24:59 +0800
commitef94f2d79c335bf9636b03c39a28cbeb990a0f69 (patch)
treecd12e6c101d3eeff171971e4848329084d69b2f1 /crypto/adiantum.c
parent3788f8e298d40fa2a03e4009ce97065cdd1a9579 (diff)
downloadlinux-crypto-ef94f2d79c335bf9636b03c39a28cbeb990a0f69.tar.gz
linux-crypto-ef94f2d79c335bf9636b03c39a28cbeb990a0f69.zip
crypto: user - support incremental algorithm dumps
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: 2da2418a8b84 ("crypto: Add userspace configuration API") Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/adiantum.c')
0 files changed, 0 insertions, 0 deletions