Skip to contentSkip to conversation

net: ipv6: avoid accepting values greater than 2 for accept_untracked_na

PATCH Applied Jaehee Park 3 participants 3 messages Jul 20, 2022 – Jul 22, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: ipv6: avoid accepting values greater than 2 for accept_untracked_na

The accept_untracked_na sysctl changed from a boolean to an integer when a new knob '2' was added. This patch provides a safeguard to avoid accepting values that are not defined in the sysctl. When setting a value greater than 2, the user will get an 'invalid argument' warning.

---
v2
- got rid of unnecessary void cast in extra1 and extra2

 net/ipv6/addrconf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
net/ipv6/addrconf.c +3 -3
index 6ed807b6c647..b624e3d8c5f0 100644
@@ -7042,9 +7042,9 @@ static const struct ctl_table addrconf_sysctl[] = {
 		.data		= &ipv6_devconf.accept_untracked_na,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
-		.extra1		= (void *)SYSCTL_ZERO,
-		.extra2		= (void *)SYSCTL_ONE,
+		.proc_handler	= proc_dointvec_minmax,
+		.extra1		= SYSCTL_ZERO,
+		.extra2		= SYSCTL_TWO,
 	},
 	{
 		/* sentinel */
Signature · 1 line
2.30.2
Reviewed-by on v2 1/1
#1 lore raw

Le 20/07/2022 à 20:36, Jaehee Park a écrit :

Quoted 8 lines

The accept_untracked_na sysctl changed from a boolean to an integer when a new knob '2' was added. This patch provides a safeguard to avoid accepting values that are not defined in the sysctl. When setting a value greater than 2, the user will get an 'invalid argument' warning.

#2 lore raw
In reply to Jaehee Park
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Wed, 20 Jul 2022 14:36:32 -0400 you wrote:

The accept_untracked_na sysctl changed from a boolean to an integer when a new knob '2' was added. This patch provides a safeguard to avoid accepting values that are not defined in the sysctl. When setting a value greater than 2, the user will get an 'invalid argument' warning.

[...]

Here is the summary with links:
- [v2,net-next] net: ipv6: avoid accepting values greater than 2 for accept_untracked_na

    https://git.kernel.org/netdev/net-next/c/b66eb3a6e427

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html