sysctl: Fix data-races around ipv4_net_table (Round 1).
Subsystems (7)
cover sysctl: Fix data-races around ipv4_net_table (Round 1).
This series fixes data-races around the first 13 knobs and nexthop_compat_mode in ipv4_net_table.
I will post another patch for three early_demux knobs later, so the next round will start from ip_default_ttl.
Kuniyuki Iwashima (15):
sysctl: Fix data-races in proc_dou8vec_minmax().
sysctl: Fix data-races in proc_dointvec_ms_jiffies().
tcp: Fix a data-race around sysctl_max_tw_buckets.
icmp: Fix a data-race around sysctl_icmp_echo_ignore_all.
icmp: Fix data-races around sysctl_icmp_echo_enable_probe.
icmp: Fix a data-race around sysctl_icmp_echo_ignore_broadcasts.
icmp: Fix a data-race around sysctl_icmp_ignore_bogus_error_responses.
icmp: Fix a data-race around sysctl_icmp_errors_use_inbound_ifaddr.
icmp: Fix a data-race around sysctl_icmp_ratelimit.
icmp: Fix a data-race around sysctl_icmp_ratemask.
raw: Fix a data-race around sysctl_raw_l3mdev_accept. tcp: Fix data-races around sysctl_tcp_ecn. tcp: Fix a data-race around sysctl_tcp_ecn_fallback. ipv4: Fix data-races around sysctl_ip_dynaddr. nexthop: Fix data-races around nexthop_compat_mode.
Documentation/networking/ip-sysctl.rst | 2 +- .../chelsio/inline_crypto/chtls/chtls_cm.c | 2 +- include/net/raw.h | 2 +- kernel/sysctl.c | 12 ++++++------ net/ipv4/af_inet.c | 4 ++-- net/ipv4/fib_semantics.c | 2 +- net/ipv4/icmp.c | 15 ++++++++------- net/ipv4/inet_timewait_sock.c | 3 ++- net/ipv4/nexthop.c | 5 +++-- net/ipv4/syncookies.c | 2 +- net/ipv4/sysctl_net_ipv4.c | 12 ++++++++++++ net/ipv4/tcp_input.c | 2 +- net/ipv4/tcp_output.c | 4 ++-- net/ipv6/icmp.c | 2 +- net/ipv6/route.c | 2 +- 15 files changed, 43 insertions(+), 28 deletions(-)
Signature · 1 line
2.30.2
PATCH 1/15 sysctl: Fix data-races in proc_dou8vec_minmax().
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.
This patch changes proc_dou8vec_minmax() to use READ_ONCE() and WRITE_ONCE() internally to fix data-races on the sysctl side. For now, proc_dou8vec_minmax() itself is tolerant to a data-race, but we still need to add annotations on the other subsystem's side.
--- kernel/sysctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sysctl.c +2 -2
@@ -1007,13 +1007,13 @@ int proc_dou8vec_minmax(struct ctl_table *table, int write, tmp.maxlen =sizeof (val); tmp.data = &val; - val = *data; + val =READ_ONCE (*data); res =do_proc_douintvec (&tmp, write, buffer, lenp, ppos, do_proc_douintvec_minmax_conv, ¶m);if (res)return res;if (write) - *data = val; +WRITE_ONCE (*data, val);return 0 ; }EXPORT_SYMBOL_GPL (proc_dou8vec_minmax);
Signature · 1 line
2.30.2
PATCH 2/15 sysctl: Fix data-races in proc_dointvec_ms_jiffies().
In reply to Kuniyuki IwashimaA 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.
This patch changes proc_dointvec_ms_jiffies() to use READ_ONCE() and WRITE_ONCE() internally to fix data-races on the sysctl side. For now, proc_dointvec_ms_jiffies() itself is tolerant to a data-race, but we still need to add annotations on the other subsystem's side.
--- kernel/sysctl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/sysctl.c +4 -4
@@ -1224,9 +1224,9 @@ static int do_proc_dointvec_ms_jiffies_conv(bool *negp, unsigned long *lvalp,if (jif >INT_MAX )return 1 ; - *valp = (int )jif; +WRITE_ONCE (*valp, (int )jif); }else { -int val = *valp; +int val =READ_ONCE (*valp);unsigned long lval;if (val <0 ) { *negp = true;
@@ -1294,8 +1294,8 @@ int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,* @ppos: the current position in the file * * Reads/writes up to table->maxlen/sizeof(unsigned int) integer -* values from/to the user buffer, treated as an ASCII string. -* The values read are assumed to be in 1/1000 seconds, and +* values from/to the user buffer, treated as an ASCII string. +* The values read are assumed to be in 1/1000 seconds, and * are converted into jiffies. * * Returns 0 on success.
Signature · 1 line
2.30.2
PATCH 3/15 tcp: Fix a data-race around sysctl_max_tw_buckets.
In reply to Kuniyuki IwashimaWhile reading sysctl_max_tw_buckets, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader.
--- net/ipv4/inet_timewait_sock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv4/inet_timewait_sock.c +2 -1
@@ -156,7 +156,8 @@ struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, {struct inet_timewait_sock *tw; -if (refcount_read (&dr->tw_refcount) -1 >= dr->sysctl_max_tw_buckets) +if (refcount_read (&dr->tw_refcount) -1 >= +READ_ONCE (dr->sysctl_max_tw_buckets))return NULL ; tw = kmem_cache_alloc(sk->sk_prot_creator->twsk_prot->twsk_slab,
Signature · 1 line
2.30.2
PATCH 4/15 icmp: Fix a data-race around sysctl_icmp_echo_ignore_all.
In reply to Kuniyuki IwashimaWhile reading sysctl_icmp_echo_ignore_all, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader.
--- net/ipv4/icmp.c | 2 +- net/ipv4/sysctl_net_ipv4.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
net/ipv4/icmp.c +1 -1
@@ -993,7 +993,7 @@ static enum skb_drop_reason icmp_echo(struct sk_buff *skb) net =dev_net (skb_dst (skb)->dev);/* should there be an ICMP stat for ignored echos? */ -if (net->ipv4.sysctl_icmp_echo_ignore_all) +if (READ_ONCE (net->ipv4.sysctl_icmp_echo_ignore_all))return SKB_NOT_DROPPED_YET ; icmp_param.data.icmph = *icmp_hdr (skb);
net/ipv4/sysctl_net_ipv4.c +2 -0
@@ -599,6 +599,8 @@ static struct ctl_table ipv4_net_table[] = { .maxlen = sizeof(u8), .mode = 0644, .proc_handler = proc_dou8vec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 =SYSCTL_ONE }, { .procname = "icmp_echo_enable_probe",
Signature · 1 line
2.30.2
PATCH 5/15 icmp: Fix data-races around sysctl_icmp_echo_enable_probe.
In reply to Kuniyuki IwashimaWhile reading sysctl_icmp_echo_enable_probe, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers.
---
CC: Andreas Roeseler <[email protected]>
CC: Willem de Bruijn <[email protected]>
--- net/ipv4/icmp.c | 2 +- net/ipv6/icmp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
net/ipv4/icmp.c +1 -1
@@ -1028,7 +1028,7 @@ bool icmp_build_probe(struct sk_buff *skb, struct icmphdr *icmphdr)u16 ident_len;u8 status; -if (!net->ipv4.sysctl_icmp_echo_enable_probe) +if (!READ_ONCE (net->ipv4.sysctl_icmp_echo_enable_probe))return false;/* We currently only support probing interfaces on the proxy node
net/ipv6/icmp.c +1 -1
@@ -925,7 +925,7 @@ static int icmpv6_rcv(struct sk_buff *skb)break ;case ICMPV6_EXT_ECHO_REQUEST :if (!net->ipv6.sysctl.icmpv6_echo_ignore_all && - net->ipv4.sysctl_icmp_echo_enable_probe) +READ_ONCE (net->ipv4.sysctl_icmp_echo_enable_probe))icmpv6_echo_reply (skb);break ;
Signature · 1 line
2.30.2
PATCH 6/15 icmp: Fix a data-race around sysctl_icmp_echo_ignore_broadcasts.
In reply to Kuniyuki IwashimaWhile reading sysctl_icmp_echo_ignore_broadcasts, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader.
--- net/ipv4/icmp.c | 2 +- net/ipv4/sysctl_net_ipv4.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
net/ipv4/icmp.c +1 -1
@@ -1249,7 +1249,7 @@ int icmp_rcv(struct sk_buff *skb)*/ if ((icmph->type ==ICMP_ECHO || icmph->type ==ICMP_TIMESTAMP ) && - net->ipv4.sysctl_icmp_echo_ignore_broadcasts) { +READ_ONCE (net->ipv4.sysctl_icmp_echo_ignore_broadcasts)) { reason =SKB_DROP_REASON_INVALID_PROTO ; goto error; }
net/ipv4/sysctl_net_ipv4.c +2 -0
@@ -617,6 +617,8 @@ static struct ctl_table ipv4_net_table[] = { .maxlen = sizeof(u8), .mode = 0644, .proc_handler = proc_dou8vec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 =SYSCTL_ONE }, { .procname = "icmp_ignore_bogus_error_responses",
Signature · 1 line
2.30.2
PATCH 7/15 icmp: Fix a data-race around sysctl_icmp_ignore_bogus_error_responses.
In reply to Kuniyuki IwashimaWhile reading sysctl_icmp_ignore_bogus_error_responses, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader.
--- net/ipv4/icmp.c | 2 +- net/ipv4/sysctl_net_ipv4.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
net/ipv4/icmp.c +1 -1
@@ -933,7 +933,7 @@ static enum skb_drop_reason icmp_unreach(struct sk_buff *skb)* get the other vendor to fix their kit. */ -if (!net->ipv4.sysctl_icmp_ignore_bogus_error_responses && +if (!READ_ONCE (net->ipv4.sysctl_icmp_ignore_bogus_error_responses) &&inet_addr_type_dev_table (net, skb->dev, iph->daddr) ==RTN_BROADCAST ) { net_warn_ratelimited("%pI4 sent an invalid ICMP type %u, code %u error to a broadcast: %pI4 on %s\n", &ip_hdr(skb)->saddr,
net/ipv4/sysctl_net_ipv4.c +2 -0
@@ -626,6 +626,8 @@ static struct ctl_table ipv4_net_table[] = { .maxlen = sizeof(u8), .mode = 0644, .proc_handler = proc_dou8vec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 =SYSCTL_ONE }, { .procname = "icmp_errors_use_inbound_ifaddr",
Signature · 1 line
2.30.2
PATCH 8/15 icmp: Fix a data-race around sysctl_icmp_errors_use_inbound_ifaddr.
In reply to Kuniyuki IwashimaWhile reading sysctl_icmp_errors_use_inbound_ifaddr, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader.
---
CC: J. Simonetti <[email protected]>
--- net/ipv4/icmp.c | 2 +- net/ipv4/sysctl_net_ipv4.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
net/ipv4/icmp.c +1 -1
@@ -693,7 +693,7 @@ void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info,rcu_read_lock ();if (rt_is_input_route (rt) && - net->ipv4.sysctl_icmp_errors_use_inbound_ifaddr) +READ_ONCE (net->ipv4.sysctl_icmp_errors_use_inbound_ifaddr)) dev =dev_get_by_index_rcu (net,inet_iif (skb_in));if (dev)
net/ipv4/sysctl_net_ipv4.c +2 -0
@@ -635,6 +635,8 @@ static struct ctl_table ipv4_net_table[] = { .maxlen = sizeof(u8), .mode = 0644, .proc_handler = proc_dou8vec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 =SYSCTL_ONE }, { .procname = "icmp_ratelimit",
Signature · 1 line
2.30.2
PATCH 9/15 icmp: Fix a data-race around sysctl_icmp_ratelimit.
In reply to Kuniyuki IwashimaWhile reading sysctl_icmp_ratelimit, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader.
--- net/ipv4/icmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv4/icmp.c +2 -1
@@ -320,7 +320,8 @@ static bool icmpv4_xrlim_allow(struct net *net, struct rtable *rt, vif =l3mdev_master_ifindex (dst->dev); peer =inet_getpeer_v4 (net->ipv4.peers, fl4->daddr, vif,1 ); - rc =inet_peer_xrlim_allow (peer, net->ipv4.sysctl_icmp_ratelimit); + rc =inet_peer_xrlim_allow (peer, +READ_ONCE (net->ipv4.sysctl_icmp_ratelimit));if (peer)inet_putpeer (peer); out:
Signature · 1 line
2.30.2
PATCH 10/15 icmp: Fix a data-race around sysctl_icmp_ratemask.
In reply to Kuniyuki IwashimaWhile reading sysctl_icmp_ratemask, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader.
--- net/ipv4/icmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/icmp.c +1 -1
@@ -282,7 +282,7 @@ static bool icmpv4_mask_allow(struct net *net, int type, int code)return true;/* Limit if icmp type is enabled in ratemask. */ -if (!((1 << type) & net->ipv4.sysctl_icmp_ratemask)) +if (!((1 << type) &READ_ONCE (net->ipv4.sysctl_icmp_ratemask)))return true;return false;
Signature · 1 line
2.30.2
PATCH 11/15 raw: Fix a data-race around sysctl_raw_l3mdev_accept.
In reply to Kuniyuki IwashimaWhile reading sysctl_raw_l3mdev_accept, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader.
---
CC: Mike Manning <[email protected]>
--- include/net/raw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/raw.h +1 -1
@@ -75,7 +75,7 @@ static inline bool raw_sk_bound_dev_eq(struct net *net, int bound_dev_if, int dif, int sdif) {#if IS_ENABLED (CONFIG_NET_L3_MASTER_DEV ) -return inet_bound_dev_eq (!!net->ipv4.sysctl_raw_l3mdev_accept, +return inet_bound_dev_eq (READ_ONCE (net->ipv4.sysctl_raw_l3mdev_accept), bound_dev_if, dif, sdif);#else return inet_bound_dev_eq (true, bound_dev_if, dif, sdif);
Signature · 1 line
2.30.2
PATCH 12/15 tcp: Fix data-races around sysctl_tcp_ecn.
In reply to Kuniyuki IwashimaWhile reading sysctl_tcp_ecn, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers.
---
CC: Ayush Sawal <[email protected]>
--- drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c | 2 +- net/ipv4/syncookies.c | 2 +- net/ipv4/sysctl_net_ipv4.c | 2 ++ net/ipv4/tcp_input.c | 2 +- net/ipv4/tcp_output.c | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-)
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c +1 -1
@@ -1392,7 +1392,7 @@ static void chtls_pass_accept_request(struct sock *sk, th_ecn = tcph->ece && tcph->cwr;if (th_ecn) { ect = !INET_ECN_is_not_ect (ip_dsfield); - ecn_ok =sock_net (sk)->ipv4.sysctl_tcp_ecn; + ecn_ok =READ_ONCE (sock_net (sk)->ipv4.sysctl_tcp_ecn);if ((!ect && ecn_ok) ||tcp_ca_needs_ecn (sk))inet_rsk (oreq)->ecn_ok =1 ; }
net/ipv4/syncookies.c +1 -1
@@ -273,7 +273,7 @@ bool cookie_ecn_ok(const struct tcp_options_received *tcp_opt,if (!ecn_ok)return false; -if (net->ipv4.sysctl_tcp_ecn) +if (READ_ONCE (net->ipv4.sysctl_tcp_ecn))return true;return dst_feature (dst,RTAX_FEATURE_ECN );
net/ipv4/sysctl_net_ipv4.c +2 -0
@@ -676,6 +676,8 @@ static struct ctl_table ipv4_net_table[] = { .maxlen = sizeof(u8), .mode = 0644, .proc_handler = proc_dou8vec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_TWO, }, { .procname = "tcp_ecn_fallback",
net/ipv4/tcp_input.c +1 -1
@@ -6729,7 +6729,7 @@ static void tcp_ecn_create_request(struct request_sock *req, ect = !INET_ECN_is_not_ect (TCP_SKB_CB (skb)->ip_dsfield); ecn_ok_dst =dst_feature (dst,DST_FEATURE_ECN_MASK ); - ecn_ok = net->ipv4.sysctl_tcp_ecn || ecn_ok_dst; + ecn_ok =READ_ONCE (net->ipv4.sysctl_tcp_ecn) || ecn_ok_dst; if (((!ect || th->res1) && ecn_ok) || tcp_ca_needs_ecn(listen_sk) || (ecn_ok_dst & DST_FEATURE_ECN_CA) ||
net/ipv4/tcp_output.c +1 -1
@@ -324,7 +324,7 @@ static void tcp_ecn_send_syn(struct sock *sk, struct sk_buff *skb) {struct tcp_sock *tp =tcp_sk (sk);bool bpf_needs_ecn =tcp_bpf_ca_needs_ecn (sk); -bool use_ecn =sock_net (sk)->ipv4.sysctl_tcp_ecn ==1 || +bool use_ecn =READ_ONCE (sock_net (sk)->ipv4.sysctl_tcp_ecn) ==1 ||tcp_ca_needs_ecn (sk) || bpf_needs_ecn;if (!use_ecn) {
Signature · 1 line
2.30.2
PATCH 13/15 tcp: Fix a data-race around sysctl_tcp_ecn_fallback.
In reply to Kuniyuki IwashimaWhile reading sysctl_tcp_ecn_fallback, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader.
---
CC: Daniel Borkmann <[email protected]>
CC: Florian Westphal <[email protected]>
CC: Mirja Kühlewind <[email protected]>
CC: Brian Trammell <[email protected]>
--- net/ipv4/sysctl_net_ipv4.c | 2 ++ net/ipv4/tcp_output.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
net/ipv4/sysctl_net_ipv4.c +2 -0
@@ -685,6 +685,8 @@ static struct ctl_table ipv4_net_table[] = { .maxlen = sizeof(u8), .mode = 0644, .proc_handler = proc_dou8vec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_ONE, }, { .procname = "ip_dynaddr",
net/ipv4/tcp_output.c +1 -1
@@ -346,7 +346,7 @@ static void tcp_ecn_send_syn(struct sock *sk, struct sk_buff *skb)static void tcp_ecn_clear_syn (struct sock *sk,struct sk_buff *skb) { -if (sock_net (sk)->ipv4.sysctl_tcp_ecn_fallback) +if (READ_ONCE (sock_net (sk)->ipv4.sysctl_tcp_ecn_fallback))/* tp->ecn_flags are cleared at a later point in time when * SYN ACK is ultimatively being received. */
Signature · 1 line
2.30.2
PATCH 14/15 ipv4: Fix data-races around sysctl_ip_dynaddr.
In reply to Kuniyuki IwashimaWhile reading sysctl_ip_dynaddr, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers.
--- Documentation/networking/ip-sysctl.rst | 2 +- net/ipv4/af_inet.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Documentation/networking/ip-sysctl.rst +1 -1
@@ -1179,7 +1179,7 @@ ip_autobind_reuse - BOOLEAN option should only be set by experts. Default: 0 -ip_dynaddr - BOOLEAN +ip_dynaddr - INTEGER If set non-zero, enables support for dynamic addresses. If set to a non-zero value larger than 1, a kernel log message will be printed when dynamic address rewriting
net/ipv4/af_inet.c +2 -2
@@ -1246,7 +1246,7 @@ static int inet_sk_reselect_saddr(struct sock *sk)if (new_saddr == old_saddr)return 0 ; -if (sock_net (sk)->ipv4.sysctl_ip_dynaddr >1 ) { +if (READ_ONCE (sock_net (sk)->ipv4.sysctl_ip_dynaddr) >1 ) {pr_info ("%s(): shifting inet->saddr from %pI4 to %pI4\n" , __func__, &old_saddr, &new_saddr); }
@@ -1301,7 +1301,7 @@ int inet_sk_rebuild_header(struct sock *sk)* Other protocols have to map its equivalent state to TCP_SYN_SENT. * DCCP maps its DCCP_REQUESTING state to TCP_SYN_SENT. -acme */ -if (!sock_net (sk)->ipv4.sysctl_ip_dynaddr || +if (!READ_ONCE (sock_net (sk)->ipv4.sysctl_ip_dynaddr) || sk->sk_state !=TCP_SYN_SENT || (sk->sk_userlocks &SOCK_BINDADDR_LOCK ) || (err =inet_sk_reselect_saddr (sk)) !=0 )
Signature · 1 line
2.30.2
PATCH 15/15 nexthop: Fix data-races around nexthop_compat_mode.
In reply to Kuniyuki IwashimaWhile reading nexthop_compat_mode, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers.
---
CC: Roopa Prabhu <[email protected]>
--- net/ipv4/fib_semantics.c | 2 +- net/ipv4/nexthop.c | 5 +++-- net/ipv6/route.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-)
net/ipv4/fib_semantics.c +1 -1
@@ -1811,7 +1811,7 @@ int fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event, goto nla_put_failure;if (nexthop_is_blackhole (fi->nh)) rtm->rtm_type =RTN_BLACKHOLE ; -if (!fi->fib_net->ipv4.sysctl_nexthop_compat_mode) +if (!READ_ONCE (fi->fib_net->ipv4.sysctl_nexthop_compat_mode)) goto offload; }
net/ipv4/nexthop.c +3 -2
@@ -1858,7 +1858,7 @@ static void __remove_nexthop_fib(struct net *net, struct nexthop *nh)/* __ip6_del_rt does a release, so do a hold here */ fib6_info_hold (f6i); ipv6_stub->ip6_del_rt (net, f6i, - !net->ipv4.sysctl_nexthop_compat_mode); + !READ_ONCE (net->ipv4.sysctl_nexthop_compat_mode)); } }
@@ -2361,7 +2361,8 @@ static int insert_nexthop(struct net *net, struct nexthop *new_nh,if (!rc) {nh_base_seq_inc (net);nexthop_notify (RTM_NEWNEXTHOP , new_nh, &cfg->nlinfo); -if (replace_notify && net->ipv4.sysctl_nexthop_compat_mode) +if (replace_notify && +READ_ONCE (net->ipv4.sysctl_nexthop_compat_mode))nexthop_replace_notify (net, new_nh, &cfg->nlinfo); }
net/ipv6/route.c +1 -1
@@ -5741,7 +5741,7 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb,if (nexthop_is_blackhole (rt->nh)) rtm->rtm_type =RTN_BLACKHOLE ; -if (net->ipv4.sysctl_nexthop_compat_mode && +if (READ_ONCE (net->ipv4.sysctl_nexthop_compat_mode) &&rt6_fill_node_nexthop (skb, rt->nh, &nh_flags) <0 ) goto nla_put_failure;
Signature · 1 line
2.30.2
This series was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Hello:
This series was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Quoted 8 lines · On Mon, 11 Jul 2022 17:15:18 -0700 you wrote:
This series fixes data-races around the first 13 knobs and
nexthop_compat_modeinipv4_net_table.I will post another patch for three
early_demuxknobs later, so the next round will start fromip_default_ttl.[...]
Here is the summary with links:
- [v1,net,01/15] sysctl: Fix data-races in proc_dou8vec_minmax().
https://git.kernel.org/netdev/net/c/7dee5d7747a6 - [v1,net,02/15] sysctl: Fix data-races in proc_dointvec_ms_jiffies(). https://git.kernel.org/netdev/net/c/7d1025e55978 - [v1,net,03/15] tcp: Fix a data-race around sysctl_max_tw_buckets. https://git.kernel.org/netdev/net/c/6f605b57f378 - [v1,net,04/15] icmp: Fix a data-race around sysctl_icmp_echo_ignore_all. https://git.kernel.org/netdev/net/c/bb7bb35a63b4 - [v1,net,05/15] icmp: Fix data-races around sysctl_icmp_echo_enable_probe. https://git.kernel.org/netdev/net/c/4a2f7083cc6c - [v1,net,06/15] icmp: Fix a data-race around sysctl_icmp_echo_ignore_broadcasts. https://git.kernel.org/netdev/net/c/66484bb98ed2 - [v1,net,07/15] icmp: Fix a data-race around sysctl_icmp_ignore_bogus_error_responses. https://git.kernel.org/netdev/net/c/b04f9b7e85c7 - [v1,net,08/15] icmp: Fix a data-race around sysctl_icmp_errors_use_inbound_ifaddr. https://git.kernel.org/netdev/net/c/d2efabce81db - [v1,net,09/15] icmp: Fix a data-race around sysctl_icmp_ratelimit. https://git.kernel.org/netdev/net/c/2a4eb714841f - [v1,net,10/15] icmp: Fix a data-race around sysctl_icmp_ratemask. https://git.kernel.org/netdev/net/c/1ebcb25ad6fc - [v1,net,11/15] raw: Fix a data-race around sysctl_raw_l3mdev_accept. https://git.kernel.org/netdev/net/c/1dace014928e - [v1,net,12/15] tcp: Fix data-races around sysctl_tcp_ecn. https://git.kernel.org/netdev/net/c/4785a66702f0 - [v1,net,13/15] tcp: Fix a data-race around sysctl_tcp_ecn_fallback. https://git.kernel.org/netdev/net/c/12b8d9ca7e67 - [v1,net,14/15] ipv4: Fix data-races around sysctl_ip_dynaddr. https://git.kernel.org/netdev/net/c/e49e4aff7ec1 - [v1,net,15/15] nexthop: Fix data-races around nexthop_compat_mode. https://git.kernel.org/netdev/net/c/bdf00bf24bef
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html