DPDK patches and discussions
 help / color / mirror / Atom feed
From: Mahmoud Matook <mahmoudmatook.mm@gmail.com>
To: David Marchand <david.marchand@redhat.com>
Cc: Kiran Kumar Kokkilagadda <kirankumark@marvell.com>,
	 Sunil Kumar Kori <skori@marvell.com>,
	Rakesh Kudurumalla <rkudurumalla@marvell.com>,
	 Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>,
	Jerin Jacob <jerinj@marvell.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [EXTERNAL] [PATCH v2] app/graph: fix destination buffer too small
Date: Sat, 6 Jul 2024 18:08:20 +0400	[thread overview]
Message-ID: <6gh5by5aqykgfc3eepigk3s7ffrkdibel4qw4ik5w26nexzvbi@okhns7dd654e> (raw)
In-Reply-To: <CAJFAV8wJe96us=tQrVSRjB5QGqj-+DEnOtGaXcACiXJU0FVdHg@mail.gmail.com>

On 07/04, David Marchand wrote:

> On Thu, Jun 27, 2024 at 2:44 AM Kiran Kumar Kokkilagadda
> <kirankumark@marvell.com> wrote:
> > > On 06/25, Kiran Kumar Kokkilagadda wrote: > > > From: Mahmoud Maatuq
> > > <mahmoudmatook. mm@ gmail. com> > Sent: Tuesday, June 25, 2024 1: 31
> > > AM > To: Sunil Kumar Kori <skori@ marvell. com>; Rakesh Kudurumalla
> > > <rkudurumalla@ marvell. com>;
> > > On 06/25, Kiran Kumar Kokkilagadda wrote:
> > > > Subject: [EXTERNAL] [PATCH v2] app/graph: fix destination buffer too
> > > > small
> > > >
> > > > as sizeof(config. rx. mempool_name) is < sizeof(res->mempool) we
> > > > should copy at most sizeof(config. rx. mempool_name) and replace memcpy
> > > with strlcpy as mempool name is a null terminated string Coverity issue:
> > > 415430 Fixes: 3850cb06ab9c ("app/graph:
> > > >
> > > >
> > > > as sizeof(config.rx.mempool_name) is < sizeof(res->mempool) we should
> > > >
> > > > copy at most sizeof(config.rx.mempool_name) and replace memcpy with
> > > >
> > > > strlcpy as mempool name is a null terminated string
> > > >
> > > >
> > > >
> > > > Coverity issue: 415430
> > > >
> > > > Fixes: 3850cb06ab9c ("app/graph: add ethdev commands")
> > > >
> > > > Cc: skori@marvell.com<mailto:skori@marvell.com>
> > > >
> > > >
> > > >
> > > > Signed-off-by: Mahmoud Maatuq
> > > >
> > > <mahmoudmatook.mm@gmail.com<mailto:mahmoudmatook.mm@gmail.co
> > > m>>
> > > >
> > > > ---
> >
> > Acked-by: Kiran Kumar Kokkilagadda <kirankumark@marvell.com>
> 
> This patch does not pass the CI, please check.

The warning in CI is clear, (truncation warning) as the size of
destination buffer: config.rx.mempool_name is around 26 bytes but the
size of of source buffer: res->mempool is 128 bytes

Some possible solutions: 
  * increase the destination buffer size: by tracking it we need to
      increase RTE_MEMZONE_NAMESIZE, (more memory consumption). 

  * if the mem pool name is usually around the same size as destination
      we could decrease the size of source buffer, but res->mempool of
      type cmdline_fixed_string_t and maybe used somewhere else that
      could also produce truncation.

  *  change the type of source buffer and use size as destination.

what do you think?

> 
> 
> -- 
> David Marchand
> 

      reply	other threads:[~2024-07-06 14:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-23 20:09 [PATCH] " Mahmoud Maatuq
2024-06-23 20:26 ` Stephen Hemminger
2024-06-26 20:22   ` Mahmoud Matook
2024-06-24 20:01 ` [PATCH v2] " Mahmoud Maatuq
2024-06-25  4:41   ` [EXTERNAL] " Kiran Kumar Kokkilagadda
2024-06-26 20:18     ` Mahmoud Matook
2024-06-27  0:43       ` Kiran Kumar Kokkilagadda
2024-07-04 15:17         ` David Marchand
2024-07-06 14:08           ` Mahmoud Matook [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=6gh5by5aqykgfc3eepigk3s7ffrkdibel4qw4ik5w26nexzvbi@okhns7dd654e \
    --to=mahmoudmatook.mm@gmail.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=rkudurumalla@marvell.com \
    --cc=skori@marvell.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).