projects
/
platform
/
kernel
/
linux-starfive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sbitmap: Try each queue to wake up at least one waiter
[platform/kernel/linux-starfive.git]
/
lib
/
nlattr.c
diff --git
a/lib/nlattr.c
b/lib/nlattr.c
index
b67a53e
..
dffd60e
100644
(file)
--- 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/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>
#include <linux/skbuff.h>
#include <linux/string.h>
#include <linux/types.h>
@@
-381,6
+382,7
@@
static int validate_nla(const struct nlattr *nla, int maxtype,
if (type <= 0 || type > maxtype)
return 0;
if (type <= 0 || type > maxtype)
return 0;
+ type = array_index_nospec(type, maxtype + 1);
pt = &policy[type];
BUG_ON(pt->type > NLA_TYPE_MAX);
pt = &policy[type];
BUG_ON(pt->type > NLA_TYPE_MAX);
@@
-596,6
+598,7
@@
static int __nla_validate_parse(const struct nlattr *head, int len, int maxtype,
}
continue;
}
}
continue;
}
+ type = array_index_nospec(type, maxtype + 1);
if (policy) {
int err = validate_nla(nla, maxtype, policy,
validate, extack, depth);
if (policy) {
int err = validate_nla(nla, maxtype, policy,
validate, extack, depth);