diff options
author | Johannes Berg <johannes.berg@intel.com> | 2018-09-17 11:57:29 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-18 19:51:29 -0700 |
commit | b60b87fc2996240e298529a46e122ef62ef9c27f (patch) | |
tree | a39a2b84798368f1c53b412586eff77e6e3b1673 /arch/arm/boot | |
parent | 568b742a9d9888aca876b6ad9fa45490f18bee0a (diff) | |
download | linux-b60b87fc2996240e298529a46e122ef62ef9c27f.tar.bz2 |
netlink: add ethernet address policy types
Commonly, ethernet addresses are just using a policy of
{ .len = ETH_ALEN }
which leaves userspace free to send more data than it should,
which may hide bugs.
Introduce NLA_EXACT_LEN which checks for exact size, rejecting
the attribute if it's not exactly that length. Also add
NLA_EXACT_LEN_WARN which requires the minimum length and will
warn on longer attributes, for backward compatibility.
Use these to define NLA_POLICY_ETH_ADDR (new strict policy) and
NLA_POLICY_ETH_ADDR_COMPAT (compatible policy with warning);
these are used like this:
static const struct nla_policy <name>[...] = {
[NL_ATTR_NAME] = NLA_POLICY_ETH_ADDR,
...
};
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/arm/boot')
0 files changed, 0 insertions, 0 deletions