diff options
author | Francesco Dolcini <francesco.dolcini@toradex.com> | 2023-04-28 09:48:09 +0200 |
---|---|---|
committer | Francesco Dolcini <francesco.dolcini@toradex.com> | 2023-04-28 09:48:09 +0200 |
commit | 3fd4c5f80236d70c761426c63b924165163a9b18 (patch) | |
tree | bb9f71b139fcd78ef9823419f7f50bf6451020e9 /lib/nlattr.c | |
parent | 36cfec284d54155d2c2c7acc73e6b6b0a2aa0949 (diff) | |
parent | 2c23e6c538c879e380401ae4b236f54020618eaa (diff) |
Merge tag '08.06.00.007' into toradex_ti-linux-5.10.y_bringup_sync
Merge TI Linux Kernel Release 08.06.00.007
Diffstat (limited to 'lib/nlattr.c')
-rw-r--r-- | lib/nlattr.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/nlattr.c b/lib/nlattr.c index fe60f9ae9db1..aa8fc4371e93 100644 --- a/lib/nlattr.c +++ b/lib/nlattr.c @@ -10,6 +10,7 @@ #include <linux/kernel.h> #include <linux/errno.h> #include <linux/jiffies.h> +#include <linux/nospec.h> #include <linux/skbuff.h> #include <linux/string.h> #include <linux/types.h> @@ -369,6 +370,7 @@ static int validate_nla(const struct nlattr *nla, int maxtype, if (type <= 0 || type > maxtype) return 0; + type = array_index_nospec(type, maxtype + 1); pt = &policy[type]; BUG_ON(pt->type > NLA_TYPE_MAX); @@ -584,6 +586,7 @@ static int __nla_validate_parse(const struct nlattr *head, int len, int maxtype, } continue; } + type = array_index_nospec(type, maxtype + 1); if (policy) { int err = validate_nla(nla, maxtype, policy, validate, extack, depth); |