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:19:24 +0000 (09:19 +0100)
commita0f044f025e9a023e1e2b33c0731291059e2748d
tree83df3b8b84271ebb85bcfa424b6eb957c5b61ff9
parent8ef7a9a5d27d33c728756ee0024084bd17664f15
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