Skip to content

Commit

Permalink
x86/shstk: don't unlock shadow stack for zombies
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Rapoport (IBM) <[email protected]>
  • Loading branch information
rppt committed Sep 27, 2023
1 parent 9948a5d commit 349f22a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion criu/arch/x86/shstk.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,19 @@ int prepare_shstk(struct pstree_item *item, CoreEntry *core,

int unlock_shstk(struct pstree_item *item, CoreEntry *core, pid_t pid)
{
UserX86FpregsEntry *fpregs = core->thread_info->fpregs;
unsigned long features;
int status;
int ret = 0;

if (!task_alive(item))
goto futex_wake;

if (!compel_cpu_has_feature(X86_FEATURE_FPU))
goto futex_wake;

if (!compel_cpu_has_feature(X86_FEATURE_SHSTK)) {
UserX86FpregsEntry *fpregs = core->thread_info->fpregs;

if (fpregs->xsave && fpregs->xsave->cet)
pr_warn("Restoring task with shadow stack on non-CET machine\n");
goto futex_wake;
Expand Down

0 comments on commit 349f22a

Please sign in to comment.