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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 02 Feb 2012 17:04:40 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jason Baron <jbaron@...hat.com>,
	Frederic Weisbecker <fweisbec@...il.com>
Subject: Re: [PATCH 0/5 v2] [GIT PULL] x86/jump label: Paranoid checks and 2
 or 5 byte nops

On Thu, 2012-02-02 at 09:31 -0500, Steven Rostedt wrote:

> This code died on "enabling" the nop. I think the code now enables some
> nops by default on boot up, which doesn't expect to see the
> "default_nop".
> 

Ah, we do have jump labels that are default on. I'm still not triggering
these, I'm not sure why. Perhaps a command line difference?

Anyway, this should fix the bug:

-- Steve


Ingo,

Please pull the latest tip/perf/jump-label-4 tree, which can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
tip/perf/jump-label-4

Head SHA1: 7bbd9688727dd30cd44b90b3c9c35f0f66af77ff


Steven Rostedt (1):
      x86/jump labels: Handle initialization of enabled nops

----
 arch/x86/kernel/jump_label.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---------------------------
commit 7bbd9688727dd30cd44b90b3c9c35f0f66af77ff
Author: Steven Rostedt <srostedt@...hat.com>
Date:   Thu Feb 2 16:55:43 2012 -0500

    x86/jump labels: Handle initialization of enabled nops
    
    When jump labels are initialized at boot up, they are compared
    to the default_nop before switching to the ideal nop.
    
    But if a jump label is enabled by default on start up, the
    enabled code does not test against the default nop, only the
    ideal nop. But as this jump label has not been converted to the
    ideal nop, it fails the check, and will crash the box.
    
    The enabled path needs to be aware of initialization too.
    
    Reported-by: Ingo Molnar <mingo@...e.hu>
    Signed-off-by: Steven Rostedt <rostedt@...dmis.org>

diff --git a/arch/x86/kernel/jump_label.c b/arch/x86/kernel/jump_label.c
index 2839524..d560c80 100644
--- a/arch/x86/kernel/jump_label.c
+++ b/arch/x86/kernel/jump_label.c
@@ -66,7 +66,8 @@ static void __jump_label_transform(struct jump_entry *entry,
 			code.jump_short = 0xeb;
 			code.offset = entry->target - (entry->code + 2);
 			/* Check for overflow ? */
-		} else if (memcmp(ip, ideal_nop, 5) == 0) {
+		} else if ((!init && memcmp(ip, ideal_nop, 5) == 0) ||
+			   (init && memcmp(ip, default_nop, 5) == 0)) {
 			size = JUMP_LABEL_NOP_SIZE;
 			code.jump = 0xe9;
 			code.offset = entry->target - (entry->code + size);


Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ