]> git.baikalelectronics.ru Git - kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Feb 2019 18:00:22 +0000 (10:00 -0800)
commit20b1b6cf4ead777a78503c286f3f7026909029fb
treebac41b5c5e67a0fd4cdde48757d9a71d3259f643
parent4ef7fa227f1f3f4e389e5f067960a9d82717537a
skge: potential memory corruption in skge_get_regs()

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: 83c45daa94bd ("[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>
drivers/net/ethernet/marvell/skge.c