lkml.org 
[lkml]   [2010]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 3/4] x86: call verify_cpu during 32bit CPU startup
    The XD_DISABLE-clearing side-effect needs to happen on 32bit CPU
    start-up as well.

    Signed-off-by: Kees Cook <kees.cook@canonical.com>
    ---
    arch/x86/kernel/head_32.S | 6 ++++++
    arch/x86/kernel/verify_cpu.S | 1 +
    2 files changed, 7 insertions(+), 0 deletions(-)

    diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
    index bcece91..fdaea52 100644
    --- a/arch/x86/kernel/head_32.S
    +++ b/arch/x86/kernel/head_32.S
    @@ -314,6 +314,10 @@ ENTRY(startup_32_smp)
    subl $0x80000001, %eax
    cmpl $(0x8000ffff-0x80000001), %eax
    ja 6f
    +
    + /* Clear bogus XD_DISABLE bits */
    + call verify_cpu
    +
    mov $0x80000001, %eax
    cpuid
    /* Execute Disable bit supported? */
    @@ -609,6 +613,8 @@ ignore_int:
    #endif
    iret

    +#include "verify_cpu.S"
    +
    __REFDATA
    .align 4
    ENTRY(initial_code)
    diff --git a/arch/x86/kernel/verify_cpu.S b/arch/x86/kernel/verify_cpu.S
    index ccb4136..5644b4b 100644
    --- a/arch/x86/kernel/verify_cpu.S
    +++ b/arch/x86/kernel/verify_cpu.S
    @@ -19,6 +19,7 @@
    *
    * arch/x86_64/boot/compressed/head_64.S: Boot cpu verification
    * arch/x86_64/kernel/trampoline_64.S: secondary processor verfication
    + * arch/x86_64/kernel/head_32.S: processor startup
    *
    * verify_cpu, returns the status of longmode and SSE in register %eax.
    * 0: Success 1: Failure
    --
    1.7.2.3

    --
    Kees Cook
    Ubuntu Security Team


    \
     
     \ /
      Last update: 2010-11-09 19:17    [W:0.020 / U:32.444 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site