mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: <akpm@linux-foundation.org>
Cc: <linux-kernel@vger.kernel.org>, "Denis V. Lunev" <den@openvz.org>,
	Vasily Averin <vvs@openvz.org>, Wim Van Sebroeck <wim@iguana.be>
Subject: [PATCH 1/1] [WATCHDOG] fix memory corruption when RCBA is disabled by hardware
Date: Fri, 5 Jun 2009 15:13:08 +0400	[thread overview]
Message-ID: <1244200388-17933-1-git-send-email-den@openvz.org> (raw)

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.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Vasily Averin <vvs@openvz.org>
CC: Wim Van Sebroeck <wim@iguana.be>
---
 drivers/watchdog/iTCO_wdt.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
index 648250b..c35c1f5 100644
--- a/drivers/watchdog/iTCO_wdt.c
+++ b/drivers/watchdog/iTCO_wdt.c
@@ -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;
-- 
1.6.0.6


             reply	other threads:[~2009-06-05 11:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-05 11:13 Denis V. Lunev [this message]
2009-06-10 17:21 ` Wim Van Sebroeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1244200388-17933-1-git-send-email-den@openvz.org \
    --to=den@openvz.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vvs@openvz.org \
    --cc=wim@iguana.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®