From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5314AA00C2 for ; Thu, 3 Nov 2022 10:33:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C4E340694; Thu, 3 Nov 2022 10:33:35 +0100 (CET) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mails.dpdk.org (Postfix) with ESMTP id 30EC040A7B for ; Thu, 3 Nov 2022 10:33:34 +0100 (CET) Received: by mail-wr1-f49.google.com with SMTP id w14so1718007wru.8 for ; Thu, 03 Nov 2022 02:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=btyJwrmJfxPRfrxfEoWJa7JHU4Y7S2kBQNAjypWOkEQ=; b=Y6WPGNF9rK6/7yriMxHR+kcsCaxgjedKr/DkVC3IfsGWDOJ9dqz7AHsUTA4uWidBRh pyxubs7tHFrLRTTUDHZ0kh8NVgNZaUi18SL5kTlJhKRM1LmI5PjdDQYWMzgcSKVDHJPZ XPT7BAePPkFZbDO0pgtaEhfkH6PmOZ/kRJZnOB+q7WjjdfFutprCrlK/NXBa2mRELaah 3nWZK5a2BB++wjD+aoXhdp7ApibRGCExUhwGUo6DlKQY+RLHQIRpE9LDxXHlMmQYbOy4 N0DbBp1EEEvTs+ynCYGUGpL3qAs6bcuLHt7xUZk9NK52Rbmns2cwjqXD5ehA+DYxuegI zwxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=btyJwrmJfxPRfrxfEoWJa7JHU4Y7S2kBQNAjypWOkEQ=; b=eyPplaJvVWVwG677coJlyjbpOQJ8QcJS8BRXdGHtH/Q9LHOqhxEkZinkXUmk0Jl1i3 e7+EIJdnl+/Xc+LboRY4HbnV08+J+O1apjujhbF56k/KDxDJ4P3qIK4xnhiohW0/OE/K LGkx06BLbMNk0IUUEQDjecqgVU5yQh601fE0MNVG+0jjZvRW7Hak/SQpZMRjVojck4w/ Vusg60WycNyBrn5DlaJ2pKMCneg70+7q2gy+4Rvi3+6nYbxvKiHHK0qKQlYU5t9ublQa gJjVFTileGr8PElcIrKSBqYVHoYy+3Ja8HhLTWbZx/EtkU3qJR+SHzMOuYO8Yc8v4q+X CWyw== X-Gm-Message-State: ACrzQf05WYg4v7pBQ7yGsM7x4dL/TbhFOUldNZYz420r2KA4sq+angU0 Y3zrOsv/siLyzmxckJvZqMjSM0DKxV9je97d X-Google-Smtp-Source: AMsMyM5K5GkIQT4qSyrdIgBIPE8iGHp78g2Qh4F6/KVtNPaU0NTGa5gQBD/kI4/VCRR/E9t5bBgQaQ== X-Received: by 2002:a5d:49c7:0:b0:236:a841:40f3 with SMTP id t7-20020a5d49c7000000b00236a84140f3mr17195066wrs.146.1667468013856; Thu, 03 Nov 2022 02:33:33 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id b8-20020a05600c4e0800b003cf75f56105sm754095wmq.41.2022.11.03.02.33.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 02:33:33 -0700 (PDT) From: luca.boccassi@gmail.com To: Zhirun Yan Cc: Cunming Liang , Jerin Jacob , dpdk stable Subject: patch 'graph: fix node objects allocation' has been queued to stable release 20.11.7 Date: Thu, 3 Nov 2022 09:27:57 +0000 Message-Id: <20221103092758.1099402-99-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221103092758.1099402-1-luca.boccassi@gmail.com> References: <20221103092758.1099402-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 20.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/05/22. 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. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/a82580c633eb1c63500b2a9a3b1004d8fbca5231 Thanks. Luca Boccassi --- >From a82580c633eb1c63500b2a9a3b1004d8fbca5231 Mon Sep 17 00:00:00 2001 From: Zhirun Yan Date: Thu, 4 Aug 2022 14:02:41 +0800 Subject: [PATCH] graph: fix node objects allocation [ upstream commit afe67d1414a81004eae5a50561c724a36b025960 ] For __rte_node_enqueue_prologue(), if the number of objs is more than the node->size * 2, the extra objs will write out of bounds memory. It should use __rte_node_stream_alloc_size() to request enough memory. And for rte_node_next_stream_put(), it will re-allocate a small size, when the node free space is small and new objs is less than the current node->size. Some objs pointers behind new size may be lost. And it will cause memory leak. It should request enough size of memory, containing the original objs and new objs at least. Fixes: 40d4f51403ec ("graph: implement fastpath routines") Signed-off-by: Zhirun Yan Signed-off-by: Cunming Liang Acked-by: Jerin Jacob --- lib/librte_graph/rte_graph_worker.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_graph/rte_graph_worker.h b/lib/librte_graph/rte_graph_worker.h index 0c0b9c095a..6dc7461659 100644 --- a/lib/librte_graph/rte_graph_worker.h +++ b/lib/librte_graph/rte_graph_worker.h @@ -224,7 +224,7 @@ __rte_node_enqueue_prologue(struct rte_graph *graph, struct rte_node *node, __rte_node_enqueue_tail_update(graph, node); if (unlikely(node->size < (idx + space))) - __rte_node_stream_alloc(graph, node); + __rte_node_stream_alloc_size(graph, node, node->size + space); } /** @@ -432,7 +432,7 @@ rte_node_next_stream_get(struct rte_graph *graph, struct rte_node *node, uint16_t free_space = node->size - idx; if (unlikely(free_space < nb_objs)) - __rte_node_stream_alloc_size(graph, node, nb_objs); + __rte_node_stream_alloc_size(graph, node, node->size + nb_objs); return &node->objs[idx]; } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-11-03 09:27:31.541879744 +0000 +++ 0099-graph-fix-node-objects-allocation.patch 2022-11-03 09:27:25.569426235 +0000 @@ -1 +1 @@ -From afe67d1414a81004eae5a50561c724a36b025960 Mon Sep 17 00:00:00 2001 +From a82580c633eb1c63500b2a9a3b1004d8fbca5231 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit afe67d1414a81004eae5a50561c724a36b025960 ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ - lib/graph/rte_graph_worker.h | 4 ++-- + lib/librte_graph/rte_graph_worker.h | 4 ++-- @@ -26 +27 @@ -diff --git a/lib/graph/rte_graph_worker.h b/lib/graph/rte_graph_worker.h +diff --git a/lib/librte_graph/rte_graph_worker.h b/lib/librte_graph/rte_graph_worker.h @@ -28,2 +29,2 @@ ---- a/lib/graph/rte_graph_worker.h -+++ b/lib/graph/rte_graph_worker.h +--- a/lib/librte_graph/rte_graph_worker.h ++++ b/lib/librte_graph/rte_graph_worker.h