From: Simon Horman <horms@kernel.org>
To: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: davem@davemloft.net, dsahern@kernel.org, edumazet@google.com,
kuba@kernel.org, kuni1840@gmail.com, netdev@vger.kernel.org,
pabeni@redhat.com
Subject: Re: [PATCH v2 net-next 10/14] ipv6: Factorise ip6_route_multipath_add().
Date: Tue, 15 Apr 2025 19:38:45 +0100 [thread overview]
Message-ID: <20250415183845.GE395307@horms.kernel.org> (raw)
In-Reply-To: <20250414180731.26130-1-kuniyu@amazon.com>
On Mon, Apr 14, 2025 at 11:06:58AM -0700, Kuniyuki Iwashima wrote:
> From: Simon Horman <horms@kernel.org>
> Date: Mon, 14 Apr 2025 15:52:26 +0100
> > On Fri, Apr 11, 2025 at 12:33:46PM -0700, Kuniyuki Iwashima wrote:
> > > From: Simon Horman <horms@kernel.org>
> > > Date: Fri, 11 Apr 2025 11:34:04 +0100
...
> > > > Hi Kuniyuki-san,
> > > >
> > > > Perhaps it can't happen in practice,
> > >
> > > Yes, it never happens by patch 1 as rtm_to_fib6_multipath_config()
> > > returns an error in such a case.
> > >
> > >
> > > > but if the loop above iterates zero
> > > > times then err will be used uninitialised. As it's expected that err is 0
> > > > here, perhaps it would be simplest to just:
> > > >
> > > > return 0;
> > >
> > > If we want to return 0 above, we need to duplicate list_splice() at
> > > err: and return err; there. Or initialise err = 0, but this looks
> > > worse to me.
> >
> > Thanks. I should have dug a bit deeper to determine that this
> > is a false-positive.
> >
> > > Btw, was this caught by Smatch, Coverity, or something ? I don't
> > > see such a report at CI.
> > > https://patchwork.kernel.org/project/netdevbpf/patch/20250409011243.26195-11-kuniyu@amazon.com/
> >
> > Sorry for not mentioning that it was flagged by Smatch,
> > I certainly should have done so.
>
> Thanks for confirming!
>
> >
> >
> > >
> > > If so, I'm just curious if we have an official guideline for
> > > false-positives flagged by such tools, like we should care about it
> > > while writing a code and should try to be safer to make it happy.
> > >
> > > We are also running Coverity for the mainline kernel and have tons
> > > of false-positive reports due to lack of contexts.
> >
> > I think that the current non-guideline is that we don't change
> > code just to keep the tools happy. Perhaps we should add something
> > about that to the process document?
>
> Makes sense.
>
> But looks like the series was marked Changes Requested, not sure
> if it's accidental or intentional, so I'll resend v2 to see others'
> opinion.
I'm not sure either.
But I agree that a v2 is a good way forward.
next prev parent reply other threads:[~2025-04-15 18:38 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-09 1:12 [PATCH v2 net-next 00/14] ipv6: No RTNL for IPv6 routing table Kuniyuki Iwashima
2025-04-09 1:12 ` [PATCH v2 net-next 01/14] ipv6: Validate RTA_GATEWAY of RTA_MULTIPATH in rtm_to_fib6_config() Kuniyuki Iwashima
2025-04-09 1:12 ` [PATCH v2 net-next 02/14] ipv6: Get rid of RTNL for SIOCDELRT and RTM_DELROUTE Kuniyuki Iwashima
2025-04-09 1:12 ` [PATCH v2 net-next 03/14] ipv6: Move some validation from ip6_route_info_create() to rtm_to_fib6_config() Kuniyuki Iwashima
2025-04-09 1:12 ` [PATCH v2 net-next 04/14] ipv6: Check GATEWAY in rtm_to_fib6_multipath_config() Kuniyuki Iwashima
2025-04-09 1:12 ` [PATCH v2 net-next 05/14] ipv6: Move nexthop_find_by_id() after fib6_info_alloc() Kuniyuki Iwashima
2025-04-09 1:12 ` [PATCH v2 net-next 06/14] ipv6: Split ip6_route_info_create() Kuniyuki Iwashima
2025-04-09 1:12 ` [PATCH v2 net-next 07/14] ipv6: Preallocate rt->fib6_nh->rt6i_pcpu in ip6_route_info_create() Kuniyuki Iwashima
2025-04-09 1:12 ` [PATCH v2 net-next 08/14] ipv6: Preallocate nhc_pcpu_rth_output " Kuniyuki Iwashima
2025-04-09 1:12 ` [PATCH v2 net-next 09/14] ipv6: Don't pass net to ip6_route_info_append() Kuniyuki Iwashima
2025-04-09 1:12 ` [PATCH v2 net-next 10/14] ipv6: Factorise ip6_route_multipath_add() Kuniyuki Iwashima
2025-04-11 10:34 ` Simon Horman
2025-04-11 19:33 ` Kuniyuki Iwashima
2025-04-14 14:52 ` Simon Horman
2025-04-14 18:06 ` Kuniyuki Iwashima
2025-04-15 18:38 ` Simon Horman [this message]
2025-04-09 1:12 ` [PATCH v2 net-next 11/14] ipv6: Protect fib6_link_table() with spinlock Kuniyuki Iwashima
2025-04-09 1:12 ` [PATCH v2 net-next 12/14] ipv6: Defer fib6_purge_rt() in fib6_add_rt2node() to fib6_add() Kuniyuki Iwashima
2025-04-09 1:12 ` [PATCH v2 net-next 13/14] ipv6: Protect nh->f6i_list with spinlock and flag Kuniyuki Iwashima
2025-04-09 1:12 ` [PATCH v2 net-next 14/14] ipv6: Get rid of RTNL for SIOCADDRT and RTM_NEWROUTE Kuniyuki Iwashima
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250415183845.GE395307@horms.kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=kuni1840@gmail.com \
--cc=kuniyu@amazon.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).