diff options
| author | Yue Haibing <yuehaibing@huawei.com> | 2025-09-01 20:37:26 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-11-13 15:34:18 -0500 |
| commit | 483303d94c2d4452a5eac12ed97263c5c486ac5a (patch) | |
| tree | 2d64f6365987ae7f1977c981edd3110d2f54f496 /net | |
| parent | 356f6a277f05f1339d1d0c403b6df19f92c5f5f1 (diff) | |
| download | linux-483303d94c2d4452a5eac12ed97263c5c486ac5a.tar.gz linux-483303d94c2d4452a5eac12ed97263c5c486ac5a.tar.bz2 linux-483303d94c2d4452a5eac12ed97263c5c486ac5a.zip | |
ipv6: Add sanity checks on ipv6_devconf.rpl_seg_enabled
[ Upstream commit 3d95261eeb74958cd496e1875684827dc5d028cc ]
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>
Link: https://patch.msgid.link/20250901123726.1972881-3-yuehaibing@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
| -rw-r--r-- | net/ipv6/addrconf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 49ec223f2eda..228cf72e5250 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -7176,7 +7176,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", |
