Fwd: [PATCH v2 3/4] x86, head_32/64.S: Enable SMEP

Kostik Belousov kostikbel at gmail.com
Wed May 18 01:04:01 UTC 2011


On Wed, May 18, 2011 at 02:03:07AM +0200, Oliver Pinter wrote:
> ---------- Forwarded message ----------
> From: Fenghua Yu <fenghua.yu at intel.com>
> Date: Mon, 16 May 2011 14:34:44 -0700
> Subject: [PATCH v2 3/4] x86, head_32/64.S: Enable SMEP
> To: Ingo Molnar <mingo at elte.hu>, Thomas Gleixner <tglx at linutronix.de>,
> H Peter Anvin <hpa at zytor.com>, Asit K Mallick
> <asit.k.mallick at intel.com>, Linus Torvalds
> <torvalds at linux-foundation.org>, Avi Kivity <avi at redhat.com>, Arjan
> van de Ven <arjan at infradead.org>, Andrew Morton
> <akpm at linux-foundation.org>, Andi Kleen <andi at firstfloor.org>
> Cc: linux-kernel <linux-kernel at vger.kernel.org>, Fenghua Yu
> <fenghua.yu at intel.com>
> 
> From: Fenghua Yu <fenghua.yu at intel.com>
> 
> Enable newly documented SMEP (Supervisor Mode Execution Protection) CPU
> feature in kernel.
> 
> SMEP prevents the CPU in kernel-mode to jump to an executable page that does
> not have the kernel/system flag set in the pte. This prevents the kernel
> from executing user-space code accidentally or maliciously, so it for example
> prevents kernel exploits from jumping to specially prepared user-mode shell
> code. The violation will cause page fault #PF and will have error code
> identical to XD violation.
> 
> CR4.SMEP (bit 20) is 0 at power-on. If the feature is supported by CPU
> (X86_FEATURE_SMEP), enable SMEP by setting CR4.SMEP. New kernel
> option nosmep disables the feature even if the feature is supported by CPU.
> 
> Signed-off-by: Fenghua Yu <fenghua.yu at intel.com>

So, where is the mentioned documentation for SMEP ? Rev. 38 of the
Intel(R) 64 and IA-32 Architectures Software Developer's Manual does
not contain the description, at least at the places where I looked and
expected to find it.

Looking forward to hear from you.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20110518/1fabf279/attachment.pgp


More information about the freebsd-hackers mailing list