diff options
author | Brian Gerst <brgerst@gmail.com> | 2022-06-06 16:37:56 -0400 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2022-10-19 09:58:48 +0200 |
commit | f544822ea587ce08932640d5ba3978261148cbc7 (patch) | |
tree | 50958f4eac71b53b952c6b57c7b7ddf04c05f0ef /arch/x86/kernel/signal.c | |
parent | 8bb2d28e2b92ef220e82369ff31a22f39831cf2f (diff) | |
download | linux-stable-f544822ea587ce08932640d5ba3978261148cbc7.tar.gz linux-stable-f544822ea587ce08932640d5ba3978261148cbc7.tar.bz2 linux-stable-f544822ea587ce08932640d5ba3978261148cbc7.zip |
x86/signal: Remove sigset_t parameter from frame setup functions
Push down the call to sigmask_to_save() into the frame setup functions.
Thus, remove the use of compat_sigset_t outside of the compat code.
Signed-off-by: Brian Gerst <brgerst@gmail.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Link: https://lore.kernel.org/r/20220606203802.158958-3-brgerst@gmail.com
Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'arch/x86/kernel/signal.c')
-rw-r--r-- | arch/x86/kernel/signal.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index 40b1373bb70b..489a0859afd2 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c @@ -324,9 +324,9 @@ static const struct { }; static int -__setup_frame(struct ksignal *ksig, sigset_t *set, - struct pt_regs *regs) +__setup_frame(struct ksignal *ksig, struct pt_regs *regs) { + sigset_t *set = sigmask_to_save(); struct sigframe __user *frame; void __user *restorer; void __user *fp = NULL; @@ -379,9 +379,9 @@ Efault: return -EFAULT; } -static int __setup_rt_frame(struct ksignal *ksig, - sigset_t *set, struct pt_regs *regs) +static int __setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs) { + sigset_t *set = sigmask_to_save(); struct rt_sigframe __user *frame; void __user *restorer; void __user *fp = NULL; @@ -458,9 +458,9 @@ static unsigned long frame_uc_flags(struct pt_regs *regs) return flags; } -static int __setup_rt_frame(struct ksignal *ksig, - sigset_t *set, struct pt_regs *regs) +static int __setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs) { + sigset_t *set = sigmask_to_save(); struct rt_sigframe __user *frame; void __user *fp = NULL; unsigned long uc_flags; @@ -560,11 +560,10 @@ int copy_siginfo_to_user32(struct compat_siginfo __user *to, } #endif /* CONFIG_X86_X32_ABI */ -static int x32_setup_rt_frame(struct ksignal *ksig, - compat_sigset_t *set, - struct pt_regs *regs) +static int x32_setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs) { #ifdef CONFIG_X86_X32_ABI + compat_sigset_t *set = (compat_sigset_t *) sigmask_to_save(); struct rt_sigframe_x32 __user *frame; unsigned long uc_flags; void __user *restorer; @@ -763,22 +762,19 @@ static inline int is_x32_frame(struct ksignal *ksig) static int setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs) { - sigset_t *set = sigmask_to_save(); - compat_sigset_t *cset = (compat_sigset_t *) set; - /* Perform fixup for the pre-signal frame. */ rseq_signal_deliver(ksig, regs); /* Set up the stack frame */ if (is_ia32_frame(ksig)) { if (ksig->ka.sa.sa_flags & SA_SIGINFO) - return ia32_setup_rt_frame(ksig, cset, regs); + return ia32_setup_rt_frame(ksig, regs); else - return ia32_setup_frame(ksig, cset, regs); + return ia32_setup_frame(ksig, regs); } else if (is_x32_frame(ksig)) { - return x32_setup_rt_frame(ksig, cset, regs); + return x32_setup_rt_frame(ksig, regs); } else { - return __setup_rt_frame(ksig, set, regs); + return __setup_rt_frame(ksig, regs); } } |