]> git.baikalelectronics.ru Git - kernel.git/commit
net: core: add READ_ONCE/WRITE_ONCE annotations for sk->sk_bound_dev_if
authorEric Dumazet <edumazet@google.com>
Fri, 13 May 2022 18:55:44 +0000 (11:55 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 May 2022 09:31:06 +0000 (10:31 +0100)
commitbd20950391f9101b17046baece245066bf2c117f
treeff0e94f52041131be7d9138d491325335c95f2bc
parent2cb00a922164cc5c278f39981b87acfc8957f309
net: core: add READ_ONCE/WRITE_ONCE annotations for sk->sk_bound_dev_if

sock_bindtoindex_locked() needs to use WRITE_ONCE(sk->sk_bound_dev_if, val),
because other cpus/threads might locklessly read this field.

sock_getbindtodevice(), sock_getsockopt() need READ_ONCE()
because they run without socket lock held.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/sock.c