Skip to content

Commit 224004f

Browse files
keesdavem330
authored andcommitted
sh_eth: Avoid memcpy() over-reading of ETH_SS_STATS
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally reading across neighboring array fields. The memcpy() is copying the entire structure, not just the first array. Adjust the source argument so the compiler can do appropriate bounds checking. Signed-off-by: Kees Cook <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 99718ab commit 224004f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/renesas/sh_eth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2287,7 +2287,7 @@ static void sh_eth_get_strings(struct net_device *ndev, u32 stringset, u8 *data)
22872287
{
22882288
switch (stringset) {
22892289
case ETH_SS_STATS:
2290-
memcpy(data, *sh_eth_gstrings_stats,
2290+
memcpy(data, sh_eth_gstrings_stats,
22912291
sizeof(sh_eth_gstrings_stats));
22922292
break;
22932293
}

0 commit comments

Comments
 (0)