From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4EC8DA0471 for ; Sun, 14 Jul 2019 15:26:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 216B41B94E; Sun, 14 Jul 2019 15:26:54 +0200 (CEST) Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by dpdk.org (Postfix) with ESMTP id D62C5493D; Sun, 14 Jul 2019 15:26:50 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 62BB8510; Sun, 14 Jul 2019 09:26:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 14 Jul 2019 09:26:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=YpkKQwZ+kb3Ku6LQOOYt4ra9iNEO9xkb/Jy46LVhCys=; b=bHhZ1n9mXNAN K3iYMNBX90k+Vt5NQI9M04icA9UtbMpr9U1PqP3Zqhuu71JPskfs+8/YhnY5wGiB UHYsJStU60NVcRlz56ql1nwtjj6DQYQXiFuKdegBGia5f5N9VI7Y61KF53OUQrz7 Jd1E2UoqdKdjHZFB015a1UCCZdBkUSs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=YpkKQwZ+kb3Ku6LQOOYt4ra9iNEO9xkb/Jy46LVhC ys=; b=qyh/b9ymGJ20BicxbrkYHK17nA6BS2lvyHqRyGk46Z+iunC310pd6MU2G VbRfMYRXGUK8nz8WkNAUCpso/EUgB3OgvGkcbYj1zoF/2jq09qdCBpQYJQID3D17 cnXS/ZF+eT9d1+FyGREk7m1e23U2pMotJGU9o9NUTnLeTamKuUP+9KelwJmz9V3b zx+igp5zw1ob7XSMbdVbwBD/30IeVFEWNvLm7FnLIx7rjkQWtDht8FCA2TB2+ky9 7dHt7SJFvjkbgfZaqMR/UM6oMgeRxlVtVROAEuTU9j6cnLrwS2KU2hK325sJ/4YK 1zQVk5BbfekHOLypxW9g+p1dQ352A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrheehgdeijecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhho mhgrshesmhhonhhjrghlohhnrdhnvghtnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 1171E80062; Sun, 14 Jul 2019 09:26:47 -0400 (EDT) From: Thomas Monjalon To: David Hunt Cc: stable@dpdk.org, Bruce Richardson , dev@dpdk.org Date: Sun, 14 Jul 2019 15:26:46 +0200 Message-ID: <1952380.P3yXEnfnUp@xps> In-Reply-To: <20190712144750.GB536@bricha3-MOBL.ger.corp.intel.com> References: <20190712140402.8492-1-david.hunt@intel.com> <20190712144750.GB536@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v1] examples/vm_power: fix strcpy buffer overrun X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 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 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).