lkml.org 
[lkml]   [2023]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v6 36/41] x86/shstk: Wire in shadow stack interface
    Date
    The kernel now has the main shadow stack functionality to support
    applications. Wire in the WRSS and shadow stack enable/disable functions
    into the existing shadow stack API skeleton.

    Tested-by: Pengfei Xu <pengfei.xu@intel.com>
    Tested-by: John Allen <john.allen@amd.com>
    Reviewed-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com>

    ---
    v4:
    - Remove "CET" references

    v2:
    - Split from other patches
    ---
    arch/x86/kernel/shstk.c | 8 ++++++++
    1 file changed, 8 insertions(+)

    diff --git a/arch/x86/kernel/shstk.c b/arch/x86/kernel/shstk.c
    index 009cb3fa0ae5..2faf9b45ac72 100644
    --- a/arch/x86/kernel/shstk.c
    +++ b/arch/x86/kernel/shstk.c
    @@ -464,9 +464,17 @@ long shstk_prctl(struct task_struct *task, int option, unsigned long features)
    return -EINVAL;

    if (option == ARCH_SHSTK_DISABLE) {
    + if (features & ARCH_SHSTK_WRSS)
    + return wrss_control(false);
    + if (features & ARCH_SHSTK_SHSTK)
    + return shstk_disable();
    return -EINVAL;
    }

    /* Handle ARCH_SHSTK_ENABLE */
    + if (features & ARCH_SHSTK_SHSTK)
    + return shstk_setup();
    + if (features & ARCH_SHSTK_WRSS)
    + return wrss_control(true);
    return -EINVAL;
    }
    --
    2.17.1
    \
     
     \ /
      Last update: 2023-03-27 00:27    [W:5.000 / U:0.264 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site