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 116F6A0471 for ; Tue, 16 Jul 2019 13:05:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E7D9D3798; Tue, 16 Jul 2019 13:05:49 +0200 (CEST) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by dpdk.org (Postfix) with ESMTP id 4620D2BAB; Tue, 16 Jul 2019 13:05:46 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id EEDE850E; Tue, 16 Jul 2019 07:05:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 16 Jul 2019 07:05:45 -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=gobvfllKLefXlocpsd7kzrJeA3tHaLQbcfR7TpV+CCY=; b=XF+ctL2hiF30 EpUybGl5MwkK0UmbEa4yapNz3wY2Zzvjb3AfCSRRewmtDdUAlc61xhmFqOcQoKns nOtMOyFM6wrk3rIx5B0sWkXq43aqH4NzETXebUc8dNgyWBvX3eypY4+CjqtuVQ1c ehQJNRtmTp98EexgkjjQRYVpZnwNA40= 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=gobvfllKLefXlocpsd7kzrJeA3tHaLQbcfR7TpV+C CY=; b=Z8LbXhjt5LRr+JeuSX7hFHj4nZSAlRrJb+devUevxqcn9qynyfwnMK+FI AqClcvxObJzbzdDPy9l6AmX2zR96oyk+4h6w2U6n8WKqKOa/4YduE/yGb5Zdh7on nKjRNkT75UoQQeoQ5PNS8LOJU3+cC0eCX87CApZzDVZdgOp2lrL3bwS05fAD1ue0 VzlUbE/HDHdcFp82QR4axtrH7+mcNytuGYkiW3IwWjBcHagm5sMjiaOSWtcszgNX Zrd6vPl/+ffXIsz5TwWj5t4hDkk6XyYIKXJl6Bj87O+vFBweedGswqlkXSUNxFRP TdfPxyBIVrCDMu8mk100pQVeQ5QQA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddriedtgdefjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhho mhgrshesmhhonhhjrghlohhnrdhnvghtnecuvehluhhsthgvrhfuihiivgepud 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 652798006C; Tue, 16 Jul 2019 07:05:43 -0400 (EDT) From: Thomas Monjalon To: David Hunt Cc: dev@dpdk.org, stable@dpdk.org, bruce.richardson@intel.com, anatoly.burakov@intel.com Date: Tue, 16 Jul 2019 13:05:42 +0200 Message-ID: <1731111.OQE5oHDSl3@xps> In-Reply-To: <20190716082405.22394-1-david.hunt@intel.com> References: <20190712140402.8492-1-david.hunt@intel.com> <20190716082405.22394-1-david.hunt@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2] 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" 16/07/2019 10:24, David Hunt: > replace strcpy with 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] > > Using strlcpy rather than rte_strlcpy, as the rte_ version is only a > fallback. > > As well as the fix in main.c, this patch also changes an occurrence of > rte_strlcpy in channel_manager.c and channel_monitor.c to strlcpy. [...] > --- 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); This is still using rte_strlcpy !!