lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 25 Mar 2019 18:08:03 +0100 (CET)
From:   Michal Kubecek <mkubecek@...e.cz>
To:     David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Cc:     Jakub Kicinski <jakub.kicinski@...ronome.com>,
        Jiri Pirko <jiri@...nulli.us>, Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        John Linville <linville@...driver.com>,
        Stephen Hemminger <stephen@...workplumber.org>,
        linux-kernel@...r.kernel.org
Subject: [PATCH net-next v5 03/22] netlink: add strict version of
 nla_parse_nested()

Similar to nla_parse_strict() and nlmsg_parse_strict(), add also
nla_parse_nested_strict() as a version of nla_parse_nested() with strict
policy checking.

Signed-off-by: Michal Kubecek <mkubecek@...e.cz>
---
 include/net/netlink.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/net/netlink.h b/include/net/netlink.h
index bc0497076bec..723139637ba4 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -913,6 +913,15 @@ static inline int nla_parse_nested(struct nlattr *tb[], int maxtype,
 			 extack);
 }
 
+static inline int nla_parse_nested_strict(struct nlattr *tb[], int maxtype,
+					  const struct nlattr *nla,
+					  const struct nla_policy *policy,
+					  struct netlink_ext_ack *extack)
+{
+	return nla_parse_strict(tb, maxtype, nla_data(nla), nla_len(nla),
+				policy, extack);
+}
+
 /**
  * nla_put_u8 - Add a u8 netlink attribute to a socket buffer
  * @skb: socket buffer to add attribute to
-- 
2.21.0

Powered by blists - more mailing lists