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 699DFA034C for ; Fri, 25 Feb 2022 18:18:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 64561410FD; Fri, 25 Feb 2022 18:18:39 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id D48C2410FD for ; Fri, 25 Feb 2022 18:18:37 +0100 (CET) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id B3EDC3F1BC for ; Fri, 25 Feb 2022 17:18:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1645809517; bh=I9YYOZR5Ovl8ltRVrQDVT/cEIg/0j4qD0avrZ9sv8mM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=doztX6djLNoMMNSkiko3HbG35AR5lBDB9Gf0eB4kNCrZZwXh5bTUXRk3hOIbmgWzL 0NcGC7YVUIpl1LjsEYS9VhyE91Juw3Qm7sLVrr0JEGmqHj5MlGp+SUAjFbTcyrCQpN qpO91wDdcRPh5PR47m/gbEbmtgGp5MpUJbE5vG04gzka6JtTLf4Wy3EQLrhSB1+vNm vCGfdvJGq2hvynvEv9R/kQsX1I39s5YDoxuqVsJLB5mgtxQ/tS/3Uql3XY13S5wObd vRM/ers3tj574Ktg3Q8R6bwpwLCNK3B9ATEAT99J+pTcySgrXkWBrf7aMnTRb0Pb2b //uQBrIfsNFYg== Received: by mail-wm1-f70.google.com with SMTP id az39-20020a05600c602700b00380e48f5994so1629559wmb.0 for ; Fri, 25 Feb 2022 09:18:37 -0800 (PST) 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=I9YYOZR5Ovl8ltRVrQDVT/cEIg/0j4qD0avrZ9sv8mM=; b=7JfzY7TxqbRXNgrEnTgCYKUiqkqeJtm7qhVyWeur43fj+QNTkql4NUEJ5cqdafde4e OesRpKMN/ef7XNlDpe0O6LnNC6q7xD712vAHy+iJuP+yMZKYOgUpDjwUn1wXV06bBPgW i65tA3I0ORxl9eS25CM448rn+LqvYB+U5TEvFgoIlFbPSEAMY3LdSKFgBg0xUZ+fkrgD gvRTKoE3O2EDYzLH6pB62WQs2jmwBQlyLTUExQqktKuF3EPyumMFLEv1Os/8nsmajBOP HdZL3UiZWh6PPP8Bb129rp59DcNARhtyZumVct7Sn1CuGJKKWitPSzrpGnlzsm7yUnvM XeGA== X-Gm-Message-State: AOAM533bjjZjPRW26nIp6t58O7HSG97RLrf7j0Sxa+TQKS7d+MJcx9c9 Dlz6EfswMpL77GAoY0auDvYQD6W0ACFM9L69bdUUYPJJmgIRLWGLSUcXQu0sGhmFB7/jV9TA6K+ ppadLJ2Gb0VeL0l0FFQRhQ5el X-Received: by 2002:a05:6000:1364:b0:1ed:b65a:da45 with SMTP id q4-20020a056000136400b001edb65ada45mr6944631wrz.680.1645809517067; Fri, 25 Feb 2022 09:18:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWvd73lBR+2ojaoJZH/6wIjJAs44BXECmu+64SLAqxCIoI6kTavWHtFSQGJdkzYfswBXnIdw== X-Received: by 2002:a05:6000:1364:b0:1ed:b65a:da45 with SMTP id q4-20020a056000136400b001edb65ada45mr6944620wrz.680.1645809516869; Fri, 25 Feb 2022 09:18:36 -0800 (PST) Received: from Keschdeichel.fritz.box (068-133-067-156.ip-addr.inexio.net. [156.67.133.68]) by smtp.gmail.com with ESMTPSA id 9-20020a05600c268900b00381394d74a1sm2052594wmt.9.2022.02.25.09.18.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 09:18:36 -0800 (PST) From: christian.ehrhardt@canonical.com To: Weiguo Li Cc: Akhil Goyal , dpdk stable Subject: patch 'compress/octeontx: fix null pointer dereference' has been queued to stable release 19.11.12 Date: Fri, 25 Feb 2022 18:15:49 +0100 Message-Id: <20220225171550.3499040-56-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20220225171550.3499040-1-christian.ehrhardt@canonical.com> References: <20220225171550.3499040-1-christian.ehrhardt@canonical.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 19.11.12 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/27/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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/dc34c5a920c882161bd3bc92153859fb444e5290 Thanks. Christian Ehrhardt --- >From dc34c5a920c882161bd3bc92153859fb444e5290 Mon Sep 17 00:00:00 2001 From: Weiguo Li Date: Tue, 25 Jan 2022 22:33:15 +0800 Subject: [PATCH] compress/octeontx: fix null pointer dereference [ upstream commit b072930fb10a0471d69db5de341ea87a0d1561cc ] Check for memory allocation failure is added to avoid null pointer dereference. Fixes: c378f084d6e3 ("compress/octeontx: add device setup ops") Signed-off-by: Weiguo Li Acked-by: Akhil Goyal --- drivers/compress/octeontx/otx_zip_pmd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/compress/octeontx/otx_zip_pmd.c b/drivers/compress/octeontx/otx_zip_pmd.c index bff8ef035e..3876b5e74a 100644 --- a/drivers/compress/octeontx/otx_zip_pmd.c +++ b/drivers/compress/octeontx/otx_zip_pmd.c @@ -394,6 +394,8 @@ zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, } name = rte_malloc(NULL, RTE_COMPRESSDEV_NAME_MAX_LEN, 0); + if (name == NULL) + return (-ENOMEM); snprintf(name, RTE_COMPRESSDEV_NAME_MAX_LEN, "zip_pmd_%u_qp_%u", dev->data->dev_id, qp_id); @@ -401,8 +403,10 @@ zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, /* Allocate the queue pair data structure. */ qp = rte_zmalloc_socket(name, sizeof(*qp), RTE_CACHE_LINE_SIZE, socket_id); - if (qp == NULL) + if (qp == NULL) { + rte_free(name); return (-ENOMEM); + } qp->name = name; -- 2.35.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-25 16:58:46.384224868 +0100 +++ 0056-compress-octeontx-fix-null-pointer-dereference.patch 2022-02-25 16:58:44.300990467 +0100 @@ -1 +1 @@ -From b072930fb10a0471d69db5de341ea87a0d1561cc Mon Sep 17 00:00:00 2001 +From dc34c5a920c882161bd3bc92153859fb444e5290 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b072930fb10a0471d69db5de341ea87a0d1561cc ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -19 +20 @@ -index 26cdce60a8..f9b8f7a1ec 100644 +index bff8ef035e..3876b5e74a 100644 @@ -22 +23 @@ -@@ -391,6 +391,8 @@ zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, +@@ -394,6 +394,8 @@ zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, @@ -31 +32 @@ -@@ -398,8 +400,10 @@ zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, +@@ -401,8 +403,10 @@ zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,