lkml.org 
[lkml]   [2022]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 31/39] x86/cet/shstk: Wire in CET interface
    Date
    The kernel now has the main CET functionality to support applications.
    Wire in the WRSS and shadow stack enable/disable functions into the
    existing CET API skeleton.

    Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com>

    ---

    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 fc64a04366aa..0efec02dbe6b 100644
    --- a/arch/x86/kernel/shstk.c
    +++ b/arch/x86/kernel/shstk.c
    @@ -477,9 +477,17 @@ long cet_prctl(struct task_struct *task, int option, unsigned long features)
    return -EINVAL;

    if (option == ARCH_CET_DISABLE) {
    + if (features & CET_WRSS)
    + return wrss_control(false);
    + if (features & CET_SHSTK)
    + return shstk_disable();
    return -EINVAL;
    }

    /* Handle ARCH_CET_ENABLE */
    + if (features & CET_SHSTK)
    + return shstk_setup();
    + if (features & CET_WRSS)
    + return wrss_control(true);
    return -EINVAL;
    }
    --
    2.17.1
    \
     
     \ /
      Last update: 2022-09-30 00:38    [W:4.660 / U:0.824 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site