lkml.org 
[lkml]   [2021]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH v29 23/32] x86/cet/shstk: Add user-mode shadow stack support
    From
    Date
    On 8/27/2021 11:21 AM, Borislav Petkov wrote:
    > On Fri, Aug 27, 2021 at 11:10:31AM -0700, Yu, Yu-cheng wrote:
    >> Because on context switches the whole xstates are switched together,
    >> we need to make sure all are in registers.
    >
    > There's context switch code which does that already.
    >
    > Why would shstk_setup() be responsible for switching the whole extended
    > states buffer instead of only the shadow stack stuff only?
    >

    Right now, the kernel does lazy restore, and it waits until right before
    a task goes back to ring-3 to restore xstates. If a task needs to write
    to any xstate registers before that (e.g. for signals), it restores the
    whole xstates first and clears TIF_NEED_FPU_LOAD, which will prevent
    xstates being restored again later.

    \
     
     \ /
      Last update: 2021-08-27 20:38    [W:6.444 / U:0.144 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site