crypto: user - fix leaking uninitialized memory to userspace
authorEric Biggers <ebiggers@google.com>
Sat, 3 Nov 2018 21:56:00 +0000 (14:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Nov 2018 08:24:15 +0000 (09:24 +0100)
commitfdc427442b374e84077d4214733764efb1a38a0e
treeff3b1d214f5b0654c1dedc9ca843ab9a42ed8d84
parent6c75d139608a603642cd731ce75e4222754fff0e
crypto: user - fix leaking uninitialized memory to userspace

commit f43f39958beb206b53292801e216d9b8a660f087 upstream.

All bytes of the NETLINK_CRYPTO report structures must be initialized,
since they are copied to userspace.  The change from strncpy() to
strlcpy() broke this.  As a minimal fix, change it back.

Fixes: 4473710df1f8 ("crypto: user - Prepare for CRYPTO_MAX_ALG_NAME expansion")
Cc: <stable@vger.kernel.org> # v4.12+
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/crypto_user.c