Skip to content

sysctl: Fix data-races around ipv4_table.

Kuniyuki Iwashima lkml mptcp netdev 2 versions Applied

Status from this message: This series was applied to netdev/net.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest12 patches 5 repliesApplied 12/12
  2. v116 patches 5 repliesSuperseded

Changes in v2 from the cover letter

* Drop some changes that makes backporting difficult
* First cleanup patch
* Lockless helpers and .proc_handler changes
* Drop the tracing part for .sysctl_mem
* Steve already posted a fix
* Drop int-to-bool change for cipso
* Should be posted to net-next later
* Drop proc_dobool() change
* Can be included in another series

Patches in v2 All 12 applied

#Subject and filesSizeRepliesApplied
1/12sysctl: Fix data races in proc_dointvec().kernel/sysctl.c+3 -30 repliesApplied
2/12sysctl: Fix data races in proc_douintvec().kernel/sysctl.c+2 -20 repliesApplied
3/12sysctl: Fix data races in proc_dointvec_minmax().kernel/sysctl.c+1 -10 repliesApplied
4/12sysctl: Fix data races in proc_douintvec_minmax().kernel/sysctl.c+1 -10 repliesApplied
5/12sysctl: Fix data races in proc_doulongvec_minmax().kernel/sysctl.c+2 -20 repliesApplied
6/12sysctl: Fix data races in proc_dointvec_jiffies().kernel/sysctl.c+5 -20 repliesApplied
7/12tcp: Fix a data-race around sysctl_tcp_max_orphans.net/ipv4/tcp.c+2 -10 repliesApplied
8/12inetpeer: Fix data-races around sysctl.net/ipv4/inetpeer.c+8 -40 repliesApplied
9/12net: Fix data-races around sysctl_mem.include/net/sock.h+1 -11 replyApplied
10/12cipso: Fix data-races around sysctl.Documentation/networking/ip-sysctl.rst net/ipv4/cipso_ipv4.c+8 -64 repliesApplied
11/12icmp: Fix data-races around sysctl.net/ipv4/icmp.c+3 -20 repliesApplied
12/12ipv4: Fix a data-race around sysctl_fib_sync_mem.net/ipv4/fib_trie.c+1 -10 repliesApplied

Reviews trailers per patch

1 of 12 patches has a Reviewed-by or Acked-by.

PatchPaul Moore
1/12
2/12
3/12
4/12
5/12
6/12
7/12
8/12
9/12
10/12A-b
11/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 net 00/12] sysctl: Fix data-races around ipv4_table.

A sysctl variable is accessed concurrently, and there is always a chance of data-race. So, all readers and writers need some basic protection to avoid load/store-tearing.

The first half of this series changes some proc handlers used in ipv4_table to use READ_ONCE() and WRITE_ONCE() internally to fix data-races on the sysctl side. Then, the second half adds READ_ONCE() to the other readers of ipv4_table.

Changes:
v2:
* Drop some changes that makes backporting difficult
* First cleanup patch
* Lockless helpers and .proc_handler changes
* Drop the tracing part for .sysctl_mem
* Steve already posted a fix
* Drop int-to-bool change for cipso
* Should be posted to net-next later
* Drop proc_dobool() change
* Can be included in another series

v1: https://lore.kernel.org/netdev/[email protected]/

Kuniyuki Iwashima (12):
sysctl: Fix data races in proc_dointvec().
sysctl: Fix data races in proc_douintvec().
sysctl: Fix data races in proc_dointvec_minmax().
sysctl: Fix data races in proc_douintvec_minmax().
sysctl: Fix data races in proc_doulongvec_minmax().
sysctl: Fix data races in proc_dointvec_jiffies().
tcp: Fix a data-race around sysctl_tcp_max_orphans.
inetpeer: Fix data-races around sysctl.
net: Fix data-races around sysctl_mem.
cipso: Fix data-races around sysctl.
icmp: Fix data-races around sysctl.
ipv4: Fix a data-race around sysctl_fib_sync_mem.

 Documentation/networking/ip-sysctl.rst |  2 +-
 include/net/sock.h                     |  2 +-
 kernel/sysctl.c                        | 25 ++++++++++++++-----------
 net/ipv4/cipso_ipv4.c                  | 12 +++++++-----
 net/ipv4/fib_trie.c                    |  2 +-
 net/ipv4/icmp.c                        |  5 +++--
 net/ipv4/inetpeer.c                    | 12 ++++++++----
 net/ipv4/tcp.c                         |  3 ++-
 8 files changed, 37 insertions(+), 26 deletions(-)
Signature · 1 line
2.30.2