netfilter: conntrack: Use memset_startat() to zero struct nf_conn
authorKees Cook <keescook@chromium.org>
Thu, 18 Nov 2021 20:31:13 +0000 (12:31 -0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 30 Nov 2021 21:49:29 +0000 (22:49 +0100)
commit4be1dbb75c3de6af1888fa79778388fd4e529543
tree279d9e38b265dfa3efa28bb75d4bcb297d9f432d
parentfc5e0352ccb58508274de289c66832c7a0b68161
netfilter: conntrack: Use memset_startat() to zero struct nf_conn

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() to avoid confusing memset() about writing beyond
the target struct member.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_core.c