netfilter: conntrack: validate SCTP crc32c in PREROUTING
authorDavide Caratti <dcaratti@redhat.com>
Mon, 2 Jan 2017 12:29:41 +0000 (13:29 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 5 Jan 2017 12:24:47 +0000 (13:24 +0100)
commitcf6e007eef83476c5d541453d84e08b07befe124
treea5be2ddeaced82169b7d05c0846c9ad306df4390
parent300ae149468f440a2629fa8b33d0ce1e860d479f
netfilter: conntrack: validate SCTP crc32c in PREROUTING

implement sctp_error to let nf_conntrack_in validate crc32c on the packet
transport header. Assign skb->ip_summed to CHECKSUM_UNNECESSARY and return
NF_ACCEPT in case of successful validation; otherwise, return -NF_ACCEPT to
let netfilter skip connection tracking, like other protocols do.

Besides preventing corrupted packets from matching conntrack entries, this
fixes functionality of REJECT target: it was not generating any ICMP upon
reception of SCTP packets, because it was computing RFC 1624 checksum on
the packet and systematically mismatching crc32c in the SCTP header.

Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_proto_sctp.c