All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 net 00/12] sysctl: Fix data-races around ipv4_table.
@ 2022-07-06 23:39 Kuniyuki Iwashima
  2022-07-06 23:39 ` [PATCH v2 net 01/12] sysctl: Fix data races in proc_dointvec() Kuniyuki Iwashima
                   ` (12 more replies)
  0 siblings, 13 replies; 19+ messages in thread
From: Kuniyuki Iwashima @ 2022-07-06 23:39 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Luis Chamberlain, Kees Cook, Iurii Zaikin
  Cc: Kuniyuki Iwashima, Kuniyuki Iwashima, netdev, linux-kernel

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/20220706052130.16368-1-kuniyu@amazon.com/


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(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-07-09  9:11 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06 23:39 [PATCH v2 net 00/12] sysctl: Fix data-races around ipv4_table Kuniyuki Iwashima
2022-07-06 23:39 ` [PATCH v2 net 01/12] sysctl: Fix data races in proc_dointvec() Kuniyuki Iwashima
2022-07-06 23:39 ` [PATCH v2 net 02/12] sysctl: Fix data races in proc_douintvec() Kuniyuki Iwashima
2022-07-06 23:39 ` [PATCH v2 net 03/12] sysctl: Fix data races in proc_dointvec_minmax() Kuniyuki Iwashima
2022-07-06 23:39 ` [PATCH v2 net 04/12] sysctl: Fix data races in proc_douintvec_minmax() Kuniyuki Iwashima
2022-07-06 23:39 ` [PATCH v2 net 05/12] sysctl: Fix data races in proc_doulongvec_minmax() Kuniyuki Iwashima
2022-07-06 23:39 ` [PATCH v2 net 06/12] sysctl: Fix data races in proc_dointvec_jiffies() Kuniyuki Iwashima
2022-07-06 23:39 ` [PATCH v2 net 07/12] tcp: Fix a data-race around sysctl_tcp_max_orphans Kuniyuki Iwashima
2022-07-06 23:39 ` [PATCH v2 net 08/12] inetpeer: Fix data-races around sysctl Kuniyuki Iwashima
2022-07-06 23:40 ` [PATCH v2 net 09/12] net: Fix data-races around sysctl_mem Kuniyuki Iwashima
2022-07-09  9:11   ` Matthieu Baerts
2022-07-06 23:40 ` [PATCH v2 net 10/12] cipso: Fix data-races around sysctl Kuniyuki Iwashima
2022-07-07 19:15   ` Paul Moore
2022-07-07 22:15     ` Kuniyuki Iwashima
2022-07-08  0:24       ` Jakub Kicinski
2022-07-08  0:44         ` Kuniyuki Iwashima
2022-07-06 23:40 ` [PATCH v2 net 11/12] icmp: " Kuniyuki Iwashima
2022-07-06 23:40 ` [PATCH v2 net 12/12] ipv4: Fix a data-race around sysctl_fib_sync_mem Kuniyuki Iwashima
2022-07-08 11:50 ` [PATCH v2 net 00/12] sysctl: Fix data-races around ipv4_table patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.