aboutsummaryrefslogtreecommitdiffstats
path: root/net/can/j1939/socket.c
diff options
context:
space:
mode:
authorEric Dumazet <[email protected]>2023-09-21 20:28:11 +0000
committerDavid S. Miller <[email protected]>2023-10-01 18:09:54 +0000
commit10bbf1652c1cca9819e98d56f3432c56d7a2d229 (patch)
treeab9494c905436ea6f2b9fa1bb979addd2d58da71 /net/can/j1939/socket.c
parentopenvswitch: reduce stack usage in do_execute_actions (diff)
downloadkernel-10bbf1652c1cca9819e98d56f3432c56d7a2d229.tar.gz
kernel-10bbf1652c1cca9819e98d56f3432c56d7a2d229.zip
net: implement lockless SO_PRIORITY
This is a followup of 8bf43be799d4 ("net: annotate data-races around sk->sk_priority"). sk->sk_priority can be read and written without holding the socket lock. Signed-off-by: Eric Dumazet <[email protected]> Reviewed-by: Wenjia Zhang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/can/j1939/socket.c')
-rw-r--r--net/can/j1939/socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/can/j1939/socket.c b/net/can/j1939/socket.c
index b28c976f52a0..14c431663233 100644
--- a/net/can/j1939/socket.c
+++ b/net/can/j1939/socket.c
@@ -884,7 +884,7 @@ static struct sk_buff *j1939_sk_alloc_skb(struct net_device *ndev,
skcb = j1939_skb_to_cb(skb);
memset(skcb, 0, sizeof(*skcb));
skcb->addr = jsk->addr;
- skcb->priority = j1939_prio(sk->sk_priority);
+ skcb->priority = j1939_prio(READ_ONCE(sk->sk_priority));
if (msg->msg_name) {
struct sockaddr_can *addr = msg->msg_name;