提交 255f9034 编写于 作者: M Menglong Dong 提交者: David S. Miller

net: tcp: add skb drop reasons to tcp_v4_rcv()

Use kfree_skb_reason() for some path in tcp_v4_rcv() that missed before,
including:

SKB_DROP_REASON_SOCKET_FILTER
SKB_DROP_REASON_XFRM_POLICY
Reviewed-by: NMengen Sun <mengensun@tencent.com>
Reviewed-by: NHao Peng <flyingpeng@tencent.com>
Signed-off-by: NMenglong Dong <imagedong@tencent.com>
Reviewed-by: NEric Dumazet <edumazet@google.com>
Reviewed-by: NDavid Ahern <dsahern@kernel.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 082116ff
...@@ -2057,6 +2057,8 @@ int tcp_v4_rcv(struct sk_buff *skb) ...@@ -2057,6 +2057,8 @@ int tcp_v4_rcv(struct sk_buff *skb)
iph = ip_hdr(skb); iph = ip_hdr(skb);
tcp_v4_fill_cb(skb, iph, th); tcp_v4_fill_cb(skb, iph, th);
nsk = tcp_check_req(sk, skb, req, false, &req_stolen); nsk = tcp_check_req(sk, skb, req, false, &req_stolen);
} else {
drop_reason = SKB_DROP_REASON_SOCKET_FILTER;
} }
if (!nsk) { if (!nsk) {
reqsk_put(req); reqsk_put(req);
...@@ -2092,8 +2094,10 @@ int tcp_v4_rcv(struct sk_buff *skb) ...@@ -2092,8 +2094,10 @@ int tcp_v4_rcv(struct sk_buff *skb)
} }
} }
if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) {
drop_reason = SKB_DROP_REASON_XFRM_POLICY;
goto discard_and_relse; goto discard_and_relse;
}
if (tcp_v4_inbound_md5_hash(sk, skb, dif, sdif)) if (tcp_v4_inbound_md5_hash(sk, skb, dif, sdif))
goto discard_and_relse; goto discard_and_relse;
...@@ -2166,6 +2170,7 @@ int tcp_v4_rcv(struct sk_buff *skb) ...@@ -2166,6 +2170,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
do_time_wait: do_time_wait:
if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) { if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) {
drop_reason = SKB_DROP_REASON_XFRM_POLICY;
inet_twsk_put(inet_twsk(sk)); inet_twsk_put(inet_twsk(sk));
goto discard_it; goto discard_it;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册