ipv6: lockless IPV6_ADDR_PREFERENCES implementation
authorEric Dumazet <edumazet@google.com>
Mon, 18 Sep 2023 14:23:21 +0000 (14:23 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 19 Sep 2023 16:21:44 +0000 (18:21 +0200)
commitfa17a6d8a5bd0cd7565b613cb804242cd0f6b7ab
tree47b212f49ee830235b382165cf734328cdff2e00
parent6a23c555f7eb436d6799533675ffa179db3d5834
ipv6: lockless IPV6_ADDR_PREFERENCES implementation

We have data-races while reading np->srcprefs

Switch the field to a plain byte, add READ_ONCE()
and WRITE_ONCE() annotations where needed,
and IPV6_ADDR_PREFERENCES setsockopt() can now be lockless.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20230918142321.1794107-1-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/linux/ipv6.h
include/net/ip6_route.h
include/net/ipv6.h
net/ipv6/ip6_output.c
net/ipv6/ipv6_sockglue.c
net/ipv6/route.c