lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <24f58fd9bff53f2cd2771d23352343caaefe834b.1755327132.git.lukas@wunner.de>
Date: Sat, 16 Aug 2025 09:10:01 +0200
From: Lukas Wunner <lukas@...ner.de>
To: Tony Nguyen <anthony.l.nguyen@...el.com>, Przemek Kitszel <przemyslaw.kitszel@...el.com>
Cc: intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org
Subject: [PATCH 1/3] ice: Fix enable_cnt imbalance on resume

The ice driver calls pci_enable_device_mem() on resume without having
called pci_disable_device() on suspend.

This leads to an imbalance of the enable_cnt tracked by the PCI core:
Every time the adapter is resumed, the enable_cnt keeps growing.  If the
adapter is resumed at least once and the driver is then unbound, the
device isn't disabled since the enable_cnt hasn't reached zero (and
never again will).

Moreover the call to pci_enable_device_mem() has no effect because the
enable_cnt was already incremented in ice_probe() through the call to
pcim_enable_device().  The subsequent pci_enable_device_mem() thus bails
out after invoking pci_update_current_state().  But current_state was
already updated by the PCI core:

  pci_pm_resume_noirq()
    pci_pm_default_resume_early()
      pci_pm_power_up_and_verify_state()
        pci_update_current_state()

In summary, the call to pci_enable_device_mem() is both harmful and
superfluous, so remove it.

The intended purpose of the call may have been to set the Memory Space
Enable bit in the Command register again on resume, but that is already
achieved by the preceding call to pci_restore_state().

Fixes: 769c500dcc1e ("ice: Add advanced power mgmt for WoL")
Signed-off-by: Lukas Wunner <lukas@...ner.de>
Cc: stable@...r.kernel.org  # v5.9+
---
 drivers/net/ethernet/intel/ice/ice_main.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 10a473a50710..3be4347223ef 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -5643,12 +5643,6 @@ static int ice_resume(struct device *dev)
 	if (!pci_device_is_present(pdev))
 		return -ENODEV;
 
-	ret = pci_enable_device_mem(pdev);
-	if (ret) {
-		dev_err(dev, "Cannot enable device after suspend\n");
-		return ret;
-	}
-
 	pf = pci_get_drvdata(pdev);
 	hw = &pf->hw;
 
-- 
2.47.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ