mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
tcp/dccp: block BH for SYN processing
am: bbaeb9b73f
Change-Id: I5c94cc9374b969fe509b0922d3ddd0a119e5e9ec
This commit is contained in:
@@ -577,6 +577,7 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
|
||||
struct dccp_sock *dp = dccp_sk(sk);
|
||||
struct dccp_skb_cb *dcb = DCCP_SKB_CB(skb);
|
||||
const int old_state = sk->sk_state;
|
||||
bool acceptable;
|
||||
int queued = 0;
|
||||
|
||||
/*
|
||||
@@ -603,8 +604,13 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
|
||||
*/
|
||||
if (sk->sk_state == DCCP_LISTEN) {
|
||||
if (dh->dccph_type == DCCP_PKT_REQUEST) {
|
||||
if (inet_csk(sk)->icsk_af_ops->conn_request(sk,
|
||||
skb) < 0)
|
||||
/* It is possible that we process SYN packets from backlog,
|
||||
* so we need to make sure to disable BH right there.
|
||||
*/
|
||||
local_bh_disable();
|
||||
acceptable = inet_csk(sk)->icsk_af_ops->conn_request(sk, skb) >= 0;
|
||||
local_bh_enable();
|
||||
if (!acceptable)
|
||||
return 1;
|
||||
consume_skb(skb);
|
||||
return 0;
|
||||
|
||||
@@ -5917,9 +5917,15 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
|
||||
if (th->syn) {
|
||||
if (th->fin)
|
||||
goto discard;
|
||||
if (icsk->icsk_af_ops->conn_request(sk, skb) < 0)
|
||||
return 1;
|
||||
/* It is possible that we process SYN packets from backlog,
|
||||
* so we need to make sure to disable BH right there.
|
||||
*/
|
||||
local_bh_disable();
|
||||
acceptable = icsk->icsk_af_ops->conn_request(sk, skb) >= 0;
|
||||
local_bh_enable();
|
||||
|
||||
if (!acceptable)
|
||||
return 1;
|
||||
consume_skb(skb);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user