Date: Wed, 18 May 2011 20:48:01 +0200 From: Oliver Pinter <oliver.pntr@gmail.com> To: Kostik Belousov <kostikbel@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Fwd: [PATCH v2 3/4] x86, head_32/64.S: Enable SMEP Message-ID: <BANLkTikDprTv4sty0yQB5Z5z=2gSNjpqig@mail.gmail.com> In-Reply-To: <20110518154007.GR48734@deviant.kiev.zoral.com.ua> References: <1305581685-5144-1-git-send-email-fenghua.yu@intel.com> <20110518010353.GQ48734@deviant.kiev.zoral.com.ua> <BANLkTimHmZCO9couAxsW1rf81Qm2FAHrZw@mail.gmail.com> <201105181050.30128.jhb@freebsd.org> <20110518154007.GR48734@deviant.kiev.zoral.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
On 5/18/11, Kostik Belousov <kostikbel@gmail.com> wrote: > On Wed, May 18, 2011 at 10:50:30AM -0400, John Baldwin wrote: >> On Wednesday, May 18, 2011 8:31:15 am Oliver Pinter wrote: >> > On 5/18/11, Kostik Belousov <kostikbel@gmail.com> wrote: >> > > On Wed, May 18, 2011 at 02:03:07AM +0200, Oliver Pinter wrote: >> > >> ---------- Forwarded message ---------- >> > >> From: Fenghua Yu <fenghua.yu@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@elte.hu>, Thomas Gleixner >> > >> <tglx@linutronix.de>, >> > >> H Peter Anvin <hpa@zytor.com>, Asit K Mallick >> > >> <asit.k.mallick@intel.com>, Linus Torvalds >> > >> <torvalds@linux-foundation.org>, Avi Kivity <avi@redhat.com>, Arjan >> > >> van de Ven <arjan@infradead.org>, Andrew Morton >> > >> <akpm@linux-foundation.org>, Andi Kleen <andi@firstfloor.org> >> > >> Cc: linux-kernel <linux-kernel@vger.kernel.org>, Fenghua Yu >> > >> <fenghua.yu@intel.com> >> > >> >> > >> From: Fenghua Yu <fenghua.yu@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@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. >> > >> > http://www.intel.com/Assets/PDF/manual/325384.pdf >> > >> > Intel? 64 and IA-32 Architectures Software Developer?s Manual >> > Volume 3 (3A & 3B): >> > System Programming Guide >> >> Which revision? It is not documented in revision 38 from April 2011. >> >> I just downloaded that link, and it is still revision 38 and has no >> mention no, under the original intel link i find rev.39 Order Number: 325384-039US May 2011 uploaded here: http://oliverp.teteny.bme.hu/up/325384.pdf >> 'SMEP'. Also, bit 20 of CR4 is still marked as Reserved in that manual >> (section 2.5). > This is exactly what I said about rev. 38 in my original reply. >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTikDprTv4sty0yQB5Z5z=2gSNjpqig>