Skip to content

Commit cfd9f4a

Browse files
JasonXingPaolo Abeni
authored andcommitted
netrom: Fix a data-race around sysctl_netrom_obsolescence_count_initialiser
We need to protect the reader reading the sysctl value because the value can be changed concurrently. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Jason Xing <kernelxing@tencent.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 958d614 commit cfd9f4a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/netrom/nr_route.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ int nr_route_frame(struct sk_buff *skb, ax25_cb *ax25)
766766
if (ax25 != NULL) {
767767
ret = nr_add_node(nr_src, "", &ax25->dest_addr, ax25->digipeat,
768768
ax25->ax25_dev->dev, 0,
769-
sysctl_netrom_obsolescence_count_initialiser);
769+
READ_ONCE(sysctl_netrom_obsolescence_count_initialiser));
770770
if (ret)
771771
return ret;
772772
}

0 commit comments

Comments
 (0)