diff options
author | Eric Dumazet <edumazet@google.com> | 2023-09-22 03:42:16 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-10-01 19:39:18 +0100 |
commit | e08d0b3d172311e2bb500865c0d0038533d0ff11 (patch) | |
tree | 0c5343300213611a52bf2904f1aa129567929171 /net/dccp | |
parent | ceaa714138a372ac63cc2c5c19ee0882d22827f9 (diff) | |
download | lwn-e08d0b3d172311e2bb500865c0d0038533d0ff11.tar.gz lwn-e08d0b3d172311e2bb500865c0d0038533d0ff11.zip |
inet: implement lockless IP_TOS
Some reads of inet->tos are racy.
Add needed READ_ONCE() annotations and convert IP_TOS option lockless.
v2: missing changes in include/net/route.h (David Ahern)
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/ipv4.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 69453b936bd5..1b8cbfda6e5d 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c @@ -511,7 +511,7 @@ static int dccp_v4_send_response(const struct sock *sk, struct request_sock *req err = ip_build_and_send_pkt(skb, sk, ireq->ir_loc_addr, ireq->ir_rmt_addr, rcu_dereference(ireq->ireq_opt), - inet_sk(sk)->tos); + READ_ONCE(inet_sk(sk)->tos)); rcu_read_unlock(); err = net_xmit_eval(err); } |