DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xueming(Steven) Li" <xuemingl@mellanox.com>
To: Adrien Mazarguil <adrien.mazarguil@6wind.com>,
	Olivier MATZ <olivier.matz@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2] lib/cmdline: init CLI parsing memory
Date: Mon, 18 Dec 2017 13:44:14 +0000	[thread overview]
Message-ID: <VI1PR0502MB4079152001B752CC2F1B93E3AC0E0@VI1PR0502MB4079.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <20171218105119.GY4062@6wind.com>

No problem, make enough sense for v3.

> -----Original Message-----
> From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com]
> Sent: Monday, December 18, 2017 6:51 PM
> To: Olivier MATZ <olivier.matz@6wind.com>
> Cc: Xueming(Steven) Li <xuemingl@mellanox.com>; dev@dpdk.org
> Subject: Re: [PATCH v2] lib/cmdline: init CLI parsing memory
> 
> On Thu, Dec 14, 2017 at 04:35:45PM +0100, Olivier MATZ wrote:
> > Hi Xueming,
> >
> > On Sat, Dec 09, 2017 at 11:39:23PM +0800, Xueming Li wrote:
> > > Initialize result memory every time before parsing. Also save
> > > successfully parsed result before further ambiguous command
> > > detection to avoid result being tainted by later parsing.
> > >
> > > Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> >
> > I'm ok with the content of the patch, but this has 2 be split in 2
> > commits, which fixes different things.
> >
> > 1/ cmdline: fix dynamic tokens parsing
> >
> >    [contains what Adrien suggested = all your patch but memset]
> >
> >    When using dynamic tokens, the result buffer contains pointers
> >    to some location inside the result buffer. When the content of
> >    the temporary buffer is copied in the final one, these pointers
> >    still point to the temporary buffer.
> >
> >    This works until the temporary buffer is kept intact, but the
> >    next commit introduces a memset() that breaks this assumption.
> >
> >    This commit renames the buffers, and ensures that the pointers
> >    point to the valid location, by recopying the buffer before
> >    invoking f().
> >
> >    Fixes: 9b3fbb051d2e ("cmdline: fix parsing")
> >    Cc: stable@dpdk.org
> >
> >
> > 2/ cmdline: avoid garbage in unused fields of parsed result
> >
> >    [contains the memset() only]
> >
> >    The result buffer was not initialized before parsing, inducing
> >    garbage in unused fields or padding of the parsed structure.
> >
> >    Initialize the result buffer each time before parsing.
> >
> >    Fixes: af75078fece3 ("first public release")
> >    Cc: stable@dpdk.org
> >
> >
> > Thoughts?
> > Adrien, are you also ok?
> 
> Yes I fully agree, splitting this in two patches is also what I had in
> mind.
> Xueming, do you plan to submit v3 accordingly?
> 
> --
> Adrien Mazarguil
> 6WIND

  reply	other threads:[~2017-12-18 13:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15 15:54 [dpdk-dev] [PATCH] lib/cmdline: init parse result memeory Xueming Li
2017-12-07 14:48 ` Olivier MATZ
2017-12-07 15:05   ` Xueming(Steven) Li
2017-12-07 15:35     ` Xueming(Steven) Li
2017-12-07 17:13       ` Adrien Mazarguil
2017-12-08  7:02 ` [dpdk-dev] [PATCH v1] lib/cmdline: init parse result memory Xueming Li
2017-12-08 12:27   ` Adrien Mazarguil
2017-12-08 13:51     ` Olivier MATZ
2017-12-08 14:50       ` Xueming(Steven) Li
2017-12-08 15:04       ` Adrien Mazarguil
2017-12-08 15:26         ` Olivier MATZ
2017-12-09 15:39 ` [dpdk-dev] [PATCH v2] lib/cmdline: init CLI parsing memory Xueming Li
2017-12-14 15:35   ` Olivier MATZ
2017-12-18 10:51     ` Adrien Mazarguil
2017-12-18 13:44       ` Xueming(Steven) Li [this message]
2017-12-26 12:57     ` Xueming(Steven) Li
2018-01-16 12:45       ` Olivier Matz
2018-01-18  4:29         ` Xueming(Steven) Li
2018-01-19  9:07           ` Olivier Matz
2018-01-19 18:18             ` Xueming(Steven) Li
2018-01-19 18:16 ` [dpdk-dev] [PATCH v3] cmdline: fix dynamic tokens parsing Xueming Li
2018-01-22 13:13   ` Olivier Matz
2018-01-25 22:14     ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

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=VI1PR0502MB4079152001B752CC2F1B93E3AC0E0@VI1PR0502MB4079.eurprd05.prod.outlook.com \
    --to=xuemingl@mellanox.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.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).