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 63AC2A04F0 for ; Thu, 19 Dec 2019 15:41:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5A3291BDFD; Thu, 19 Dec 2019 15:41:54 +0100 (CET) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by dpdk.org (Postfix) with ESMTP id 739111C02C for ; Thu, 19 Dec 2019 15:41:51 +0100 (CET) Received: by mail-wr1-f43.google.com with SMTP id g17so6243400wro.2 for ; Thu, 19 Dec 2019 06:41:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=S1ep5OUwCV83aOpLBO+mCf2dQm4+4rbt5GO/76mn/S4=; b=rVWNb5oWT5XWsYZbH/7iuY4MVdSLinz8C0vW+6XJ1se8h3QuytFShQrwNmuqEpmGni 437fYzb4tL2DmuQhbJIbjIREz1Bw4AvLsdEhIUQDkNZPlT4JFiFe+WX+mtXyKKNZJvmr i1FyzRLYT1mZXT1GkiVzSV1j/sIQL/Mieq2QcBCqSp5oBFD0YOWP2JAd15t80vOTYYpU Sk4tRzNAUWOkETswGdw/4FVnTesUym20i1nyn9QN+DJAn1qo2q6q6pfvhwaf94buF4KY Cyxb6B7RMtJRWXlQP6ZeA12Sj1DA8qD7PwjoHVxTO3mAQM3hDGwVv0VSFpXlrSfQdHnJ Cmaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=S1ep5OUwCV83aOpLBO+mCf2dQm4+4rbt5GO/76mn/S4=; b=UECfreYdTbyDAbsov2sWESVOgvdo43HXaAZ9kChcQoAN4dIF2oZ8xWCGDto0u/SXiE oefUSkWV2pyF1A0HrmlV2rUU5tTORSiSpAZa97R50djbxfm30ISqn8hYHnixFuOwXDMm ZCIZ8mVTJEbRXyCzzfouok4xT1NRVYGikFzGBqppfbL9yL+Lr3wGaa8sk+wCfKiQbUUd VCT107+H+gPmX4qQCJCSFC17fyzpDd9x6NIq0frQSxVojHD9ayBzkCD21PJHFNKw3mGW FrXvo5vKM46lld3VHyGw2Vqgir2OuDy9oHCLvnDQ2n/BL+KrGGCBWfV6t7QD/BUnn00/ Kepg== X-Gm-Message-State: APjAAAX5ryIUgH8V8VM4RtQr4L8+V6rSIHk835lMQkl6J+PgaSt/knoo jwsnJRkP3KLoRc3KAHfZbXc= X-Google-Smtp-Source: APXvYqwuOV6aYXoodm/uW2yiD9QEFakxj5ZuESsKc62eD9ldvny9kyzzVrIYbmaSnvwWAIt/zGUK2Q== X-Received: by 2002:adf:eb48:: with SMTP id u8mr9458651wrn.283.1576766511192; Thu, 19 Dec 2019 06:41:51 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id n3sm6427904wrs.8.2019.12.19.06.41.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 06:41:50 -0800 (PST) From: luca.boccassi@gmail.com To: Xueming Li Cc: Anatoly Burakov , dpdk stable Date: Thu, 19 Dec 2019 14:34:31 +0000 Message-Id: <20191219143447.21506-124-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219143447.21506-1-luca.boccassi@gmail.com> References: <20191219143447.21506-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'malloc: fix realloc padded element size' has been queued to LTS release 17.11.10 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 17.11.10 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/21/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 rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 66c6f9f9bdb922ca64e03bc3762211bf481463c9 Mon Sep 17 00:00:00 2001 From: Xueming Li Date: Tue, 12 Nov 2019 14:50:28 +0000 Subject: [PATCH] malloc: fix realloc padded element size [ upstream commit 90f538b8630b2782460aae46f346ddb4fc102011 ] When resize a memory with next element, the original element size grows. If the orginal element has padding, the real inner element size didn't grow as well and this causes trailer verification failure when malloc debug enabled. Fixes: af75078fece3 ("first public release") Signed-off-by: Xueming Li Reviewed-by: Anatoly Burakov --- lib/librte_eal/common/malloc_elem.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/librte_eal/common/malloc_elem.c b/lib/librte_eal/common/malloc_elem.c index f6cbc42266..ea7a603dd8 100644 --- a/lib/librte_eal/common/malloc_elem.c +++ b/lib/librte_eal/common/malloc_elem.c @@ -136,6 +136,11 @@ split_elem(struct malloc_elem *elem, struct malloc_elem *split_pt) next_elem->prev = split_pt; elem->size = old_elem_size; set_trailer(elem); + if (elem->pad) { + /* Update inner padding inner element size. */ + elem = RTE_PTR_ADD(elem, elem->pad); + elem->size = old_elem_size - elem->pad; + } } /* -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-12-19 14:32:31.270361448 +0000 +++ 0124-malloc-fix-realloc-padded-element-size.patch 2019-12-19 14:32:26.325302188 +0000 @@ -1,15 +1,16 @@ -From 90f538b8630b2782460aae46f346ddb4fc102011 Mon Sep 17 00:00:00 2001 +From 66c6f9f9bdb922ca64e03bc3762211bf481463c9 Mon Sep 17 00:00:00 2001 From: Xueming Li Date: Tue, 12 Nov 2019 14:50:28 +0000 Subject: [PATCH] malloc: fix realloc padded element size +[ upstream commit 90f538b8630b2782460aae46f346ddb4fc102011 ] + When resize a memory with next element, the original element size grows. If the orginal element has padding, the real inner element size didn't grow as well and this causes trailer verification failure when malloc debug enabled. Fixes: af75078fece3 ("first public release") -Cc: stable@dpdk.org Signed-off-by: Xueming Li Reviewed-by: Anatoly Burakov @@ -18,11 +19,11 @@ 1 file changed, 5 insertions(+) diff --git a/lib/librte_eal/common/malloc_elem.c b/lib/librte_eal/common/malloc_elem.c -index 658c9b5b79..afacb1813c 100644 +index f6cbc42266..ea7a603dd8 100644 --- a/lib/librte_eal/common/malloc_elem.c +++ b/lib/librte_eal/common/malloc_elem.c -@@ -307,6 +307,11 @@ split_elem(struct malloc_elem *elem, struct malloc_elem *split_pt) - elem->next = split_pt; +@@ -136,6 +136,11 @@ split_elem(struct malloc_elem *elem, struct malloc_elem *split_pt) + next_elem->prev = split_pt; elem->size = old_elem_size; set_trailer(elem); + if (elem->pad) {