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: <CANn89iLMZ2NT=DSdvGG9GpOnrfbvHo7bCk3Cj-v9cPgK-4N-oA@mail.gmail.com>
Date: Thu, 29 Feb 2024 16:45:12 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Jakub Kicinski <kuba@...nel.org>
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, Feb 29, 2024 at 4:37 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> 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 :)

This totally makes sense.

I will send a followup patch to fix all these in one go, if this is ok
with you ?

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ