staging: ncpfs: memory corruption in ncp_read_kernel()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 19 Mar 2018 11:07:45 +0000 (14:07 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Mar 2018 16:24:43 +0000 (18:24 +0200)
commit2a2b9ef3092680bdf09751d55420910f81fd0c3c
tree63600a5593e2b1fe79835302312adeecd30ec663
parent3f3a6707770af5d1fe49132bd82c18be76221069
staging: ncpfs: memory corruption in ncp_read_kernel()

commit 4c41aa24baa4ed338241d05494f2c595c885af8f upstream.

If the server is malicious then *bytes_read could be larger than the
size of the "target" buffer.  It would lead to memory corruption when we
do the memcpy().

Reported-by: Dr Silvio Cesare of InfoSect <Silvio Cesare <silvio.cesare@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ncpfs/ncplib_kernel.c