lkml.org 
[lkml]   [2020]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v15 4/7] x86/cet/ibt: ELF header parsing for Indirect Branch Tracking
    Date
    Update arch_setup_elf_property() for Indirect Branch Tracking.

    Signed-off-by: Yu-cheng Yu <yu-cheng.yu@intel.com>
    ---
    arch/x86/Kconfig | 2 ++
    arch/x86/kernel/process_64.c | 8 ++++++++
    2 files changed, 10 insertions(+)

    diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
    index e27f0c19a4b3..7ee6e2957863 100644
    --- a/arch/x86/Kconfig
    +++ b/arch/x86/Kconfig
    @@ -1975,6 +1975,8 @@ config X86_BRANCH_TRACKING_USER
    depends on CPU_SUP_INTEL && X86_64
    depends on $(cc-option,-fcf-protection)
    select X86_CET
    + select ARCH_USE_GNU_PROPERTY
    + select ARCH_BINFMT_ELF_STATE
    help
    Indirect Branch Tracking (IBT) provides protection against
    CALL-/JMP-oriented programming attacks. It is active when
    diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
    index 7c4687a0f001..44ea5bd81a9f 100644
    --- a/arch/x86/kernel/process_64.c
    +++ b/arch/x86/kernel/process_64.c
    @@ -866,6 +866,14 @@ int arch_setup_elf_property(struct arch_elf_state *state)
    r = cet_setup_shstk();
    }

    + if (r < 0)
    + return r;
    +
    + if (static_cpu_has(X86_FEATURE_IBT)) {
    + if (state->gnu_property & GNU_PROPERTY_X86_FEATURE_1_IBT)
    + r = cet_setup_ibt();
    + }
    +
    return r;
    }
    #endif
    --
    2.21.0
    \
     
     \ /
      Last update: 2020-11-10 17:25    [W:2.104 / U:0.184 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site