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: <20240229073750.6e59155e@kernel.org>
Date: Thu, 29 Feb 2024 07:37:50 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Eric Dumazet <edumazet@...gle.com>
Cc: "David S . Miller" <davem@...emloft.net>, Paolo Abeni
 <pabeni@...hat.com>, Jiri Pirko <jiri@...dia.com>, David Ahern
 <dsahern@...nel.org>, netdev@...r.kernel.org, Florian Westphal
 <fw@...len.de>, eric.dumazet@...il.com
Subject: Re: [PATCH net-next 6/6] inet: use xa_array iterator to implement
 inet_dump_ifaddr()

On Thu, 29 Feb 2024 11:40:16 +0000 Eric Dumazet wrote:
> +	if (err < 0 && likely(skb->len))
> +		err = skb->len;

I think Ido may have commented on one of your early series, but if we
set err to skb->len we'll have to do an extra empty message to terminate
the dump.

You basically only want to return skb->len when message has
overflown, so the somewhat idiomatic way to do this is:

	err = (err == -EMSGSIZE) ? skb->len : err;

Assuming err can't be set to some weird positive value.

IDK if you want to do this in future patches or it's risky, but I have
the itch to tell you every time I see a conversion which doesn't follow
this pattern :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ