DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Carrillo, Erik G" <erik.g.carrillo@intel.com>
To: 'Stephen Hemminger' <stephen@networkplumber.org>
Cc: "'thomas@monjalon.net'" <thomas@monjalon.net>,
	"'dev@dpdk.org'" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/2] timer: fix null pointer dereference
Date: Mon, 15 Jul 2019 19:48:09 +0000	[thread overview]
Message-ID: <BE54F058557D9A4FAC1D84E2FC6D8757267EC4C2@fmsmsx117.amr.corp.intel.com> (raw)
In-Reply-To: <BE54F058557D9A4FAC1D84E2FC6D8757267EB325@fmsmsx117.amr.corp.intel.com>

> -----Original Message-----
> From: Carrillo, Erik G
> Sent: Monday, July 15, 2019 11:04 AM
> To: Stephen Hemminger <stephen@networkplumber.org>
> Cc: thomas@monjalon.net; dev@dpdk.org; stable@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH 1/2] timer: fix null pointer dereference
> 
> Hi Stephen,
> 
> > -----Original Message-----
> > From: Stephen Hemminger <stephen@networkplumber.org>
> > Sent: Monday, July 15, 2019 10:49 AM
> > To: Carrillo, Erik G <erik.g.carrillo@intel.com>
> > Cc: thomas@monjalon.net; dev@dpdk.org; stable@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH 1/2] timer: fix null pointer
> > dereference
> >
> > On Mon, 15 Jul 2019 10:39:31 -0500
> > Erik Gabriel Carrillo <erik.g.carrillo@intel.com> wrote:
> >
> > > If the timer subsystem is not initialized before rte_timer_manage
> > > (for
> > > example) is invoked, a pointer to a shared hugepage memory region
> > > will still be null and dereferenced when it is checked for validity;
> > > handle this case.
> > >
> > > Fixes: c0749f7096c7 ("timer: allow management in shared memory")
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
> >
> > I have mixed feelings about this patch.
> > Any calls to rte_timer before rte_timer_subsystem_init is not a valid usage.
> > Better to kill the application.
> 
> Ok, that sounds like a better approach.  I'll update the patch and resubmit.
> 

I added a call to rte_exit() in the timer_data_valid() function for the case where the library is uninitialized, but checkpatches.sh issues the following warning:

"Warning in /lib/librte_timer/rte_timer.c:
Using rte_panic/rte_exit"

According to the comments in the script, we should refrain from new additions of rte_panic() and rte_exit() in the lib subtree.   In light of this, should we still proceed with this approach?  It does seem like it would be useful.

Thanks,
Erik

> Thanks,
> Erik

  reply	other threads:[~2019-07-15 19:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-15 15:39 [dpdk-dev] [PATCH 0/2] fix segfault seen with performance-thread example Erik Gabriel Carrillo
2019-07-15 15:39 ` [dpdk-dev] [PATCH 1/2] timer: fix null pointer dereference Erik Gabriel Carrillo
2019-07-15 15:48   ` Stephen Hemminger
2019-07-15 16:04     ` Carrillo, Erik G
2019-07-15 19:48       ` Carrillo, Erik G [this message]
2019-07-16  8:31         ` Bruce Richardson
2019-07-16 14:58           ` Carrillo, Erik G
2019-07-15 15:39 ` [dpdk-dev] [PATCH 2/2] examples/performance-thread: init timer subsystem Erik Gabriel Carrillo
2019-07-18 21:20 ` [dpdk-dev] [PATCH 0/2] fix segfault seen with performance-thread example 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=BE54F058557D9A4FAC1D84E2FC6D8757267EC4C2@fmsmsx117.amr.corp.intel.com \
    --to=erik.g.carrillo@intel.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /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).