All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: David Hunt <david.hunt@intel.com>
Cc: stable@dpdk.org, Bruce Richardson <bruce.richardson@intel.com>,
	dev@dpdk.org
Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v1] examples/vm_power: fix strcpy buffer overrun
Date: Sun, 14 Jul 2019 15:26:46 +0200	[thread overview]
Message-ID: <1952380.P3yXEnfnUp@xps> (raw)
In-Reply-To: <20190712144750.GB536@bricha3-MOBL.ger.corp.intel.com>

12/07/2019 16:47, Bruce Richardson:
> On Fri, Jul 12, 2019 at 03:04:02PM +0100, David Hunt wrote:
> > replace strcpy with rte_strlcpy to prevent buffer overrun
> > With fix, attempting to use a VERY lonng vm name results in a nicely
> > truncated 32 character name rather than a segfault:
> > Setting VM Name to [sdfdsfsfsdffdsdsasdsadasdakjshd]
> > 
> > Cc: stable@dpdk.org
> > Fixes: 59287933a0bb ("examples/vm_power: add options to guest app")
> > Signed-off-by: David Hunt <david.hunt@intel.com>

It should be in this order:

Fixes: 59287933a0bb ("examples/vm_power: add options to guest app")
Cc: stable@dpdk.org

Signed-off-by: David Hunt <david.hunt@intel.com>

When in doubt about formatting, please check the git history.
You will find that the recent title prefix in use was "examples/power".

> > --- a/examples/vm_power_manager/guest_cli/main.c
> > +++ b/examples/vm_power_manager/guest_cli/main.c
> > -			strcpy(policy->vm_name, optarg);
> > +			rte_strlcpy(policy->vm_name, optarg, VM_MAX_NAME_SZ);
> 
> You can just use "strlcpy" without the "rte_" prefix. The rte_ version is
> just a fallback used when a standard strlcpy - either natively or from
> libbsd - is unavailable.

Please replace the 2 other occurences of rte_strlcpy in this example
(can be in the same patch with a small comment in the commit log).



  reply	other threads:[~2019-07-14 13:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12 14:04 [dpdk-dev] [PATCH v1] examples/vm_power: fix strcpy buffer overrun David Hunt
2019-07-12 14:14 ` Burakov, Anatoly
2019-07-12 14:47 ` Bruce Richardson
2019-07-14 13:26   ` Thomas Monjalon [this message]
2019-07-16  8:24 ` [dpdk-dev] [PATCH v2] " David Hunt
2019-07-16 11:05   ` Thomas Monjalon
2019-07-16 11:23     ` Hunt, David
2019-07-16 11:19   ` [dpdk-dev] [PATCH v3] " David Hunt
2019-07-16 11:28     ` 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=1952380.P3yXEnfnUp@xps \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.