linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v3 net-next 0/2] ipv6: improve rpl_seg_enabled sysctl handling
  2025-09-01 12:37 [PATCH v3 net-next 0/2] ipv6: improve rpl_seg_enabled sysctl handling Yue Haibing
@ 2025-09-01 12:26 ` Yue Haibing
  2025-09-01 12:37 ` [PATCH v3 net-next 1/2] ipv6: annotate data-races around devconf->rpl_seg_enabled Yue Haibing
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Yue Haibing @ 2025-09-01 12:26 UTC (permalink / raw)
  To: davem, dsahern, edumazet, kuba, pabeni, horms, kuniyu
  Cc: netdev, linux-kernel

On 2025/9/1 20:37, Yue Haibing wrote:
> First commit annotate data-races around it and second one add sanity check that
> prevents unintentional misconfiguration.
> 
I forget to mention the revision history

v3: split v2 into two separate ones and drop Fixes tag.
v2: add extra1/2 check

> Yue Haibing (2):
>   ipv6: annotate data-races around devconf->rpl_seg_enabled
>   ipv6: Add sanity checks on ipv6_devconf.rpl_seg_enabled
> 
>  net/ipv6/addrconf.c | 4 +++-
>  net/ipv6/exthdrs.c  | 6 ++----
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 

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

* [PATCH v3 net-next 0/2] ipv6: improve rpl_seg_enabled sysctl handling
@ 2025-09-01 12:37 Yue Haibing
  2025-09-01 12:26 ` Yue Haibing
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Yue Haibing @ 2025-09-01 12:37 UTC (permalink / raw)
  To: davem, dsahern, edumazet, kuba, pabeni, horms, kuniyu
  Cc: netdev, linux-kernel, yuehaibing

First commit annotate data-races around it and second one add sanity check that
prevents unintentional misconfiguration.

Yue Haibing (2):
  ipv6: annotate data-races around devconf->rpl_seg_enabled
  ipv6: Add sanity checks on ipv6_devconf.rpl_seg_enabled

 net/ipv6/addrconf.c | 4 +++-
 net/ipv6/exthdrs.c  | 6 ++----
 2 files changed, 5 insertions(+), 5 deletions(-)

-- 
2.34.1


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

* [PATCH v3 net-next 1/2] ipv6: annotate data-races around devconf->rpl_seg_enabled
  2025-09-01 12:37 [PATCH v3 net-next 0/2] ipv6: improve rpl_seg_enabled sysctl handling Yue Haibing
  2025-09-01 12:26 ` Yue Haibing
@ 2025-09-01 12:37 ` Yue Haibing
  2025-09-01 12:37 ` [PATCH v3 net-next 2/2] ipv6: Add sanity checks on ipv6_devconf.rpl_seg_enabled Yue Haibing
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Yue Haibing @ 2025-09-01 12:37 UTC (permalink / raw)
  To: davem, dsahern, edumazet, kuba, pabeni, horms, kuniyu
  Cc: netdev, linux-kernel, yuehaibing

devconf->rpl_seg_enabled can be changed concurrently from
/proc/sys/net/ipv6/conf, annotate lockless reads on it.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
---
 net/ipv6/exthdrs.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index d1ef9644f826..a23eb8734e15 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -494,10 +494,8 @@ static int ipv6_rpl_srh_rcv(struct sk_buff *skb)
 
 	idev = __in6_dev_get(skb->dev);
 
-	accept_rpl_seg = net->ipv6.devconf_all->rpl_seg_enabled;
-	if (accept_rpl_seg > idev->cnf.rpl_seg_enabled)
-		accept_rpl_seg = idev->cnf.rpl_seg_enabled;
-
+	accept_rpl_seg = min(READ_ONCE(net->ipv6.devconf_all->rpl_seg_enabled),
+			     READ_ONCE(idev->cnf.rpl_seg_enabled));
 	if (!accept_rpl_seg) {
 		kfree_skb(skb);
 		return -1;
-- 
2.34.1


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

* [PATCH v3 net-next 2/2] ipv6: Add sanity checks on ipv6_devconf.rpl_seg_enabled
  2025-09-01 12:37 [PATCH v3 net-next 0/2] ipv6: improve rpl_seg_enabled sysctl handling Yue Haibing
  2025-09-01 12:26 ` Yue Haibing
  2025-09-01 12:37 ` [PATCH v3 net-next 1/2] ipv6: annotate data-races around devconf->rpl_seg_enabled Yue Haibing
@ 2025-09-01 12:37 ` Yue Haibing
  2025-09-03  0:10 ` [PATCH v3 net-next 0/2] ipv6: improve rpl_seg_enabled sysctl handling patchwork-bot+netdevbpf
  2025-09-03  0:10 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: Yue Haibing @ 2025-09-01 12:37 UTC (permalink / raw)
  To: davem, dsahern, edumazet, kuba, pabeni, horms, kuniyu
  Cc: netdev, linux-kernel, yuehaibing

In ipv6_rpl_srh_rcv() we use min(net->ipv6.devconf_all->rpl_seg_enabled,
idev->cnf.rpl_seg_enabled) is intended to return 0 when either value is
zero, but if one of the values is negative it will in fact return non-zero.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
---
 net/ipv6/addrconf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index f17a5dd4789f..40e9c336f6c5 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -7238,7 +7238,9 @@ static const struct ctl_table addrconf_sysctl[] = {
 		.data		= &ipv6_devconf.rpl_seg_enabled,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
+		.proc_handler   = proc_dointvec_minmax,
+		.extra1         = SYSCTL_ZERO,
+		.extra2         = SYSCTL_ONE,
 	},
 	{
 		.procname	= "ioam6_enabled",
-- 
2.34.1


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

* Re: [PATCH v3 net-next 0/2] ipv6: improve rpl_seg_enabled sysctl handling
  2025-09-01 12:37 [PATCH v3 net-next 0/2] ipv6: improve rpl_seg_enabled sysctl handling Yue Haibing
                   ` (2 preceding siblings ...)
  2025-09-01 12:37 ` [PATCH v3 net-next 2/2] ipv6: Add sanity checks on ipv6_devconf.rpl_seg_enabled Yue Haibing
@ 2025-09-03  0:10 ` patchwork-bot+netdevbpf
  2025-09-03  0:10 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-03  0:10 UTC (permalink / raw)
  To: Yue Haibing
  Cc: davem, dsahern, edumazet, kuba, pabeni, horms, kuniyu, netdev,
	linux-kernel

Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 1 Sep 2025 20:37:24 +0800 you wrote:
> First commit annotate data-races around it and second one add sanity check that
> prevents unintentional misconfiguration.
> 
> Yue Haibing (2):
>   ipv6: annotate data-races around devconf->rpl_seg_enabled
>   ipv6: Add sanity checks on ipv6_devconf.rpl_seg_enabled
> 
> [...]

Here is the summary with links:
  - [v3,net-next,1/2] ipv6: annotate data-races around devconf->rpl_seg_enabled
    https://git.kernel.org/netdev/net/c/3a5f55500f3e
  - [v3,net-next,2/2] ipv6: Add sanity checks on ipv6_devconf.rpl_seg_enabled
    (no matching commit)

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH v3 net-next 0/2] ipv6: improve rpl_seg_enabled sysctl handling
  2025-09-01 12:37 [PATCH v3 net-next 0/2] ipv6: improve rpl_seg_enabled sysctl handling Yue Haibing
                   ` (3 preceding siblings ...)
  2025-09-03  0:10 ` [PATCH v3 net-next 0/2] ipv6: improve rpl_seg_enabled sysctl handling patchwork-bot+netdevbpf
@ 2025-09-03  0:10 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-03  0:10 UTC (permalink / raw)
  To: Yue Haibing
  Cc: davem, dsahern, edumazet, kuba, pabeni, horms, kuniyu, netdev,
	linux-kernel

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 1 Sep 2025 20:37:24 +0800 you wrote:
> First commit annotate data-races around it and second one add sanity check that
> prevents unintentional misconfiguration.
> 
> Yue Haibing (2):
>   ipv6: annotate data-races around devconf->rpl_seg_enabled
>   ipv6: Add sanity checks on ipv6_devconf.rpl_seg_enabled
> 
> [...]

Here is the summary with links:
  - [v3,net-next,1/2] ipv6: annotate data-races around devconf->rpl_seg_enabled
    (no matching commit)
  - [v3,net-next,2/2] ipv6: Add sanity checks on ipv6_devconf.rpl_seg_enabled
    https://git.kernel.org/netdev/net-next/c/3d95261eeb74

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-09-03  0:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-01 12:37 [PATCH v3 net-next 0/2] ipv6: improve rpl_seg_enabled sysctl handling Yue Haibing
2025-09-01 12:26 ` Yue Haibing
2025-09-01 12:37 ` [PATCH v3 net-next 1/2] ipv6: annotate data-races around devconf->rpl_seg_enabled Yue Haibing
2025-09-01 12:37 ` [PATCH v3 net-next 2/2] ipv6: Add sanity checks on ipv6_devconf.rpl_seg_enabled Yue Haibing
2025-09-03  0:10 ` [PATCH v3 net-next 0/2] ipv6: improve rpl_seg_enabled sysctl handling patchwork-bot+netdevbpf
2025-09-03  0:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).