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: <20240408121324.01dc4893@kernel.org>
Date: Mon, 8 Apr 2024 12:13:24 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Heng Qi <hengqi@...ux.alibaba.com>
Cc: netdev@...r.kernel.org, virtualization@...ts.linux.dev, "David S.
 Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo
 Abeni <pabeni@...hat.com>, Jason Wang <jasowang@...hat.com>, "Michael S.
 Tsirkin" <mst@...hat.com>, Ratheesh Kannoth <rkannoth@...vell.com>,
 Alexander Lobakin <aleksander.lobakin@...el.com>, Xuan Zhuo
 <xuanzhuo@...ux.alibaba.com>
Subject: Re: [PATCH net-next v4 1/4] ethtool: provide customized dim profile
 management

On Mon,  8 Apr 2024 11:44:27 +0800 Heng Qi wrote:
> +	nla_for_each_nested(nest, nests, rem) {
> +		if (WARN_ONCE(nla_type(nest) != ETHTOOL_A_MODERATIONS_MODERATION,
> +			      "unexpected nest attrtype %u\n", nla_type(nest)))

Maybe just use the newly added nla_for_each_nested_type() 

> +			return;
> +
> +		ret = nla_parse_nested(tb_moder,
> +				       ARRAY_SIZE(coalesce_set_profile_policy) - 1,
> +				       nest, coalesce_set_profile_policy,
> +				       extack);
> +		if (ret ||

if parsing failed it will set the right error and extack, just return
the error

> +		    !tb_moder[ETHTOOL_A_MODERATION_USEC] ||
> +		    !tb_moder[ETHTOOL_A_MODERATION_PKTS] ||
> +		    !tb_moder[ETHTOOL_A_MODERATION_COMPS]) {

If you miss an attr you should use NL_SET_ERR_ATTR_MISS() or such.

> +			NL_SET_ERR_MSG(extack, "wrong ETHTOOL_A_MODERATION_* attribute\n");

no new line at the end of the exact string

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ