From: Leon Romanovsky <leon@kernel.org>
To: Tony Battersby <tonyb@cybernetics.com>, Tal Gilboa <talgi@nvidia.com>
Cc: netdev@vger.kernel.org
Subject: Re: dim_calc_stats() may cause uninitialized values to be used
Date: Thu, 2 Dec 2021 17:08:36 +0200 [thread overview]
Message-ID: <YajhdLVPnuZkuKMU@unreal> (raw)
In-Reply-To: <fb600754-30c9-2ff7-dc95-7f7fc4c7aefb@cybernetics.com>
On Wed, Dec 01, 2021 at 02:40:47PM -0500, Tony Battersby wrote:
> I am reporting the following possible logic bug:
>
> lib/dim/dim.c::dim_calc_stats() doesn't set curr_stats if delta_us == 0,
> which would result in using uninitialized values in net_dim_decision()
> and rdma_dim_decision().
>
> I don't know anything about this code. I encountered this only as a
> compiler warning compiling an out-of-tree module that had a copy of
> dim_calc_stats() inlined for compatibility with old kernels, and I
> decided to investigate and report. There is no compiler warning in
> mainline since dim_calc_stats() and net_dim() are in separate C files so
> the compiler can't fully analyze it, but it looks like mainline has the
> problem also, if the delta_us == 0 condition is possible.
IMHO, it is false alarm, I don't see how delta_us can be 0. I would remove
this if (!delta_us) check.
Tal?
Thanks
>
> Tony Battersby
> Cybernetics
>
prev parent reply other threads:[~2021-12-02 15:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-01 19:40 dim_calc_stats() may cause uninitialized values to be used Tony Battersby
2021-12-02 15:08 ` Leon Romanovsky [this message]
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=YajhdLVPnuZkuKMU@unreal \
--to=leon@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=talgi@nvidia.com \
--cc=tonyb@cybernetics.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.