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:22:11 +0000 (09:22 +0100)
commitf4ae32cf258910c6db2b7adb1832f50c6aae3929
treea53f309a4880360c29fc81b92d448367582746c6
parentf784bb167d5f059334751f9d1ebfc40a23a7b375
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