Johannes Berg <[email protected]> wrote:
> + * nla_validate_strict - Strictly validate a stream of attributes
> + * @head: head of attribute stream
> + * @len: length of attribute stream
> + * @maxtype: maximum attribute type to be expected
> + * @policy: validation policy
> + * @extack: extended ACK report struct
> + *
> + * Validates all attributes in the specified attribute stream against the
> + * specified policy. Attributes with a type exceeding maxtype will be
> + * ignored.
      ^^^^^^^^
rejected?

> +int nla_validate_strict(const struct nlattr *head, int len, int maxtype,
> +                     const struct nla_policy *policy,
> +                     struct netlink_ext_ack *extack)
> +{
> +     const struct nlattr *nla;
> +     int rem;
> +
> +     nla_for_each_attr(nla, head, len, rem) {
> +             u16 type = nla_type(nla);
> +             int err;
> +
> +             if (type == 0 || type > maxtype) {
> +                     NL_SET_ERR_MSG(extack, "Unknown attribute type");

Sure looks like it, and thats good.

Reply via email to