summaryrefslogtreecommitdiffstats
path: root/net/dccp/trace.h
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2021-11-18 21:30:19 +0100
committerDavid S. Miller <davem@davemloft.net>2021-11-19 12:22:49 +0100
commitf5455a1d9d499e4028b8ae8370758efad00b00e9 (patch)
tree6afa3f45ae56e88d7b44b48c77f9316c87719a7f /net/dccp/trace.h
parentsky2: use PCI VPD API in eeprom ethtool ops (diff)
downloadlinux-f5455a1d9d499e4028b8ae8370758efad00b00e9.tar.xz
linux-f5455a1d9d499e4028b8ae8370758efad00b00e9.zip
net: dccp: Use memset_startat() for TP zeroing
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() so memset() doesn't get confused about writing beyond the destination member that is intended to be the starting point of zeroing through the end of the struct. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/trace.h')
-rw-r--r--net/dccp/trace.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/dccp/trace.h b/net/dccp/trace.h
index 5062421beee9..5a43b3508c7f 100644
--- a/net/dccp/trace.h
+++ b/net/dccp/trace.h
@@ -60,9 +60,7 @@ TRACE_EVENT(dccp_probe,
__entry->tx_t_ipi = hc->tx_t_ipi;
} else {
__entry->tx_s = 0;
- memset(&__entry->tx_rtt, 0, (void *)&__entry->tx_t_ipi -
- (void *)&__entry->tx_rtt +
- sizeof(__entry->tx_t_ipi));
+ memset_startat(__entry, 0, tx_rtt);
}
),