Thread (3 messages) flat view 3 messages, 3 authors, 2021-06-17

Re: [PATCH] sh_eth: Avoid memcpy() over-reading of ETH_SS_STATS

From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: 2021-06-17 05:50:18
Also in: linux-hardening, linux-renesas-soc, lkml

On Wed, Jun 16, 2021 at 12:53:33PM -0700, Kees Cook wrote:
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 <redacted>
For the record:

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help