Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.

Fixes: aaa5f515b16b ("net: ipv6: new accept_untracked_na option to accept na only if in-network")
Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
Suggested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Suggested-by: Roopa Prabhu <roopa@nvidia.com>
Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Link: https://lore.kernel.org/r/20220720183632.376138-1-jhpark1013@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Jaehee Park and committed by
Jakub Kicinski
b66eb3a6 842463f2

+3 -3
+3 -3
net/ipv6/addrconf.c
··· 7042 7042 .data = &ipv6_devconf.accept_untracked_na, 7043 7043 .maxlen = sizeof(int), 7044 7044 .mode = 0644, 7045 - .proc_handler = proc_dointvec, 7046 - .extra1 = (void *)SYSCTL_ZERO, 7047 - .extra2 = (void *)SYSCTL_ONE, 7045 + .proc_handler = proc_dointvec_minmax, 7046 + .extra1 = SYSCTL_ZERO, 7047 + .extra2 = SYSCTL_TWO, 7048 7048 }, 7049 7049 { 7050 7050 /* sentinel */