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 6B2AEA0540 for ; Wed, 6 Jul 2022 22:36:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6613D410E5; Wed, 6 Jul 2022 22:36:36 +0200 (CEST) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mails.dpdk.org (Postfix) with ESMTP id 00D0140691 for ; Wed, 6 Jul 2022 22:36:35 +0200 (CEST) Received: by mail-wr1-f51.google.com with SMTP id a5so8909641wrx.12 for ; Wed, 06 Jul 2022 13:36:34 -0700 (PDT) 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=0rOAm6Xsftb4iELBhXae6+dNFb+T3tgovw6W5wtgCQ4=; b=NIME/ooRNBfU29ZcaOV1BQobpQSvet3aWjU0NaF2YA9XhiAg5U+KyoK6H20OXQYhil JeEcHccOjdZ6H3JMEBrGTOzqqmipMlqxwmvLZSy03+sN67waH4scoMzQpgm6DrnJVzKL DHkrZjiy7ULGKdcq9ewZ38/iimdVAVZ7IFhMFN/27qdwXxC0FfCRcDncZ1MAlAug361/ OujMyVpuE/9+LFJNePa6LMJrmY7+RKi0i7LN3mFUQ3vf3CY5XlA9dkPkdwDVb2HwIoic 7Oymq+n4FOCQCHUZ3C3a3ccpn8xEH3ZNZ9WnvB/PvVvdTg4d4A47qdoRwH4/5sX2n5u+ usIQ== 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=0rOAm6Xsftb4iELBhXae6+dNFb+T3tgovw6W5wtgCQ4=; b=XzArZls/ydDD21wjvHgU/CHcNJZLZciKiMlmObZ5L8hAVTagybhQjxcaY/DkDWPJA9 tv1ONBnll6fD6fSzt8gCNcPCusHIswTW7msAviObBpNli7Df5T7nWBKNph19HyeyTdgP sJXxTN6WyS1+l0a0Dpq5jslQbx22HA9nlADuHwnUe5azGJEsjjBJNgnzhU7/EFlnbLHI gRAW/rwYU8npdaeeCxSilPKvY6Xn3lnef6w3K4q2nlKrvYPq7A9/o3w4b+fWKGm8hhpB B2a0dKiU2mH9rDsMZmV9/odBQESGJ4hNjdlJjcUBmcteb+D7a4A2jb33P+HGJR2s8gxF ywNQ== X-Gm-Message-State: AJIora/75eDX6dvArEkqMTnWF7fVepSHaE6hsI3xv6sAmvujPmg2D1cS FApYLXIZTmeMn5tY8WGK2sTRmfv2A3komA== X-Google-Smtp-Source: AGRyM1tPuc745ohKopdjo1JXdaUjEQeSISxprMi8rf43WxJ62OjEUnd1xTKfI4xoXKN3KPnyXOcQdg== X-Received: by 2002:adf:fcc6:0:b0:21d:8093:1b5c with SMTP id f6-20020adffcc6000000b0021d80931b5cmr2706290wrs.41.1657139794760; Wed, 06 Jul 2022 13:36:34 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id d3-20020a05600c34c300b003a2c67aa6c0sm851530wmq.23.2022.07.06.13.36.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jul 2022 13:36:34 -0700 (PDT) From: luca.boccassi@gmail.com To: Kevin Laatz Cc: Bruce Richardson , dpdk stable Subject: patch 'dma/idxd: fix null dereference in PCI remove' has been queued to stable release 21.11.2 Date: Wed, 6 Jul 2022 21:35:03 +0100 Message-Id: <20220706203506.3422496-28-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220706203506.3422496-1-luca.boccassi@gmail.com> References: <20220628151938.2278711-26-ktraynor@redhat.com> <20220706203506.3422496-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 21.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/08/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/e1c3685b21e1d764026c305cb5db605b3cf9707c Thanks. Luca Boccassi --- >From e1c3685b21e1d764026c305cb5db605b3cf9707c Mon Sep 17 00:00:00 2001 From: Kevin Laatz Date: Mon, 4 Jul 2022 16:27:51 +0100 Subject: [PATCH] dma/idxd: fix null dereference in PCI remove [ upstream commit b29427649b6d51b3b49187cbaeaa6587ce80ce72 ] The 'info' struct was being declared as a NULL pointer. If a NULL pointer is passed to 'rte_dma_info_get', EINVAL is returned and the struct is not populated. This subsequently causes a segfault when dereferencing 'info'. This patch fixes the issue by simply declaring 'info' on the stack and passing its address to 'rte_dma_info_get'. Fixes: 9449330a8458 ("dma/idxd: create dmadev instances on PCI probe") Signed-off-by: Kevin Laatz Acked-by: Bruce Richardson --- drivers/dma/idxd/idxd_pci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/dma/idxd/idxd_pci.c b/drivers/dma/idxd/idxd_pci.c index 2c3b01cd2b..2f8ec06d9e 100644 --- a/drivers/dma/idxd/idxd_pci.c +++ b/drivers/dma/idxd/idxd_pci.c @@ -380,10 +380,10 @@ idxd_dmadev_remove_pci(struct rte_pci_device *dev) IDXD_PMD_INFO("Closing %s on NUMA node %d", name, dev->device.numa_node); RTE_DMA_FOREACH_DEV(i) { - struct rte_dma_info *info = {0}; - rte_dma_info_get(i, info); - if (strncmp(name, info->dev_name, strlen(name)) == 0) - idxd_dmadev_destroy(info->dev_name); + struct rte_dma_info info; + rte_dma_info_get(i, &info); + if (strncmp(name, info.dev_name, strlen(name)) == 0) + idxd_dmadev_destroy(info.dev_name); } return 0; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-07-06 21:07:54.526572965 +0100 +++ 0028-dma-idxd-fix-null-dereference-in-PCI-remove.patch 2022-07-06 21:07:53.579519398 +0100 @@ -1 +1 @@ -From b29427649b6d51b3b49187cbaeaa6587ce80ce72 Mon Sep 17 00:00:00 2001 +From e1c3685b21e1d764026c305cb5db605b3cf9707c Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b29427649b6d51b3b49187cbaeaa6587ce80ce72 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org