From: Thomas Monjalon <thomas@monjalon.net>
To: Patrick MacArthur <patrick@patrickmacarthur.net>
Cc: dev@dpdk.org,
Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>,
stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] eal: Copy raw strings taken from command line
Date: Mon, 09 Oct 2017 23:27:11 +0200 [thread overview]
Message-ID: <94235766.fjgY1ahyDR@xps> (raw)
In-Reply-To: <afa422d4-ded4-0f1e-d205-ce6773998334@intel.com>
04/09/2017 12:12, Sergio Gonzalez Monroy:
> On 04/08/2017 19:53, Patrick MacArthur wrote:
> > Normally, command line argument strings are considered immutable, but
> > SPDK [1] and urdma [2] construct argv arrays to pass to rte_eal_init().
> > These strings are allocated using malloc() and freed after DPDK
> > initialization with free(). However, in the case of --file-prefix and
> > --huge-dir, DPDK takes the pointer to these strings in argv directly. If
> > a secondary process calls rte_eal_pci_probe() after rte_eal_init()
> > returns, as is done by SPDK, this causes a use-after-free error because
> > the strings have been freed by the calling code immediately after
> > rte_eal_init() returns.
[...]
> > Fix this by using strdup() to create separate memory buffers for these
> > strings. Note that this patch will cause valgrind to report memory
> > leaks of these buffers as there is nowhere to free them. Using static
> > buffers is an option but would make these strings have a fixed maximum
> > length whereas there is currently no limit defined by the API.
> >
> > [1] http://spdk.io
> > [2] https://github.com/zrlio/urdma
> >
> > Fixes: af75078fece3 ("first public release")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Patrick MacArthur <patrick@patrickmacarthur.net>
>
> Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Applied, thanks
prev parent reply other threads:[~2017-10-09 21:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-04 18:53 Patrick MacArthur
2017-09-04 10:12 ` Sergio Gonzalez Monroy
2017-10-09 21:27 ` Thomas Monjalon [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=94235766.fjgY1ahyDR@xps \
--to=thomas@monjalon.net \
--cc=dev@dpdk.org \
--cc=patrick@patrickmacarthur.net \
--cc=sergio.gonzalez.monroy@intel.com \
--cc=stable@dpdk.org \
/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).