netfilter: conntrack: allow sctp hearbeat after connection re-use
authorFlorian Westphal <fw@strlen.de>
Tue, 18 Aug 2020 14:15:58 +0000 (16:15 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 20 Aug 2020 12:13:49 +0000 (14:13 +0200)
commitcc5453a5b7e90c39f713091a7ebc53c1f87d1700
tree631ff062cc6b96c5b2cc723a395e79864656580a
parentcf96d977381d4a23957bade2ddf1c420b74a26b6
netfilter: conntrack: allow sctp hearbeat after connection re-use

If an sctp connection gets re-used, heartbeats are flagged as invalid
because their vtag doesn't match.

Handle this in a similar way as TCP conntrack when it suspects that the
endpoints and conntrack are out-of-sync.

When a HEARTBEAT request fails its vtag validation, flag this in the
conntrack state and accept the packet.

When a HEARTBEAT_ACK is received with an invalid vtag in the reverse
direction after we allowed such a HEARTBEAT through, assume we are
out-of-sync and re-set the vtag info.

v2: remove left-over snippet from an older incarnation that moved
    new_state/old_state assignments, thats not needed so keep that
    as-is.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/linux/netfilter/nf_conntrack_sctp.h
net/netfilter/nf_conntrack_proto_sctp.c