ethtool: stats: Use struct_group() to clear all stats at once
authorKees Cook <keescook@chromium.org>
Thu, 18 Nov 2021 20:34:56 +0000 (12:34 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 Nov 2021 11:53:02 +0000 (11:53 +0000)
commit812ad3d270cb900d156a1542360d81f749dbe040
tree4f752faa1681e2c04fab51614ab8d1f492820890
parentb5d8cf0af167f3ab9f4cfe44918cde01e20a1222
ethtool: stats: Use struct_group() to clear all stats at once

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

Add struct_group() to mark region of struct stats_reply_data that should
be initialized, which can now be done in a single memset() call.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ethtool/stats.c