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 74575A0032 for ; Fri, 18 Feb 2022 13:44:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F2E040141; Fri, 18 Feb 2022 13:44:56 +0100 (CET) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mails.dpdk.org (Postfix) with ESMTP id 1F56A40141 for ; Fri, 18 Feb 2022 13:44:53 +0100 (CET) Received: by mail-wr1-f46.google.com with SMTP id f3so14248367wrh.7 for ; Fri, 18 Feb 2022 04:44:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oC6uiAIwg2t4xXU5zC4bR0Kbc/nMdItsJseMaiAIpkI=; b=EdtxBLmw4cL3s6W9jZRRjVJxN9ZQvzB/xwUgRw4MxIR2B7bipIpYL/ocKyKvQbYSkm xqFRFd9U0GarGkJkw3PRl1YVzFxq5/82rPEFtjdzt20Qp77OOtOCp5ed0nNv4z8nbTZ+ SV162BQjEpzFuxsYS9wr0Ggya+M6Bog4wGZ6SNLHPzIQ2ExfQ1YUwkTmxiTNT0wJp6ta 4TrEWFDqa+TVDY/6++FviJgc1qdfl+QKH9cWGzAx3Ntl9PJEvGIQBEUNybaOvFFvUBNT RO29fBay+UEgTUbF3E1WaQNxB8MqHBonmkHFZV0KcK/7a2VM6wcr3v3Le1zSKJSi4hFW eIww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oC6uiAIwg2t4xXU5zC4bR0Kbc/nMdItsJseMaiAIpkI=; b=B/1T2KKlDvOH24H0Po7TVoVp4waB8E79GGBTZTEjccvUE4G32dGlH0VoSeSAC3JLMT AQp2+aLJACnnUu5FFWh5pxW/7BDX+d/yRxbHYY+ZnAsDKmFIaz4cbBBb96u9iqtpqYC8 HMj45LESfc2DsCblIk9tk19tB6A08BCslztuu5fpVq+S6KHXI74zk52gL8G9rGJcZLAf WlE30FeaMJvmx7iDJgs/vB5eW/Mm4nC+jHB63zC6rySatYure+8sGLc9QHuTUddspbXF oltrZyGg5XGLkHnCBIpXxh+1NhkTQacszzq229KuyaWA1tVwEoUHOl/iVecO9sh0FuzI bGNA== X-Gm-Message-State: AOAM530iwD8Q4qBqKw+9xXAvxHYp3i0oRF2cidxZ3Kgt+6kZhWwYFbp+ 4Ix6BuIycq8WRS7xI5wmrUI= X-Google-Smtp-Source: ABdhPJwLVrq32Ulld0akjSpJJl02yPrwkI6lkPhWrV8wFmvqF+O2tfx56TQ5hhl6+00Wh42c6z9c0w== X-Received: by 2002:adf:ce8f:0:b0:1e4:bcd3:3aa6 with SMTP id r15-20020adfce8f000000b001e4bcd33aa6mr5714939wrn.561.1645188292813; Fri, 18 Feb 2022 04:44:52 -0800 (PST) Received: from localhost ([2a01:4b00:f41a:3600:360b:9754:2e3a:c344]) by smtp.gmail.com with ESMTPSA id 7sm25716725wrb.43.2022.02.18.04.44.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 04:44:52 -0800 (PST) From: luca.boccassi@gmail.com To: Yunjian Wang Cc: David Marchand , dpdk stable Subject: patch 'mem: check allocation in dynamic hugepage init' has been queued to stable release 20.11.5 Date: Fri, 18 Feb 2022 12:39:13 +0000 Message-Id: <20220218123931.1749595-104-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220218123931.1749595-1-luca.boccassi@gmail.com> References: <20220218123931.1749595-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.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/20/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/1b84be5c00418b3fc97988c8e3d5bfaaef8c3cde Thanks. Luca Boccassi --- >From 1b84be5c00418b3fc97988c8e3d5bfaaef8c3cde Mon Sep 17 00:00:00 2001 From: Yunjian Wang Date: Tue, 14 Dec 2021 21:30:25 +0800 Subject: [PATCH] mem: check allocation in dynamic hugepage init [ upstream commit 5f69ebbd85300a197bbe9e6a630642352f5aba39 ] The function malloc() could return NULL, the return value need to be checked. Fixes: 6f63858e55e6 ("mem: prevent preallocated pages from being freed") Signed-off-by: Yunjian Wang Reviewed-by: David Marchand --- lib/librte_eal/common/eal_common_dynmem.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/librte_eal/common/eal_common_dynmem.c b/lib/librte_eal/common/eal_common_dynmem.c index 7c5437ddfa..c1e1889f5c 100644 --- a/lib/librte_eal/common/eal_common_dynmem.c +++ b/lib/librte_eal/common/eal_common_dynmem.c @@ -304,6 +304,10 @@ eal_dynmem_hugepage_init(void) needed = num_pages - num_pages_alloc; pages = malloc(sizeof(*pages) * needed); + if (pages == NULL) { + RTE_LOG(ERR, EAL, "Failed to malloc pages\n"); + return -1; + } /* do not request exact number of pages */ cur_pages = eal_memalloc_alloc_seg_bulk(pages, -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-18 12:37:41.797744959 +0000 +++ 0104-mem-check-allocation-in-dynamic-hugepage-init.patch 2022-02-18 12:37:37.834795136 +0000 @@ -1 +1 @@ -From 5f69ebbd85300a197bbe9e6a630642352f5aba39 Mon Sep 17 00:00:00 2001 +From 1b84be5c00418b3fc97988c8e3d5bfaaef8c3cde Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 5f69ebbd85300a197bbe9e6a630642352f5aba39 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -15 +16 @@ - lib/eal/common/eal_common_dynmem.c | 4 ++++ + lib/librte_eal/common/eal_common_dynmem.c | 4 ++++ @@ -18 +19 @@ -diff --git a/lib/eal/common/eal_common_dynmem.c b/lib/eal/common/eal_common_dynmem.c +diff --git a/lib/librte_eal/common/eal_common_dynmem.c b/lib/librte_eal/common/eal_common_dynmem.c @@ -20,2 +21,2 @@ ---- a/lib/eal/common/eal_common_dynmem.c -+++ b/lib/eal/common/eal_common_dynmem.c +--- a/lib/librte_eal/common/eal_common_dynmem.c ++++ b/lib/librte_eal/common/eal_common_dynmem.c