Linux Security Modules development
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Jiayuan Chen <jiayuan.chen@linux.dev>
Cc: netdev@vger.kernel.org, David Ahern <dsahern@kernel.org>,
	Ido Schimmel <idosch@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Florian Westphal <fw@strlen.de>, Phil Sutter <phil@nwl.cc>,
	Nikolay Aleksandrov <razor@blackwall.org>,
	Paul Moore <paul@paul-moore.com>,
	Matthieu Baerts <matttbe@kernel.org>,
	Mat Martineau <martineau@kernel.org>,
	Geliang Tang <geliang@kernel.org>, Julian Anastasov <ja@ssi.bg>,
	Allison Henderson <achender@kernel.org>,
	Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	Xin Long <lucien.xin@gmail.com>,
	"D. Wythe" <alibuda@linux.alibaba.com>,
	Dust Li <dust.li@linux.alibaba.com>,
	Sidraya Jayagond <sidraya@linux.ibm.com>,
	Mahanta Jambigi <mjambigi@linux.ibm.com>,
	Tony Lu <tonylu@linux.alibaba.com>,
	Wen Gu <guwen@linux.alibaba.com>,
	linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org,
	coreteam@netfilter.org, bridge@lists.linux.dev,
	linux-security-module@vger.kernel.org, mptcp@lists.linux.dev,
	lvs-devel@vger.kernel.org, linux-rdma@vger.kernel.org,
	rds-devel@oss.oracle.com, linux-sctp@vger.kernel.org,
	linux-s390@vger.kernel.org
Subject: Re: [PATCH net-next 03/14] ipv6: annotate data-races around addrconf sysctls
Date: Fri, 13 Nov 2026 17:13:11 +0000	[thread overview]
Message-ID: <20261113171311.GN18859@horms.kernel.org> (raw)
In-Reply-To: <20261109025425.328445-4-jiayuan.chen@linux.dev>

On Mon, Nov 09, 2026 at 10:52:02AM +0800, Jiayuan Chen wrote:

...

> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c

...

> @@ -2857,7 +2859,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao)
>  		return;
>  	}
>  
> -	if (valid_lft != 0 && valid_lft < in6_dev->cnf.accept_ra_min_lft)
> +	if (valid_lft != 0 && valid_lft < READ_ONCE(in6_dev->cnf.accept_ra_min_lft))

Hi Jiayuan,

This patch introduces several lines that are longer than 80 columns,
while Networking code still prefers lines 80 columns wide or less.
I'd appreciated it if this could be addressed.

In this case, I think that could look like this (completely untested):

	if (valid_lft != 0 && 
	    alid_lft < READ_ONCE(in6_dev->cnf.accept_ra_min_lft))

>  		goto put;
>  
>  	/*
> @@ -2928,7 +2930,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao)
>  	/* Try to figure out our local address for this prefix */
>  
>  	ignore_autoconf = READ_ONCE(in6_dev->cnf.ra_honor_pio_pflag) && pinfo->preferpd;
> -	if (pinfo->autoconf && in6_dev->cnf.autoconf && !ignore_autoconf) {
> +	if (pinfo->autoconf && READ_ONCE(in6_dev->cnf.autoconf) && !ignore_autoconf) {
>  		struct in6_addr addr;
>  		bool tokenized = false, dev_addr_generated = false;
>  

Similarly here.

> @@ -3434,7 +3436,7 @@ static int ipv6_generate_stable_address(struct in6_addr *address,
>  
>  	if (ipv6_reserved_interfaceid(temp)) {
>  		dad_count++;
> -		if (dad_count > dev_net(idev->dev)->ipv6.sysctl.idgen_retries)
> +		if (dad_count > READ_ONCE(dev_net(idev->dev)->ipv6.sysctl.idgen_retries))
>  			return -1;
>  		goto retry;
>  	}

And I wonder if in this case we could do something like (completely untested):

	if (ipv6_reserved_interfaceid(temp)) {
		const struct *net net = dev_net(idev->dev)

		dad_count++;
		if (dad_count > READ_ONCE(net->ipv6.sysctl.idgen_retries))
			return -1;
		goto retry;
	}

...


  parent reply	other threads:[~2026-11-13 17:13 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09  2:51 [PATCH net-next 00/14] net: annotate data-races around sysctl knobs Jiayuan Chen
2026-11-09  2:52 ` [PATCH net-next 01/14] ipv4: annotate data-races around ip_rt_* sysctls Jiayuan Chen
2026-11-10  3:01   ` sashiko-bot
2026-11-10  5:53   ` netdev-bot+sashiko
2026-11-13 17:09     ` Simon Horman
2026-11-09  2:52 ` [PATCH net-next 02/14] inet: frags: annotate data-races around fqdir->timeout and fqdir->max_dist Jiayuan Chen
2026-11-10  3:01   ` sashiko-bot
2026-11-13 17:10   ` Simon Horman
2026-11-09  2:52 ` [PATCH net-next 03/14] ipv6: annotate data-races around addrconf sysctls Jiayuan Chen
2026-11-10  3:01   ` sashiko-bot
2026-11-13 17:13   ` Simon Horman [this message]
2026-11-09  2:52 ` [PATCH net-next 04/14] ipv6: annotate data-races around icmpv6 reply sysctls Jiayuan Chen
2026-11-10  3:01   ` sashiko-bot
2026-11-13 17:13   ` Simon Horman
2026-11-09  2:52 ` [PATCH net-next 05/14] calipso: annotate data-races around cache sysctls Jiayuan Chen
2026-11-10  3:01   ` sashiko-bot
2026-11-10  5:53   ` netdev-bot+sashiko
2026-11-13 17:14     ` Simon Horman
2026-11-09  2:52 ` [PATCH net-next 06/14] sctp: annotate data-races around sctp sysctls Jiayuan Chen
2026-11-10  3:01   ` sashiko-bot
2026-11-10  5:53   ` netdev-bot+sashiko
2026-11-13 17:14     ` Simon Horman
2026-11-09  2:52 ` [PATCH net-next 07/14] mptcp: annotate data-races around pernet sysctls Jiayuan Chen
2026-11-10  3:01   ` sashiko-bot
2026-11-10 11:28   ` Matthieu Baerts
2026-11-09  2:52 ` [PATCH net-next 08/14] rds: annotate data-races around core rds sysctls Jiayuan Chen
2026-11-10  3:01   ` sashiko-bot
2026-11-13 17:15   ` Simon Horman
2026-11-09  2:52 ` [PATCH net-next 09/14] netfilter: conntrack: annotate data-races around conntrack sysctls Jiayuan Chen
2026-11-10  3:01   ` sashiko-bot
2026-11-13 17:16   ` Simon Horman
2026-11-09  2:52 ` [PATCH net-next 10/14] netfilter: bridge: annotate data-races around br_netfilter and nf_log sysctls Jiayuan Chen
2026-11-10  3:01   ` sashiko-bot
2026-11-10  5:53   ` netdev-bot+sashiko
2026-11-13 17:16     ` Simon Horman
2026-11-09  2:52 ` [PATCH net-next 11/14] ipvs: annotate data-races around lblc_expiration and lblcr_expiration Jiayuan Chen
2026-11-10  3:01   ` sashiko-bot
2026-11-13 17:17   ` Simon Horman
2026-11-09  2:52 ` [PATCH net-next 12/14] net/smc: annotate data-races around smc sysctls Jiayuan Chen
2026-11-10  3:01   ` sashiko-bot
2026-11-12  4:54   ` Dust Li
2026-11-09  2:52 ` [PATCH net-next 13/14] netfilter: conntrack: annotate data-races around timeout and tcp sysctls Jiayuan Chen
2026-11-10  3:01   ` sashiko-bot
2026-11-13 17:19   ` Simon Horman
2026-11-09  2:52 ` [PATCH net-next 14/14] netfilter: cttimeout: annotate data-races around the default timeouts Jiayuan Chen
2026-11-10  3:01   ` sashiko-bot
2026-11-10  5:53   ` netdev-bot+sashiko
2026-11-13 17:20     ` Simon Horman
2026-11-09  3:11 ` [PATCH net-next 00/14] net: annotate data-races around sysctl knobs Jason Xing
2026-11-09  3:33   ` Jiayuan Chen
2026-11-09  6:52     ` Jason Xing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261113171311.GN18859@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=achender@kernel.org \
    --cc=alibuda@linux.alibaba.com \
    --cc=bridge@lists.linux.dev \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=dust.li@linux.alibaba.com \
    --cc=edumazet@kernel.org \
    --cc=fw@strlen.de \
    --cc=geliang@kernel.org \
    --cc=guwen@linux.alibaba.com \
    --cc=idosch@nvidia.com \
    --cc=ja@ssi.bg \
    --cc=jiayuan.chen@linux.dev \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=lvs-devel@vger.kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=martineau@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mjambigi@linux.ibm.com \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=paul@paul-moore.com \
    --cc=phil@nwl.cc \
    --cc=razor@blackwall.org \
    --cc=rds-devel@oss.oracle.com \
    --cc=sidraya@linux.ibm.com \
    --cc=tonylu@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox