diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2012-08-31 05:55:54 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-09-09 16:13:49 -0400 |
commit | 4a70bbfaef0361d27272629d1a250a937edcafe4 (patch) | |
tree | 8389e2f3b55cfcec5770a9fd83b9a52c31e4128b /net | |
parent | 64f509ce71b08d037998e93dd51180c19b2f464c (diff) |
netfilter: Validate the sequence number of dataless ACK packets as well
We spare nothing by not validating the sequence number of dataless
ACK packets and enabling it makes harder off-path attacks.
See: "Reflection scan: an Off-Path Attack on TCP" by Jan Wrobel,
http://arxiv.org/abs/1201.2074
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/nf_conntrack_proto_tcp.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c index aba98f942979..e046b3756aab 100644 --- a/net/netfilter/nf_conntrack_proto_tcp.c +++ b/net/netfilter/nf_conntrack_proto_tcp.c | |||
@@ -630,15 +630,9 @@ static bool tcp_in_window(const struct nf_conn *ct, | |||
630 | ack = sack = receiver->td_end; | 630 | ack = sack = receiver->td_end; |
631 | } | 631 | } |
632 | 632 | ||
633 | if (seq == end | 633 | if (tcph->rst && seq == 0 && state->state == TCP_CONNTRACK_SYN_SENT) |
634 | && (!tcph->rst | ||
635 | || (seq == 0 && state->state == TCP_CONNTRACK_SYN_SENT))) | ||
636 | /* | 634 | /* |
637 | * Packets contains no data: we assume it is valid | 635 | * RST sent answering SYN. |
638 | * and check the ack value only. | ||
639 | * However RST segments are always validated by their | ||
640 | * SEQ number, except when seq == 0 (reset sent answering | ||
641 | * SYN. | ||
642 | */ | 636 | */ |
643 | seq = end = sender->td_end; | 637 | seq = end = sender->td_end; |
644 | 638 | ||