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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z/14I68bvZRza6eB@pop-os.localdomain>
Date: Mon, 14 Apr 2025 14:03:31 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Toke Høiland-Jørgensen <toke@...hat.com>,
	Jamal Hadi Salim <jhs@...atatu.com>, Jiri Pirko <jiri@...nulli.us>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
	Simon Horman <horms@...nel.org>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] tc: Return an error if filters try to attach
 too many actions

On Wed, Apr 09, 2025 at 05:10:16PM -0700, Jakub Kicinski wrote:
> On Wed, 9 Apr 2025 09:44:32 -0700 Cong Wang wrote:
> > > +	if (tb[TCA_ACT_MAX_PRIO + 1]) {
> > > +		NL_SET_ERR_MSG_FMT(extack,
> > > +				   "Only %d actions supported per filter",
> > > +				   TCA_ACT_MAX_PRIO);
> > > +		return -EINVAL;  
> > 
> > I wonder ENOSPC is a better errno than EINVAL here?
> 
> I think EINVAL is fine, it's the generic "netlink says no" error code. 
> The string error should be clear enough.

IMHO, EINVAL is abused (which is probably why we introduced extack). I
prefer to find a better errno than EINVAL whenever possible.

Extack is available but it is mostly for human to read, not technically
an API for programs to interpret.

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ