]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
skge: potential memory corruption in skge_get_regs()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 1 Feb 2019 08:28:16 +0000 (11:28 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 2 May 2019 20:41:33 +0000 (21:41 +0100)
commitdf53da1c7c90d80f05bc85398867b1b518253cb8
tree56bc5c2e4fe3ebbef4d2293a074116e8605d4095
parentb6706ab0540c4fbb5424cbaf7c0ce7c87f7a0ba7
skge: potential memory corruption in skge_get_regs()

commit 294c149a209c6196c2de85f512b52ef50f519949 upstream.

The "p" buffer is 0x4000 bytes long.  B3_RI_WTO_R1 is 0x190.  The value
of "regs->len" is in the 1-0x4000 range.  The bug here is that
"regs->len - B3_RI_WTO_R1" can be a negative value which would lead to
memory corruption and an abrupt crash.

Fixes: c3f8be961808 ("[PATCH] skge: expand ethtool debug register dump")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/ethernet/marvell/skge.c