hv_netvsc: Avoid field-overflowing memcpy()
authorKees Cook <keescook@chromium.org>
Mon, 21 Jun 2021 22:21:12 +0000 (15:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 22 Jun 2021 17:20:51 +0000 (10:20 -0700)
commitf2fcffe392c1fd8324f131bf33d7d350eff44bb6
treefb85680aff5b1a0069ef6d1ce0bc5974776fe449
parent64a81b24487f0d2fba0f033029eec2abc7d82cee
hv_netvsc: Avoid field-overflowing memcpy()

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memcpy(), memmove(), and memset(), avoid
intentionally writing across neighboring fields.

Add flexible array to represent start of buf_info, improving readability
and avoid future warning where memcpy() thinks it is writing past the
end of the structure.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/hyperv_net.h
drivers/net/hyperv/rndis_filter.c