Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755336AbaDNRo7 (ORCPT ); Mon, 14 Apr 2014 13:44:59 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:39965 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755405AbaDNRos (ORCPT ); Mon, 14 Apr 2014 13:44:48 -0400 From: Sasha Levin To: vegard.nossum@oracle.com, penberg@kernel.org Cc: jamie.iles@oracle.com, hpa@zytor.com, mingo@redhat.com, tglx@linutronix.de, x86@kernel.org, masami.hiramatsu.pt@hitachi.com, linux-kernel@vger.kernel.org, linux-mm@vger.kernel.org, Sasha Levin Subject: [PATCH 1/4] kmemcheck: add additional selfchecks Date: Mon, 14 Apr 2014 13:44:07 -0400 Message-Id: <1397497450-6440-1-git-send-email-sasha.levin@oracle.com> X-Mailer: git-send-email 1.8.3.2 X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 , "}, {1, "\x0f\xbe\x51\xf8", "movswq , "}, + /* SETNE */ + {1, "\x0f\x95\xc0", "setne "}, + + /* BTSL */ + {4, "\x0f\xba\x6b\x10\x00", "btsl , "}, + #ifdef CONFIG_X86_64 /* MOVZX / MOVZXD */ {1, "\x49\x0f\xb6\x51\xf8", "movzbq , "}, @@ -32,6 +38,9 @@ static const struct selftest_opcode selftest_opcodes[] = { {1, "\x49\x0f\xbe\x51\xf8", "movsbq , "}, {2, "\x49\x0f\xbf\x51\xf8", "movsbq , "}, {4, "\x49\x63\x51\xf8", "movslq , "}, + + /* CALLQ */ + {8, "\xe8\x00\x00\x00", "call "}, #endif }; -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/