mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
dccp: annotate lockless accesses to sk->sk_err_soft
This field can be read/written without lock synchronization. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
cee1af825d
commit
9a25f0cb0d
@@ -177,7 +177,7 @@ static inline void dccp_do_pmtu_discovery(struct sock *sk,
|
|||||||
* for the case, if this connection will not able to recover.
|
* for the case, if this connection will not able to recover.
|
||||||
*/
|
*/
|
||||||
if (mtu < dst_mtu(dst) && ip_dont_fragment(sk, dst))
|
if (mtu < dst_mtu(dst) && ip_dont_fragment(sk, dst))
|
||||||
sk->sk_err_soft = EMSGSIZE;
|
WRITE_ONCE(sk->sk_err_soft, EMSGSIZE);
|
||||||
|
|
||||||
mtu = dst_mtu(dst);
|
mtu = dst_mtu(dst);
|
||||||
|
|
||||||
@@ -339,8 +339,9 @@ static int dccp_v4_err(struct sk_buff *skb, u32 info)
|
|||||||
sk_error_report(sk);
|
sk_error_report(sk);
|
||||||
|
|
||||||
dccp_done(sk);
|
dccp_done(sk);
|
||||||
} else
|
} else {
|
||||||
sk->sk_err_soft = err;
|
WRITE_ONCE(sk->sk_err_soft, err);
|
||||||
|
}
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,8 +365,9 @@ static int dccp_v4_err(struct sk_buff *skb, u32 info)
|
|||||||
if (!sock_owned_by_user(sk) && inet->recverr) {
|
if (!sock_owned_by_user(sk) && inet->recverr) {
|
||||||
sk->sk_err = err;
|
sk->sk_err = err;
|
||||||
sk_error_report(sk);
|
sk_error_report(sk);
|
||||||
} else /* Only an error on timeout */
|
} else { /* Only an error on timeout */
|
||||||
sk->sk_err_soft = err;
|
WRITE_ONCE(sk->sk_err_soft, err);
|
||||||
|
}
|
||||||
out:
|
out:
|
||||||
bh_unlock_sock(sk);
|
bh_unlock_sock(sk);
|
||||||
sock_put(sk);
|
sock_put(sk);
|
||||||
|
@@ -174,17 +174,18 @@ static int dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
|
|||||||
*/
|
*/
|
||||||
sk_error_report(sk);
|
sk_error_report(sk);
|
||||||
dccp_done(sk);
|
dccp_done(sk);
|
||||||
} else
|
} else {
|
||||||
sk->sk_err_soft = err;
|
WRITE_ONCE(sk->sk_err_soft, err);
|
||||||
|
}
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sock_owned_by_user(sk) && np->recverr) {
|
if (!sock_owned_by_user(sk) && np->recverr) {
|
||||||
sk->sk_err = err;
|
sk->sk_err = err;
|
||||||
sk_error_report(sk);
|
sk_error_report(sk);
|
||||||
} else
|
} else {
|
||||||
sk->sk_err_soft = err;
|
WRITE_ONCE(sk->sk_err_soft, err);
|
||||||
|
}
|
||||||
out:
|
out:
|
||||||
bh_unlock_sock(sk);
|
bh_unlock_sock(sk);
|
||||||
sock_put(sk);
|
sock_put(sk);
|
||||||
|
@@ -19,7 +19,7 @@ int sysctl_dccp_retries2 __read_mostly = TCP_RETR2;
|
|||||||
|
|
||||||
static void dccp_write_err(struct sock *sk)
|
static void dccp_write_err(struct sock *sk)
|
||||||
{
|
{
|
||||||
sk->sk_err = sk->sk_err_soft ? : ETIMEDOUT;
|
sk->sk_err = READ_ONCE(sk->sk_err_soft) ? : ETIMEDOUT;
|
||||||
sk_error_report(sk);
|
sk_error_report(sk);
|
||||||
|
|
||||||
dccp_send_reset(sk, DCCP_RESET_CODE_ABORTED);
|
dccp_send_reset(sk, DCCP_RESET_CODE_ABORTED);
|
||||||
|
Reference in New Issue
Block a user