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 6509FA04F5 for ; Wed, 11 Dec 2019 22:28:38 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 567181D9E; Wed, 11 Dec 2019 22:28:38 +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 C859A1BE80 for ; Wed, 11 Dec 2019 22:28:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576099716; 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=U29DZkISVZ/aAX9TWWm/sA/6JIFMvFurf9T9XF788wo=; b=a7t9Nl4j/+yZbvso7TPiqyTDajFEsDbsHfU20Hka4hRQGf3CpZ7c3INDgigtQQd0S5vXLj N6YoDJvUl0FK8GwDrfgh2ecwzs4cH7vn+NSisip4oisd+EYy2KH8MVTso3H3qL6d8huQte vnfE8hWz3yqchWyunZs1wFdKdhb0Tf4= 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-407-22E0z8pLNG-xnBls-xYFbg-1; Wed, 11 Dec 2019 16:28:33 -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 D1B6B801E76; Wed, 11 Dec 2019 21:28:31 +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 E456C10013A1; Wed, 11 Dec 2019 21:28:30 +0000 (UTC) From: Kevin Traynor To: Xueming Li Cc: Anatoly Burakov , dpdk stable Date: Wed, 11 Dec 2019 21:26:25 +0000 Message-Id: <20191211212702.27851-33-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: 22E0z8pLNG-xnBls-xYFbg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'malloc: fix realloc copy size' 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/23419ce110eab670d3= e8978187ec1a5d2ea5ff87 Thanks. Kevin. --- >From 23419ce110eab670d3e8978187ec1a5d2ea5ff87 Mon Sep 17 00:00:00 2001 From: Xueming Li Date: Tue, 12 Nov 2019 14:50:27 +0000 Subject: [PATCH] malloc: fix realloc copy size [ upstream commit a029a060369f74f42394301f87489aeb391220ef ] In rte_realloc, if the old element has pad and need to allocate a new memory, the padding size was not deducted, so more data was copied to new data area. Fixes: af75078fece3 ("first public release") Signed-off-by: Xueming Li Reviewed-by: Anatoly Burakov --- lib/librte_eal/common/rte_malloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte= _malloc.c index 47c2bec72..59b130bed 100644 --- a/lib/librte_eal/common/rte_malloc.c +++ b/lib/librte_eal/common/rte_malloc.c @@ -131,5 +131,6 @@ rte_realloc(void *ptr, size_t size, unsigned align) =09if (new_ptr =3D=3D NULL) =09=09return NULL; -=09const unsigned old_size =3D elem->size - MALLOC_ELEM_OVERHEAD; +=09/* elem: |pad|data_elem|data|trailer| */ +=09const size_t old_size =3D elem->size - elem->pad - MALLOC_ELEM_OVERHEAD= ; =09rte_memcpy(new_ptr, ptr, old_size < size ? old_size : size); =09rte_free(ptr); --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-11 21:24:15.344727745 +0000 +++ 0033-malloc-fix-realloc-copy-size.patch=092019-12-11 21:24:12.665651259= +0000 @@ -1 +1 @@ -From a029a060369f74f42394301f87489aeb391220ef Mon Sep 17 00:00:00 2001 +From 23419ce110eab670d3e8978187ec1a5d2ea5ff87 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit a029a060369f74f42394301f87489aeb391220ef ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index 413e4aa00..d6026a2b1 100644 +index 47c2bec72..59b130bed 100644 @@ -23 +24 @@ -@@ -151,5 +151,6 @@ rte_realloc_socket(void *ptr, size_t size, unsigned in= t align, int socket) +@@ -131,5 +131,6 @@ rte_realloc(void *ptr, size_t size, unsigned align)