diff options
author | Chenbo Feng <fengc@google.com> | 2017-06-20 22:06:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-22 11:13:56 -0400 |
commit | 8fac365f63c866a00015fa13932d8ffc584518b8 (patch) | |
tree | e8e8a7d3fdf70628d174f346c1bcf215b545f450 /net/ipv4/tcp_ipv4.c | |
parent | 2da55390a96ad2245edfaca77669c10088523d39 (diff) |
tcp: Add a tcp_filter hook before handle ack packet
Currently in both ipv4 and ipv6 code path, the ack packet received when
sk at TCP_NEW_SYN_RECV state is not filtered by socket filter or cgroup
filter since it is handled from tcp_child_process and never reaches the
tcp_filter inside tcp_v4_rcv or tcp_v6_rcv. Adding a tcp_filter hooks
here can make sure all the ingress tcp packet can be correctly filtered.
Signed-off-by: Chenbo Feng <fengc@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index e20bcf0061af..d774bcd9a54b 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1729,6 +1729,8 @@ process: | |||
1729 | } | 1729 | } |
1730 | if (nsk == sk) { | 1730 | if (nsk == sk) { |
1731 | reqsk_put(req); | 1731 | reqsk_put(req); |
1732 | } else if (tcp_filter(sk, skb)) { | ||
1733 | goto discard_and_relse; | ||
1732 | } else if (tcp_child_process(sk, nsk, skb)) { | 1734 | } else if (tcp_child_process(sk, nsk, skb)) { |
1733 | tcp_v4_send_reset(nsk, skb); | 1735 | tcp_v4_send_reset(nsk, skb); |
1734 | goto discard_and_relse; | 1736 | goto discard_and_relse; |