summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-01-05 14:36:10 -0800
committerJakub Kicinski <kuba@kernel.org>2022-01-05 14:36:10 -0800
commitb9adba350a841e8233d3e4d8d3c8dede3fc88c46 (patch)
tree2fbaa3fb25cf76d44a510e0c4f96c02622e268f9 /net/core
parent4e4f325a0a55907b14f579e6b1a38c53755e3de2 (diff)
parent75acfdb6fd922598a408a0d864486aeb167c1a97 (diff)
downloadlinux-b9adba350a841e8233d3e4d8d3c8dede3fc88c46.tar.bz2
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
No conflicts. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/lwtunnel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/core/lwtunnel.c b/net/core/lwtunnel.c
index 2820aca2173a..9ccd64e8a666 100644
--- a/net/core/lwtunnel.c
+++ b/net/core/lwtunnel.c
@@ -197,6 +197,10 @@ int lwtunnel_valid_encap_type_attr(struct nlattr *attr, int remaining,
nla_entype = nla_find(attrs, attrlen, RTA_ENCAP_TYPE);
if (nla_entype) {
+ if (nla_len(nla_entype) < sizeof(u16)) {
+ NL_SET_ERR_MSG(extack, "Invalid RTA_ENCAP_TYPE");
+ return -EINVAL;
+ }
encap_type = nla_get_u16(nla_entype);
if (lwtunnel_valid_encap_type(encap_type,