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 0E21EA04F5 for ; Wed, 11 Dec 2019 22:28:46 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E2A9B1BE83; Wed, 11 Dec 2019 22:28:45 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 3D1EE1B994 for ; Wed, 11 Dec 2019 22:28:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576099724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iw0Jp18bGzGGb1OkEyo8ImZpb9hFVP0z6Bhaw8hzO0o=; b=KNL5XLsdqUxuz4szs3K8vMraRWljDSGpnVMy7iiqkeRNtk6OESA/PCZwKIK/4q0RGQEVYy g/NL72ZmoYqCB+1Biz2g1fpc2umPoc1NjjsiDXDZ7I1YFXn+UP9+2BGEW9H9sciyiYMxdw XGfshTjtnVSUcZMhJC/RzsyEYYheSaU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-311-2-8-0uHOM5aZzTN86L2Pjw-1; Wed, 11 Dec 2019 16:28:43 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E7CAF800D41; Wed, 11 Dec 2019 21:28:41 +0000 (UTC) Received: from rh.redhat.com (ovpn-116-64.ams2.redhat.com [10.36.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9FA810013A1; Wed, 11 Dec 2019 21:28:40 +0000 (UTC) From: Kevin Traynor To: Andrew Rybchenko Cc: Ferruh Yigit , dpdk stable Date: Wed, 11 Dec 2019 21:26:32 +0000 Message-Id: <20191211212702.27851-40-ktraynor@redhat.com> In-Reply-To: <20191211212702.27851-1-ktraynor@redhat.com> References: <20191211212702.27851-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: 2-8-0uHOM5aZzTN86L2Pjw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'ethdev: avoid undefined behaviour on configuration copy' has been queued to LTS release 18.11.6 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" Hi, FYI, your patch has been queued to LTS release 18.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/17/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/b451f20f6f56c90872= d9cd4a7cd6572c4ecb35b0 Thanks. Kevin. --- >From b451f20f6f56c90872d9cd4a7cd6572c4ecb35b0 Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Tue, 19 Nov 2019 08:22:50 +0000 Subject: [PATCH] ethdev: avoid undefined behaviour on configuration copy [ upstream commit 6e18704b7e19855a0744cf4b291f1d1fe874d710 ] memcpy() source and destination areas must not overlap and equal pointers is the case which is really met, so handle it. Fixes: 68b931bff287 ("ethdev: eliminate interim variable") Signed-off-by: Andrew Rybchenko Reviewed-by: Ferruh Yigit --- lib/librte_ethdev/rte_ethdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.= c index b3fce9b08..16e6a5d38 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -1115,5 +1115,7 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_r= x_q, uint16_t nb_tx_q, =09 * rte_eth_dev_info_get() requires dev_conf, copy it before dev_info ge= t =09 */ -=09memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf)); +=09if (dev_conf !=3D &dev->data->dev_conf) +=09=09memcpy(&dev->data->dev_conf, dev_conf, +=09=09 sizeof(dev->data->dev_conf)); =20 =09rte_eth_dev_info_get(port_id, &dev_info); --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-11 21:24:15.876874697 +0000 +++ 0040-ethdev-avoid-undefined-behaviour-on-configuration-co.patch=092019-= 12-11 21:24:12.681650928 +0000 @@ -1 +1 @@ -From 6e18704b7e19855a0744cf4b291f1d1fe874d710 Mon Sep 17 00:00:00 2001 +From b451f20f6f56c90872d9cd4a7cd6572c4ecb35b0 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 6e18704b7e19855a0744cf4b291f1d1fe874d710 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -19 +20 @@ -index 8f48e8d65..8d2ce31a8 100644 +index b3fce9b08..16e6a5d38 100644 @@ -22 +23 @@ -@@ -1246,5 +1246,7 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_= rx_q, uint16_t nb_tx_q, +@@ -1115,5 +1115,7 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_= rx_q, uint16_t nb_tx_q, @@ -30 +31 @@ - =09ret =3D rte_eth_dev_info_get(port_id, &dev_info); + =09rte_eth_dev_info_get(port_id, &dev_info);