From: David Marchand <david.marchand@redhat.com>
To: Marat Khalili <marat.khalili@huawei.com>,
Thomas Monjalon <thomas@monjalon.net>
Cc: Jerin Jacob <jerinj@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Nithin Dabilpuram <ndabilpuram@marvell.com>,
Zhirun Yan <yanzhirun_163@163.com>,
Pavan Nikhilesh <pbhagavatula@marvell.com>,
Robin Jarry <rjarry@redhat.com>,
dev@dpdk.org
Subject: Re: [PATCH v3] lib/graph: lib/graph: fix memset with NULL
Date: Tue, 8 Jul 2025 14:40:50 +0200 [thread overview]
Message-ID: <CAJFAV8wbS3QPy7Qd=CtqUPPr83w2TmWDQFcbs4NGkO-nd80b3Q@mail.gmail.com> (raw)
In-Reply-To: <20250625092722.70938-1-marat.khalili@huawei.com>
On Wed, Jun 25, 2025 at 11:29 AM Marat Khalili <marat.khalili@huawei.com> wrote:
>
> This was flagged by undefined behaviour sanitizer: memset should not be
> called with NULL first argument. (memset requires first argument to be
> pointer to a memory object, so passing NULL may result in an undefined
> behaviour including among other things optimizer potentially removing
> code paths depending on stat->xstat_count being NULL.)
>
> Sanitizer message:
>
> lib/graph/graph_stats.c:473:2: runtime error: null pointer passed as
> argument 1, which is declared to never be null
>
> Add a check that stat->xstat_cntrs is not zero before the call, since
> stat->xstat_count can only be NULL when stat->xstat_cntrs is zero.
>
> Fixes: 070db97e017 ("graph: support node xstats")
>
> Signed-off-by: Marat Khalili <marat.khalili@huawei.com>
Just a fyi, I added your patch as part of my series, since running
with UBSan in GHA required this fix.
We may still take your fix as is, so I'll leave it in patchwork.
--
David Marchand
prev parent reply other threads:[~2025-07-08 12:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-17 15:13 [PATCH v2 1/2] " Marat Khalili
2025-06-17 15:13 ` [PATCH v2 2/2] lib/graph: default-align rte_graph_cluster_stats Marat Khalili
2025-06-17 15:27 ` Jerin Jacob
2025-06-17 15:41 ` Marat Khalili
2025-06-17 15:49 ` Jerin Jacob
2025-06-17 16:39 ` Marat Khalili
2025-06-23 8:52 ` Marat Khalili
2025-06-23 12:07 ` David Marchand
2025-06-23 12:18 ` Marat Khalili
2025-06-23 15:39 ` Morten Brørup
2025-06-23 12:06 ` [PATCH v2 1/2] lib/graph: lib/graph: fix memset with NULL David Marchand
2025-06-25 9:27 ` [PATCH v3] " Marat Khalili
2025-07-08 12:40 ` David Marchand [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='CAJFAV8wbS3QPy7Qd=CtqUPPr83w2TmWDQFcbs4NGkO-nd80b3Q@mail.gmail.com' \
--to=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=kirankumark@marvell.com \
--cc=marat.khalili@huawei.com \
--cc=ndabilpuram@marvell.com \
--cc=pbhagavatula@marvell.com \
--cc=rjarry@redhat.com \
--cc=thomas@monjalon.net \
--cc=yanzhirun_163@163.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).