Skip to content

Commit e248948

Browse files
edumazetdavem330
authored andcommitted
ipv6: annotate data-races in rt6_probe()
Use READ_ONCE() while reading idev->cnf.rtr_probe_interval while its value could be changed. 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 fca34cc commit e248948

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

net/ipv6/route.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,14 +645,15 @@ static void rt6_probe(struct fib6_nh *fib6_nh)
645645
write_lock_bh(&neigh->lock);
646646
if (!(neigh->nud_state & NUD_VALID) &&
647647
time_after(jiffies,
648-
neigh->updated + idev->cnf.rtr_probe_interval)) {
648+
neigh->updated +
649+
READ_ONCE(idev->cnf.rtr_probe_interval))) {
649650
work = kmalloc(sizeof(*work), GFP_ATOMIC);
650651
if (work)
651652
__neigh_set_probe_once(neigh);
652653
}
653654
write_unlock_bh(&neigh->lock);
654655
} else if (time_after(jiffies, last_probe +
655-
idev->cnf.rtr_probe_interval)) {
656+
READ_ONCE(idev->cnf.rtr_probe_interval))) {
656657
work = kmalloc(sizeof(*work), GFP_ATOMIC);
657658
}
658659

0 commit comments

Comments
 (0)