]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit57546356888be4fcdc0c4a086758148e84ebd14e
tree4f752faa1681e2c04fab51614ab8d1f492820890
parent6600ef6bc811e9565670f8bfd7c4ca05c340175a
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