]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/smc: Prevent kernel-infoleak in __smc_diag_dump()
authorPeilin Ye <yepeilin.cs@gmail.com>
Thu, 20 Aug 2020 14:30:52 +0000 (16:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Aug 2020 07:30:49 +0000 (09:30 +0200)
commit790874ffe2c121cadac188ccab6faf8343ba2dd4
treefb4fd58034bb60d683609f1d24b702f7e3b156f7
parenteb1a1c016ebadf87db872785f4bb4e1a80039c75
net/smc: Prevent kernel-infoleak in __smc_diag_dump()

[ Upstream commit ce51f63e63c52a4e1eee4dd040fb0ba0af3b43ab ]

__smc_diag_dump() is potentially copying uninitialized kernel stack memory
into socket buffers, since the compiler may leave a 4-byte hole near the
beginning of `struct smcd_diag_dmbinfo`. Fix it by initializing `dinfo`
with memset().

Fixes: 4b1b7d3b30a6 ("net/smc: add SMC-D diag support")
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/smc/smc_diag.c