aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2015-08-31 15:58:46 +0200
committerDavid S. Miller <davem@davemloft.net>2015-08-31 12:34:00 -0700
commitb8d3e4163a3562d7cba486687904383e78e7dd6a (patch)
tree89ae9d8715c49d32593acad50712c4a6050d8969 /net/ipv6
parentnet: fib6: reduce identation in ip6_convert_metrics (diff)
downloadlinux-dev-b8d3e4163a3562d7cba486687904383e78e7dd6a.tar.xz
linux-dev-b8d3e4163a3562d7cba486687904383e78e7dd6a.zip
fib, fib6: reject invalid feature bits
Feature bits that are invalid should not be accepted by the kernel, only the lower 4 bits may be configured, but not the remaining ones. Even from these 4, 2 of them are unused. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/route.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 0261b721b34b..8771530df45e 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1728,6 +1728,8 @@ static int ip6_convert_metrics(struct mx6_config *mxc,
} else {
val = nla_get_u32(nla);
}
+ if (type == RTAX_FEATURES && (val & ~RTAX_FEATURE_MASK))
+ goto err;
mp[type - 1] = val;
__set_bit(type - 1, mxc->mx_valid);