Skip to contentSkip to conversation

fix memory corruption when RCBA is disabled by hardware

PATCH In review Denis V. Lunev 2 participants 2 messages Jun 5, 2009 – Jun 10, 2009 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix memory corruption when RCBA is disabled by hardware

According to 9.1.33 on p.343 of ICH8.pdf RCBA can be disabled by hardware if bit 0 of RCBA register is not set.

Perform correct check for this to prevent memory corruption under some virtual machines where this feature is disabled.

CC Vasily Averin <[email protected]>
CC Wim Van Sebroeck <[email protected]>
---
 drivers/watchdog/iTCO_wdt.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/watchdog/iTCO_wdt.c +7 -0
index 648250b..c35c1f5 100644
@@ -666,6 +666,12 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev,
 	   GCS = RCBA + ICH6_GCS(0x3410). */
 	if (iTCO_wdt_private.iTCO_version == 2) {
 		pci_read_config_dword(pdev, 0xf0, &base_address);
+		if ((base_address & 1) == 0) {
+			printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, "
+			       "RCBA is disabled by harddware\n");
+			ret = -ENODEV;
+			goto out_put;
+		}
 		RCBA = base_address & 0xffffc000;
 		iTCO_wdt_private.gcs = ioremap((RCBA + 0x3410), 4);
 	}
@@ -745,6 +751,7 @@ unreg_smi_en:
 out:
 	if (iTCO_wdt_private.iTCO_version == 2)
 		iounmap(iTCO_wdt_private.gcs);
+out_put:
 	pci_dev_put(iTCO_wdt_private.pdev);
 	iTCO_wdt_private.ACPIBASE = 0;
 	return ret;
Signature · 1 line
1.6.0.6
#1 lore raw

Hi Denis,

Quoted 5 lines

According to 9.1.33 on p.343 of ICH8.pdf RCBA can be disabled by hardware if bit 0 of RCBA register is not set.

Perform correct check for this to prevent memory corruption under some virtual machines where this feature is disabled.

Patch went in the watchdog-next tree.

Thanks,
Wim.