Skip to content

Commit b5dffcb

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

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
@@ -780,7 +780,7 @@ int nr_route_frame(struct sk_buff *skb, ax25_cb *ax25)
780780
return ret;
781781
}
782782

783-
if (!sysctl_netrom_routing_control && ax25 != NULL)
783+
if (!READ_ONCE(sysctl_netrom_routing_control) && ax25 != NULL)
784784
return 0;
785785

786786
/* Its Time-To-Live has expired */

0 commit comments

Comments
 (0)