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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 14 Apr 2014 13:44:07 -0400
From:	Sasha Levin <sasha.levin@...cle.com>
To:	vegard.nossum@...cle.com, penberg@...nel.org
Cc:	jamie.iles@...cle.com, hpa@...or.com, mingo@...hat.com,
	tglx@...utronix.de, x86@...nel.org,
	masami.hiramatsu.pt@...achi.com, linux-kernel@...r.kernel.org,
	linux-mm@...r.kernel.org, Sasha Levin <sasha.levin@...cle.com>
Subject: [PATCH 1/4] kmemcheck: add additional selfchecks

kmemcheck has it's own tiny opcode decoder, and is not using the
kernel's decoder for historic reasons.

While the decoder works for more cases, it fails on quite a few
opcodes and returns incorrect values, which leads to either a
failure to detect an issue, or a false positive.

This patch adds a few of those opcodes: setne, btsl and callq,
thus causing selfcheck to fail during boot.

Signed-off-by: Sasha Levin <sasha.levin@...cle.com>
---
 arch/x86/mm/kmemcheck/selftest.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/x86/mm/kmemcheck/selftest.c b/arch/x86/mm/kmemcheck/selftest.c
index aef7140..c898d33 100644
--- a/arch/x86/mm/kmemcheck/selftest.c
+++ b/arch/x86/mm/kmemcheck/selftest.c
@@ -23,6 +23,12 @@ static const struct selftest_opcode selftest_opcodes[] = {
 	{1, "\x66\x0f\xbe\x51\xf8",	"movswq <mem8>, <reg16>"},
 	{1, "\x0f\xbe\x51\xf8",		"movswq <mem8>, <reg32>"},
 
+	/* SETNE */
+	{1, "\x0f\x95\xc0",		"setne <reg8>"},
+
+	/* BTSL */
+	{4, "\x0f\xba\x6b\x10\x00",	"btsl <imm8>, <mem32>"},
+
 #ifdef CONFIG_X86_64
 	/* MOVZX / MOVZXD */
 	{1, "\x49\x0f\xb6\x51\xf8",	"movzbq <mem8>, <reg64>"},
@@ -32,6 +38,9 @@ static const struct selftest_opcode selftest_opcodes[] = {
 	{1, "\x49\x0f\xbe\x51\xf8",	"movsbq <mem8>, <reg64>"},
 	{2, "\x49\x0f\xbf\x51\xf8",	"movsbq <mem16>, <reg64>"},
 	{4, "\x49\x63\x51\xf8",		"movslq <mem32>, <reg64>"},
+
+	/* CALLQ */
+	{8, "\xe8\x00\x00\x00",		"call <mem64>"},
 #endif
 };
 
-- 
1.7.10.4

--
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