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 2EC66A0093 for ; Tue, 19 May 2020 15:16:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1D44F1D957; Tue, 19 May 2020 15:16:15 +0200 (CEST) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 9162C1D960 for ; Tue, 19 May 2020 15:16:13 +0200 (CEST) Received: by mail-wr1-f66.google.com with SMTP id e1so15882014wrt.5 for ; Tue, 19 May 2020 06:16:13 -0700 (PDT) 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=l65TUxAxS7LEAuHDBFDWFtYxMcWQXbzgAvkICH4Gxjw=; b=RuNQ49kqvlxUU/g6HQNHx1LhSIo6JP6sWeZ7PqcwU+CPe/dwkFS2af+f5iWFqrqFV4 A6v4/ka2xePBTjG18lwd/vm1q+9A7YrrmvEbHWE6KNzFsP63kA7MNd8BHp6nr9kClFKy HXvsSDblDQYH+ft4VkMH+qqL+dHPJwNDwvCRM/Yz6JOSjHCkpX1X84FQ838EBB1iT5uB B8xZeOn5ZjnIhZRcjZG6jrbeaj+8a/MXt6mq2hh+5gOqEdqb+MqQ7lxdXFCEQGAwfUpn WnkwOMxAJFnDf68So4L0UnN7akcosiCnEuVpSzGV/HFKx1cRYjkYZXW2HFboYeJAoFRK pZLw== 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=l65TUxAxS7LEAuHDBFDWFtYxMcWQXbzgAvkICH4Gxjw=; b=DcQ9l+CHCf6H4Y7Z7ja7ECKq/R6WDFxvKR9uBfXN6mVvAhMD24VPEIKr3ZM1vhwTLB 4MZ3nJAjNSgJNgDnJGvEks3UGywDDL+ukRmUEc2Uez7s6P1hLq/DaLehAuMKxUizCzYp V5MGL+G4wmIkXo2GKK/RClc+wMitFOcUpzEdoWBv5PNUdPSwQpoecX555GP2qF5P5L9p NX73nm/XR44u6Wj7G/ccKxGa1Hj/O8qGxdVsL3bZWG3UsxL62Aq4e0UEielfkhHW8Uju GdJTd4S53WlsAk1di3EyCDi+ignF/CcnAVdvhlNMux6qjnQQEY2pz9sVInRwFxazWEir GfLg== X-Gm-Message-State: AOAM533uhuylxRuXbvfPn1dTFakkukC7V5ljCeBz8YTQM9S7J9BHmf5c 2avJcVAdaTKEhGIG8aIZz68= X-Google-Smtp-Source: ABdhPJyuZu0ZGq5Dt13tSp+1JOObm5kyxB8V0iSHAfF9Sk1gB6kUqIHPbv7h4RymQjib7u7ifME0Gg== X-Received: by 2002:adf:e905:: with SMTP id f5mr26211882wrm.409.1589894173274; Tue, 19 May 2020 06:16:13 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id 5sm3995724wmz.16.2020.05.19.06.16.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:16:12 -0700 (PDT) From: luca.boccassi@gmail.com To: Kalesh AP Cc: Bernard Iremonger , dpdk stable Date: Tue, 19 May 2020 14:05:32 +0100 Message-Id: <20200519130549.112823-197-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'app/testpmd: fix memory failure handling for i40e DDP' has been queued to stable release 19.11.3 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 stable release 19.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/21/20. 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 f83c2ba6ea55b08113640b0b6da079b516095861 Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Fri, 8 May 2020 10:20:24 +0530 Subject: [PATCH] app/testpmd: fix memory failure handling for i40e DDP [ upstream commit 489bdbbfc269c819ec679605d1f0e8ad058789f4 ] In cmd_ddp_get_list_parsed(), elements of "p_list" are accessed even after the memory allocation for "p_list" fails. With this patch, this null pointer dereference is avoided as we return when there is malloc failure. Fixes: e088907bb851 ("app/testpmd: add command for getting loaded DDP profiles") Signed-off-by: Kalesh AP Acked-by: Bernard Iremonger --- app/test-pmd/cmdline.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 1dbde50566..d508d1e26d 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -16805,8 +16805,10 @@ cmd_ddp_get_list_parsed( #ifdef RTE_LIBRTE_I40E_PMD size = PROFILE_INFO_SIZE * MAX_PROFILE_NUM + 4; p_list = (struct rte_pmd_i40e_profile_list *)malloc(size); - if (!p_list) + if (!p_list) { printf("%s: Failed to malloc buffer\n", __func__); + return; + } if (ret == -ENOTSUP) ret = rte_pmd_i40e_get_ddp_list(res->port_id, -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:52.622826347 +0100 +++ 0197-app-testpmd-fix-memory-failure-handling-for-i40e-DDP.patch 2020-05-19 14:04:44.572654826 +0100 @@ -1,8 +1,10 @@ -From 489bdbbfc269c819ec679605d1f0e8ad058789f4 Mon Sep 17 00:00:00 2001 +From f83c2ba6ea55b08113640b0b6da079b516095861 Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Fri, 8 May 2020 10:20:24 +0530 Subject: [PATCH] app/testpmd: fix memory failure handling for i40e DDP +[ upstream commit 489bdbbfc269c819ec679605d1f0e8ad058789f4 ] + In cmd_ddp_get_list_parsed(), elements of "p_list" are accessed even after the memory allocation for "p_list" fails. @@ -10,7 +12,6 @@ return when there is malloc failure. Fixes: e088907bb851 ("app/testpmd: add command for getting loaded DDP profiles") -Cc: stable@dpdk.org Signed-off-by: Kalesh AP Acked-by: Bernard Iremonger @@ -19,10 +20,10 @@ 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c -index b040630c54..996a498768 100644 +index 1dbde50566..d508d1e26d 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c -@@ -16891,8 +16891,10 @@ cmd_ddp_get_list_parsed( +@@ -16805,8 +16805,10 @@ cmd_ddp_get_list_parsed( #ifdef RTE_LIBRTE_I40E_PMD size = PROFILE_INFO_SIZE * MAX_PROFILE_NUM + 4; p_list = (struct rte_pmd_i40e_profile_list *)malloc(size);