Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jason Xing and committed by
Paolo Abeni
cfd9f4a7 958d6145

+1 -1
+1 -1
net/netrom/nr_route.c
··· 766 766 if (ax25 != NULL) { 767 767 ret = nr_add_node(nr_src, "", &ax25->dest_addr, ax25->digipeat, 768 768 ax25->ax25_dev->dev, 0, 769 - sysctl_netrom_obsolescence_count_initialiser); 769 + READ_ONCE(sysctl_netrom_obsolescence_count_initialiser)); 770 770 if (ret) 771 771 return ret; 772 772 }