OSDN Git Service

Merge tag 'x86_shstk_for_6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[tomoyo/tomoyo-test1.git] / arch / x86 / kernel / signal_64.c
index 13a1e60..cacf2ed 100644 (file)
@@ -175,6 +175,9 @@ int x64_setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs)
        frame = get_sigframe(ksig, regs, sizeof(struct rt_sigframe), &fp);
        uc_flags = frame_uc_flags(regs);
 
+       if (setup_signal_shadow_stack(ksig))
+               return -EFAULT;
+
        if (!user_access_begin(frame, sizeof(*frame)))
                return -EFAULT;
 
@@ -260,6 +263,9 @@ SYSCALL_DEFINE0(rt_sigreturn)
        if (!restore_sigcontext(regs, &frame->uc.uc_mcontext, uc_flags))
                goto badframe;
 
+       if (restore_signal_shadow_stack())
+               goto badframe;
+
        if (restore_altstack(&frame->uc.uc_stack))
                goto badframe;
 
@@ -403,7 +409,7 @@ void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact)
 */
 static_assert(NSIGILL  == 11);
 static_assert(NSIGFPE  == 15);
-static_assert(NSIGSEGV == 9);
+static_assert(NSIGSEGV == 10);
 static_assert(NSIGBUS  == 5);
 static_assert(NSIGTRAP == 6);
 static_assert(NSIGCHLD == 6);