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>] [day] [month] [year] [list]
Message-Id: <1327352092-18395-1-git-send-email-n-horiguchi@ah.jp.nec.com>
Date:	Mon, 23 Jan 2012 15:54:52 -0500
From:	Naoya Horiguchi <n-horiguchi@...jp.nec.com>
To:	linux-kernel@...r.kernel.org
Cc:	Andi Kleen <andi@...stfloor.org>,
	Huang Ying <ying.huang@...el.com>,
	Naoya Horiguchi <n-horiguchi@...jp.nec.com>
Subject: [PATCH] MCE: fix return value of mce_chrdev_read() when erst is disabled

Current kernel MCE code reads ERST at the first reading of /dev/mcelog
(maybe in starting mcelogd,) even if the system does not support ERST,
which results in a fake "no such device" message (as described in [1].)
This problem is not critical, but can confuse system admins.
This patch fixes it by filtering the return value from lower (ACPI) layer.

 [1] http://thread.gmane.org/gmane.linux.kernel/1060250

Signed-off-by: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
Cc: Andi Kleen <andi@...stfloor.org>
Cc: Huang Ying <ying.huang@...el.com>
---
 arch/x86/kernel/cpu/mcheck/mce.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git 3.3-rc1.orig/arch/x86/kernel/cpu/mcheck/mce.c 3.3-rc1/arch/x86/kernel/cpu/mcheck/mce.c
index 5a11ae2..8ee5c4f 100644
--- 3.3-rc1.orig/arch/x86/kernel/cpu/mcheck/mce.c
+++ 3.3-rc1/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1541,6 +1541,12 @@ static int __mce_read_apei(char __user **ubuf, size_t usize)
 	/* Error or no more MCE record */
 	if (rc <= 0) {
 		mce_apei_read_done = 1;
+		/*
+		 * When ERST is disabled, mce_chrdev_read() should return
+		 * "no record" instead of "no device."
+		 */
+		if (rc == -ENODEV)
+			return 0;
 		return rc;
 	}
 	rc = -EFAULT;
-- 
1.7.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ