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]
Date:   Wed, 21 Mar 2018 14:13:34 -0500
From:   Yazen Ghannam <Yazen.Ghannam@....com>
To:     linux-edac@...r.kernel.org
Cc:     Yazen Ghannam <Yazen.Ghannam@....com>,
        linux-kernel@...r.kernel.org, bp@...e.de
Subject: [PATCH 2/3] EDAC/amd64: Only remove instances that exist

From: Yazen Ghannam <yazen.ghannam@....com>

An instance may have failed probing because the probed node did not have
DRAM installed. When the module is unloaded we'll get a WARNing when
we try to remove a non-existent instance.

Save a bitmask of enabled instances with a bit for each node.

Only try to remove an instance if it was successfully enabled in the
first place.

Cc: <stable@...r.kernel.org> # 4.14.x
Signed-off-by: Yazen Ghannam <yazen.ghannam@....com>
---
 drivers/edac/amd64_edac.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index af0ce9aa8d24..054086b19c6c 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -13,6 +13,8 @@ module_param(report_gart_errors, int, 0644);
 static int ecc_enable_override;
 module_param(ecc_enable_override, int, 0644);
 
+static unsigned long int enabled_instances;
+
 static struct msr __percpu *msrs;
 
 /* Per-node stuff */
@@ -3366,6 +3368,7 @@ static int probe_one_instance(unsigned int nid)
 		goto err_enable;
 	}
 
+	set_bit(nid, &enabled_instances);
 	return ret;
 
 err_enable:
@@ -3383,6 +3386,9 @@ static void remove_one_instance(unsigned int nid)
 	struct mem_ctl_info *mci;
 	struct amd64_pvt *pvt;
 
+	if (!test_bit(nid, &enabled_instances))
+		return;
+
 	mci = find_mci_by_dev(&F3->dev);
 	WARN_ON(!mci);
 
@@ -3405,6 +3411,8 @@ static void remove_one_instance(unsigned int nid)
 
 	kfree(pvt);
 	edac_mc_free(mci);
+
+	clear_bit(nid, &enabled_instances);
 }
 
 static void setup_pci_device(void)
-- 
2.14.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ