aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHeinrich Schuchardt2021-02-20 10:44:04 +0100
committerTom Rini2021-02-24 16:51:49 -0500
commitdf88a0e5cd7dfc62921fd0ee3e79c47c2953b2a5 (patch)
treef3dc7500422579ef8a93d0ed9bb7a5ca3e494dff /drivers
parent6b0431dc21050a14bf80db4b3c34444816d7652d (diff)
net: cortina_ni: buffer overrun
When copying to a u32 field we should use sizeof(u32) and not sizeof(*u32) in memcpy. On 64bit systems like cortina_presidio-asic-emmc_defconfig using sizeof(*u32) leads to a buffer overrun. Fixes: febe13b438b3 ("net: cortina_ni: Add eth support for Cortina Access CAxxxx SoCs") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-By: Ramon Fried <rfried.dev@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/cortina_ni.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/cortina_ni.c b/drivers/net/cortina_ni.c
index ee424d95bc0..ef6ecd88b0c 100644
--- a/drivers/net/cortina_ni.c
+++ b/drivers/net/cortina_ni.c
@@ -713,7 +713,7 @@ static int cortina_eth_recv(struct udevice *dev, int flags, uchar **packetp)
priv->rx_xram_end_adr);
memcpy(&packet_status, rx_xram_ptr,
- sizeof(rx_xram_ptr));
+ sizeof(*rx_xram_ptr));
if (packet_status.valid == 0) {
debug("%s: Invalid Packet !!, ", __func__);
debug("next_link=%d\n", next_link);