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  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:   Tue, 19 Feb 2019 18:27:59 -0800
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     Michal Kubecek <mkubecek@...e.cz>
Cc:     netdev@...r.kernel.org, David Miller <davem@...emloft.net>,
        Andrew Lunn <andrew@...n.ch>, Jiri Pirko <jiri@...nulli.us>,
        linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH net-next v3 05/21] ethtool: netlink bitset handling

On Mon, 18 Feb 2019 19:21:49 +0100 (CET), Michal Kubecek wrote:
> +		else if (is_u32)
> +			bitmap_from_arr32(val, bitmap, nbits);
> +		else
> +			bitmap_copy(val, bitmap, nbits);
> +		nla_for_each_nested(bit_attr, tb[ETHA_BITSET_BITS], rem) {
> +			*err = ethnl_update_bit(val, mask, nbits, bit_attr,
> +						is_list, names, legacy, info);
> +			if (*err < 0)
> +				goto out_free;
> +		}
> +		if (bitmask)
> +			__bitmap_to_any(bitmask, mask, nbits, is_u32);
> +	} else {
> +		unsigned int change_words = DIV_ROUND_UP(change_bits, 32);
> +
> +		*err = 0;
> +		if (change_bits == 0 && tb[ETHA_BITSET_MASK])
> +			goto out_free;
> +		*err = -EINVAL;
> +		if (!tb[ETHA_BITSET_VALUE])
> +			goto out_free;

!tb[ETHA_BITSET_BITS] && !tb[ETHA_BITSET_VALUE] is already rejected
above.

> +		if (nla_len(tb[ETHA_BITSET_VALUE]) < change_words * sizeof(u32))
> +			goto out_free;
> +		if (tb[ETHA_BITSET_MASK] &&
> +		    nla_len(tb[ETHA_BITSET_MASK]) < change_words * sizeof(u32))
> +			goto out_free;
> +
> +		bitmap_from_arr32(val, nla_data(tb[ETHA_BITSET_VALUE]),
> +				  change_bits);
> +		if (tb[ETHA_BITSET_MASK])
> +			bitmap_from_arr32(mask, nla_data(tb[ETHA_BITSET_MASK]),
> +					  change_bits);
> +		else
> +			bitmap_fill(mask, nbits);
> +
> +		if (nbits < change_bits) {
> +			unsigned int idx = find_next_bit(mask, max_bits, nbits);
> +
> +			*err = -EINVAL;
> +			if (idx < max_bits)
> +				goto out_free;
> +		}

Powered by blists - more mailing lists