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 19F4F45C9B for ; Tue, 12 Nov 2024 23:09:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1135D40A73; Tue, 12 Nov 2024 23:09:22 +0100 (CET) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mails.dpdk.org (Postfix) with ESMTP id 6E89540A73 for ; Tue, 12 Nov 2024 23:09:21 +0100 (CET) Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-37d4821e6b4so4372480f8f.3 for ; Tue, 12 Nov 2024 14:09:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731449361; x=1732054161; darn=dpdk.org; 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=ISCOmrDPAmfgi4V+qZifz0KPmnTp5QZZtrbwaoOK9gY=; b=XiT+/Ub9Z0mtI4Jgzc1SEXAAv3K4uRa9SbNGif+CuVcSmrgAVHqleSyQjswZGmfLh/ Q9hWISAY2c9NnYHHc5otDhRTAI96of/IXkgqT2gP/SDT5gBBA6ly0+7AhP3Zfr7KfJ8m Rlr+bo3OX0H9WF6BtrxnMt/ooLyOeMmgxZ/bSa/UmCi1V/rEpp0ZSWmotSB/H8HfQXa0 032Z0VbRqwD3jUq4VgxPO8Tb5qqEtjBHIiBJVXv6GQg1hDBjageSGDVVeAkdurf2C+m7 aWQCQ+IRR3dX+Jr/Oeos7dMW7dX/tdeWOHUvemXcHXOSPrzo+Qvz6bobOsGV4cn40ddD CQ+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731449361; x=1732054161; 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=ISCOmrDPAmfgi4V+qZifz0KPmnTp5QZZtrbwaoOK9gY=; b=sP6HFlhS/7tpS5pLULyKm9VxXJ3pgtRMXFtYGbkni5VDQd+34Dse92iBHdy/rBNuMW Ots96jOJbtNLLmFFZV5yZd/+bul5tQMmKsJ9itNsy6QjjO+t9lIexZVQWkne/YnD7uFW GAuC/4DT8OakKt+Px2qatCPdw5ZDwNDdO/qlmr8/wLE/LSG97wqQvjvNuQeNMzRDtK75 x/l/A4I/Di5QC+eySnkiYGrVk0cN6ZlGnn4AXgzv3veknHCyHFV52Y/hElk7N7I/kzgi Yf6o0ItFj2s1t1RGoegrThMrVk9IeHmbjsrxL51kMIbCrZ5iwcNTiOPp6G5BevB97wM6 ZRvQ== X-Forwarded-Encrypted: i=1; AJvYcCWExopwmMXzckItPQ4gMVcQpvSgaN1qY5KebmFtcjFvoQ/bzmbvWw2e0qYFJJNuugGUDL8HIKg=@dpdk.org X-Gm-Message-State: AOJu0YzgmFdUOEvraYLVmOfNt1wxzYPx76Uz9JchH3pV68oiFLCP2m/w QJn6IDISQqtyGb0B5yzjhUWBD1cPYOfX3AwHCySzlXySqEaojqylYSibFg== X-Google-Smtp-Source: AGHT+IFTEkFVS4kPoKbiyEjhPT09AyUfiCCp0iOCNJNOJNswe1bXR4OKTdm0taTEHT9owfD8YFI/hA== X-Received: by 2002:a05:6000:20c3:b0:382:51f:60a7 with SMTP id ffacd0b85a97d-382051f616cmr4471728f8f.33.1731449360950; Tue, 12 Nov 2024 14:09:20 -0800 (PST) Received: from localhost ([2a01:4b00:d036:ae00:e89d:e9a1:da72:2f9d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381ed9ec272sm16715548f8f.85.2024.11.12.14.09.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2024 14:09:20 -0800 (PST) From: luca.boccassi@gmail.com To: Roger Melton Cc: =?UTF-8?q?Morten=20Br=C3=B8rup?= , dpdk stable Subject: patch 'net/vmxnet3: fix crash after configuration failure' has been queued to stable release 22.11.7 Date: Tue, 12 Nov 2024 22:07:32 +0000 Message-ID: <20241112220754.666489-22-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241112220754.666489-1-luca.boccassi@gmail.com> References: <20241023211704.1216956-79-luca.boccassi@gmail.com> <20241112220754.666489-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 22.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/14/24. 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/a45c6443f45e6eb6a5c92793c838f1aa241e929b Thanks. Luca Boccassi --- >From a45c6443f45e6eb6a5c92793c838f1aa241e929b Mon Sep 17 00:00:00 2001 From: Roger Melton Date: Sat, 26 Oct 2024 10:33:36 -0400 Subject: [PATCH] net/vmxnet3: fix crash after configuration failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit 439847c154ccf05e1a8bbb955c552921514d31e2 ] Problem: If vxmnet3_dev_configure() fails, applications may call vmxnet3_dev_close(). If the failure occurs before the vmxnet3 hw->shared structure is allocated the close will lead to a segv. Root Cause: This crash is due to incorrect adapter_stopped state in the vmxnet3 dev_private structure. When dev_private is allocated, adapter_stopped will be 0 (FALSE). eth_vmxnet3_dev_init() does not set it to TRUE, so it will remain FALSE until a successful vmxnet3_dev_start() followed by a vmxnet3_dev_stop(). When vmxnet3_dev_close() is called, it will invoke vmxnet3_dev_stop(). vmxnet3_dev_stop() will check the adapter_stopped state in the vmxnet3 shared data, find it is FALSE and will proceed to stop the device, calling vmxnet3_disable_all_intrs(). vmxnet3_disable_all_intrs() attempts to access the vmxnet3 shared data resulting in the segv. Solution: Set adapter_stopped to TRUE in eth_vmxnet3_dev_init(), to prevent stop processing. Fixes: dfaff37fc46d ("vmxnet3: import new vmxnet3 poll mode driver implementation") Signed-off-by: Roger Melton Acked-by: Morten Brørup --- drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index c1c7539fff..52245c5fbb 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -347,6 +347,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev) /* Vendor and Device ID need to be set before init of shared code */ hw->device_id = pci_dev->id.device_id; hw->vendor_id = pci_dev->id.vendor_id; + hw->adapter_stopped = TRUE; hw->hw_addr0 = (void *)pci_dev->mem_resource[0].addr; hw->hw_addr1 = (void *)pci_dev->mem_resource[1].addr; -- 2.45.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-12 22:06:59.390233043 +0000 +++ 0022-net-vmxnet3-fix-crash-after-configuration-failure.patch 2024-11-12 22:06:58.667307202 +0000 @@ -1 +1 @@ -From 439847c154ccf05e1a8bbb955c552921514d31e2 Mon Sep 17 00:00:00 2001 +From a45c6443f45e6eb6a5c92793c838f1aa241e929b Mon Sep 17 00:00:00 2001 @@ -8,0 +9,2 @@ +[ upstream commit 439847c154ccf05e1a8bbb955c552921514d31e2 ] + @@ -35 +36,0 @@ -Cc: stable@dpdk.org @@ -44 +45 @@ -index 78fac63ab6..79ab167421 100644 +index c1c7539fff..52245c5fbb 100644 @@ -47 +48 @@ -@@ -403,6 +403,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev) +@@ -347,6 +347,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)