Skip to content

Commit bc76645

Browse files
JasonXingPaolo Abeni
authored andcommitted
netrom: Fix a data-race around sysctl_netrom_link_fails_count
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 b5dffcb commit bc76645

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
@@ -728,7 +728,7 @@ void nr_link_failed(ax25_cb *ax25, int reason)
728728
nr_neigh->ax25 = NULL;
729729
ax25_cb_put(ax25);
730730

731-
if (++nr_neigh->failed < sysctl_netrom_link_fails_count) {
731+
if (++nr_neigh->failed < READ_ONCE(sysctl_netrom_link_fails_count)) {
732732
nr_neigh_put(nr_neigh);
733733
return;
734734
}

0 commit comments

Comments
 (0)