mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
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>
This commit is contained in:
parent
92e888bc6f
commit
f5455a1d9d
@ -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);
|
||||
}
|
||||
),
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user