Skip to content

Commit 99718ab

Browse files
keesdavem330
authored andcommitted
r8152: 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 1b29df0 commit 99718ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/usb/r8152.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8678,7 +8678,7 @@ static void rtl8152_get_strings(struct net_device *dev, u32 stringset, u8 *data)
86788678
{
86798679
switch (stringset) {
86808680
case ETH_SS_STATS:
8681-
memcpy(data, *rtl8152_gstrings, sizeof(rtl8152_gstrings));
8681+
memcpy(data, rtl8152_gstrings, sizeof(rtl8152_gstrings));
86828682
break;
86838683
}
86848684
}

0 commit comments

Comments
 (0)