diff options
| -rw-r--r-- | net/ipv4/fib_semantics.c | 2 | ||||
| -rw-r--r-- | net/ipv4/metrics.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 6608db23f54b..f3c89ccf14c5 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c | |||
| @@ -717,6 +717,8 @@ bool fib_metrics_match(struct fib_config *cfg, struct fib_info *fi) | |||
| 717 | nla_strlcpy(tmp, nla, sizeof(tmp)); | 717 | nla_strlcpy(tmp, nla, sizeof(tmp)); |
| 718 | val = tcp_ca_get_key_by_name(fi->fib_net, tmp, &ecn_ca); | 718 | val = tcp_ca_get_key_by_name(fi->fib_net, tmp, &ecn_ca); |
| 719 | } else { | 719 | } else { |
| 720 | if (nla_len(nla) != sizeof(u32)) | ||
| 721 | return false; | ||
| 720 | val = nla_get_u32(nla); | 722 | val = nla_get_u32(nla); |
| 721 | } | 723 | } |
| 722 | 724 | ||
diff --git a/net/ipv4/metrics.c b/net/ipv4/metrics.c index 5121c6475e6b..04311f7067e2 100644 --- a/net/ipv4/metrics.c +++ b/net/ipv4/metrics.c | |||
| @@ -32,6 +32,8 @@ int ip_metrics_convert(struct net *net, struct nlattr *fc_mx, int fc_mx_len, | |||
| 32 | if (val == TCP_CA_UNSPEC) | 32 | if (val == TCP_CA_UNSPEC) |
| 33 | return -EINVAL; | 33 | return -EINVAL; |
| 34 | } else { | 34 | } else { |
| 35 | if (nla_len(nla) != sizeof(u32)) | ||
| 36 | return -EINVAL; | ||
| 35 | val = nla_get_u32(nla); | 37 | val = nla_get_u32(nla); |
| 36 | } | 38 | } |
| 37 | if (type == RTAX_ADVMSS && val > 65535 - 40) | 39 | if (type == RTAX_ADVMSS && val > 65535 - 40) |
