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:	Mon, 20 Feb 2012 13:26:12 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	mingo@...hat.com, hpa@...or.com, linux-kernel@...r.kernel.org,
	a.p.zijlstra@...llo.nl, stable@...nel.org, tglx@...utronix.de,
	mingo@...e.hu, linux-tip-commits@...r.kernel.org
Subject: Re: [tip:x86/urgent] x86/nmi: Test saved %cs in NMI to determine
 nested NMI case

On Mon, 2012-02-20 at 10:03 -0800, Linus Torvalds wrote:
> On Mon, Feb 20, 2012 at 3:47 AM, tip-bot for Steven Rostedt
> <rostedt@...dmis.org> wrote:
> >        /*
> > +        * If %cs was not the kernel segment, then the NMI triggered in user
> > +        * space, which means it is definitely not nested.
> > +        */
> > +       cmp $__KERNEL_CS, 16(%rsp)
> > +       jne first_nmi
> 
> I don't like how you wrote 'cmp' without a size, especially with none
> of the arguments then giving a size either. Usually there's a register
> name or something that gives you the size, but not here.
> 
> I guess there is some default size that gas will use, but at least
> some versions of gas have traditionally errored out instead of
> guessing on sizes. Maybe x86-64 doesn't use those gas versions any
> more, but still..

OK, I'll send an update fix to use cmpq.

>From HPA's email:

"User space can change %cs, but it can never set it to __KERNEL_CS; 
specifically user space can never set the bottom two bits in CS to
zero."


I'm not sure it matters, but I'll change it anyway since we are
comparing an 8 byte word on the stack.

-- Steve




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