aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/netlink.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2019-05-28 10:56:03 +0200
committerJohannes Berg <johannes.berg@intel.com>2019-06-14 14:12:01 +0200
commit901bb9891855164fdcfcfdd9c3d25bcc800d3f5b (patch)
tree74e0821a522ebb1f5bee4cb8df8705dd1a4442f3 /include/net/netlink.h
parentd7edf40c15e85b44c4bef146819b664089b827b1 (diff)
downloadlinux-901bb9891855164fdcfcfdd9c3d25bcc800d3f5b.tar.gz
nl80211: require and validate vendor command policy
Require that each vendor command give a policy of its sub-attributes in NL80211_ATTR_VENDOR_DATA, and then (stricly) check the contents, including the NLA_F_NESTED flag that we couldn't check on the outer layer because there we don't know yet. It is possible to use VENDOR_CMD_RAW_DATA for raw data, but then no nested data can be given (NLA_F_NESTED flag must be clear) and the data is just passed as is to the command. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net/netlink.h')
-rw-r--r--include/net/netlink.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 395b4406f4b08..28ece67f53127 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -1755,6 +1755,15 @@ static inline int __nla_validate_nested(const struct nlattr *start, int maxtype,
}
static inline int
+nl80211_validate_nested(const struct nlattr *start, int maxtype,
+ const struct nla_policy *policy,
+ struct netlink_ext_ack *extack)
+{
+ return __nla_validate_nested(start, maxtype, policy,
+ NL_VALIDATE_STRICT, extack);
+}
+
+static inline int
nla_validate_nested_deprecated(const struct nlattr *start, int maxtype,
const struct nla_policy *policy,
struct netlink_ext_ack *extack)