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-next>] [day] [month] [year] [list]
Message-Id: <20251103123948.23701-1-make24@iscas.ac.cn>
Date: Mon,  3 Nov 2025 20:39:48 +0800
From: Ma Ke <make24@...as.ac.cn>
To: tony.luck@...el.com,
	qiuxu.zhuo@...el.com,
	bp@...en8.de
Cc: linux-edac@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	akpm@...ux-foundation.org,
	Ma Ke <make24@...as.ac.cn>,
	stable@...r.kernel.org
Subject: [PATCH] EDAC/igen6: Fix error handling in igen6_edac driver

The igen6_edac driver fails to release reference for non-primary
memory controllers during both error handling and normal shutdown.
After device_initialize() is called in igen6_register_mci(), missing
put_device() calls in error paths and igen6_unregister_mcis() cause
reference count leaks, resulting in memory leaks and improper device
cleanup.

Found by code review.

Cc: stable@...r.kernel.org
Fixes: 10590a9d4f23 ("EDAC/igen6: Add EDAC driver for Intel client SoCs using IBECC")
Signed-off-by: Ma Ke <make24@...as.ac.cn>
---
 drivers/edac/igen6_edac.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/edac/igen6_edac.c b/drivers/edac/igen6_edac.c
index 2fc59f9eed69..ee2f00b204bb 100644
--- a/drivers/edac/igen6_edac.c
+++ b/drivers/edac/igen6_edac.c
@@ -1300,6 +1300,8 @@ static int igen6_register_mci(int mc, void __iomem *window, struct pci_dev *pdev
 	imc->mci = mci;
 	return 0;
 fail3:
+	if (mc != 0)
+		put_device(&imc->dev);
 	mci->pvt_info = NULL;
 	kfree(mci->ctl_name);
 fail2:
@@ -1326,6 +1328,8 @@ static void igen6_unregister_mcis(void)
 		kfree(mci->ctl_name);
 		mci->pvt_info = NULL;
 		edac_mc_free(mci);
+		if (imc->mc != 0)
+			put_device(&imc->dev);
 		iounmap(imc->window);
 	}
 }
-- 
2.17.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ