]> 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)
commita0119f7f7790f3ec3cc38817e487aa2b27074429
tree4f752faa1681e2c04fab51614ab8d1f492820890
parent72c832340f571ebfcefc680ced6de4d9f4aefbeb
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