Skip to content

Commit a8fbd4d

Browse files
edumazetdavem330
authored andcommitted
ipv6: annotate data-races around devconf->proxy_ndp
devconf->proxy_ndp can be read and written locklessly, add appropriate annotations. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e248948 commit a8fbd4d

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

net/ipv6/addrconf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,8 @@ static int inet6_netconf_fill_devconf(struct sk_buff *skb, int ifindex,
561561
goto nla_put_failure;
562562
#endif
563563
if ((all || type == NETCONFA_PROXY_NEIGH) &&
564-
nla_put_s32(skb, NETCONFA_PROXY_NEIGH, devconf->proxy_ndp) < 0)
564+
nla_put_s32(skb, NETCONFA_PROXY_NEIGH,
565+
READ_ONCE(devconf->proxy_ndp)) < 0)
565566
goto nla_put_failure;
566567

567568
if ((all || type == NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN) &&

net/ipv6/ip6_output.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ int ip6_forward(struct sk_buff *skb)
552552
}
553553

554554
/* XXX: idev->cnf.proxy_ndp? */
555-
if (net->ipv6.devconf_all->proxy_ndp &&
555+
if (READ_ONCE(net->ipv6.devconf_all->proxy_ndp) &&
556556
pneigh_lookup(&nd_tbl, net, &hdr->daddr, skb->dev, 0)) {
557557
int proxied = ip6_forward_proxy_check(skb);
558558
if (proxied > 0) {

net/ipv6/ndisc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,8 @@ static enum skb_drop_reason ndisc_recv_ns(struct sk_buff *skb)
904904

905905
if (ipv6_chk_acast_addr(net, dev, &msg->target) ||
906906
(READ_ONCE(idev->cnf.forwarding) &&
907-
(net->ipv6.devconf_all->proxy_ndp || idev->cnf.proxy_ndp) &&
907+
(READ_ONCE(net->ipv6.devconf_all->proxy_ndp) ||
908+
READ_ONCE(idev->cnf.proxy_ndp)) &&
908909
(is_router = pndisc_is_router(&msg->target, dev)) >= 0)) {
909910
if (!(NEIGH_CB(skb)->flags & LOCALLY_ENQUEUED) &&
910911
skb->pkt_type != PACKET_HOST &&
@@ -1101,7 +1102,7 @@ static enum skb_drop_reason ndisc_recv_na(struct sk_buff *skb)
11011102
*/
11021103
if (lladdr && !memcmp(lladdr, dev->dev_addr, dev->addr_len) &&
11031104
READ_ONCE(net->ipv6.devconf_all->forwarding) &&
1104-
net->ipv6.devconf_all->proxy_ndp &&
1105+
READ_ONCE(net->ipv6.devconf_all->proxy_ndp) &&
11051106
pneigh_lookup(&nd_tbl, net, &msg->target, dev, 0)) {
11061107
/* XXX: idev->cnf.proxy_ndp */
11071108
goto out;

0 commit comments

Comments
 (0)