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]
Message-ID: <20241206181056.3d323c0e@kernel.org>
Date: Fri, 6 Dec 2024 18:10:56 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Tariq Toukan <tariqt@...dia.com>
Cc: "David S. Miller" <davem@...emloft.net>, Paolo Abeni
 <pabeni@...hat.com>, Eric Dumazet <edumazet@...gle.com>, "Andrew Lunn"
 <andrew+netdev@...n.ch>, Leon Romanovsky <leonro@...dia.com>,
 <netdev@...r.kernel.org>, Saeed Mahameed <saeedm@...dia.com>, Gal Pressman
 <gal@...dia.com>, <linux-rdma@...r.kernel.org>, Carolina Jubran
 <cjubran@...dia.com>, Cosmin Ratiu <cratiu@...dia.com>, Jiri Pirko
 <jiri@...dia.com>
Subject: Re: [PATCH net-next V5 07/11] devlink: Extend devlink rate API with
 traffic classes bandwidth management

On Thu, 5 Dec 2024 00:09:27 +0200 Tariq Toukan wrote:
> +          min: 0
> +          max: 100

Are full percentage points sufficient granularity?

> +	if (!tb[DEVLINK_ATTR_RATE_TC_INDEX]) {

NL_SET_ERR_ATTR_MISS()

Please limit the string messages where error can be expressed in
machine readable form.

> +		NL_SET_ERR_MSG(extack, "Traffic class index is expected");
> +		return -EINVAL;
> +	}
> +
> +	tc_index = nla_get_u8(tb[DEVLINK_ATTR_RATE_TC_INDEX]);
> +
> +	if (tc_index >= IEEE_8021QAZ_MAX_TCS) {

This can't be enforced by the policy?

> +		NL_SET_ERR_MSG_FMT(extack,
> +				   "Provided traffic class index (%u) exceeds the maximum allowed value (%u)",
> +				   tc_index, IEEE_8021QAZ_MAX_TCS - 1);
> +		return -EINVAL;
> +	}
> +
> +	if (!tb[DEVLINK_ATTR_RATE_TC_BW]) {
> +		NL_SET_ERR_MSG(extack, "Traffic class bandwidth is expected");
> +		return -EINVAL;
> +	}
> +
> +	if (test_and_set_bit(tc_index, bitmap)) {
> +		NL_SET_ERR_MSG(extack, "Duplicate traffic class index specified");

always try to point to attr that caused the issue

> +		return -EINVAL;
> +	}
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ