mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 17:25:38 +00:00
x86/signal: Add ABI prefixes to frame setup functions
Add ABI prefixes to the frame setup functions that didn't already have them. To avoid compiler warnings and prepare for moving these functions to separate files, make them non-static. 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-7-brgerst@gmail.com Signed-off-by: Borislav Petkov <bp@suse.de>
This commit is contained in:
parent
9c36e592b3
commit
c461ae3937
@ -13,14 +13,9 @@
|
||||
#ifdef CONFIG_X86_64
|
||||
# include <uapi/asm/sigcontext.h>
|
||||
# include <asm/user32.h>
|
||||
struct ksignal;
|
||||
int ia32_setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs);
|
||||
int ia32_setup_frame(struct ksignal *ksig, struct pt_regs *regs);
|
||||
#else
|
||||
# define user_i387_ia32_struct user_i387_struct
|
||||
# define user32_fxsr_struct user_fxsr_struct
|
||||
# define ia32_setup_frame __setup_frame
|
||||
# define ia32_setup_rt_frame __setup_rt_frame
|
||||
#endif
|
||||
|
||||
extern void convert_from_fxsr(struct user_i387_ia32_struct *env,
|
||||
|
@ -19,4 +19,9 @@ void __user *
|
||||
get_sigframe(struct ksignal *ksig, struct pt_regs *regs, size_t frame_size,
|
||||
void __user **fpstate);
|
||||
|
||||
int ia32_setup_frame(struct ksignal *ksig, struct pt_regs *regs);
|
||||
int ia32_setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs);
|
||||
int x64_setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs);
|
||||
int x32_setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs);
|
||||
|
||||
#endif /* _ASM_X86_SIGHANDLING_H */
|
||||
|
@ -336,8 +336,7 @@ static const struct {
|
||||
0
|
||||
};
|
||||
|
||||
static int
|
||||
__setup_frame(struct ksignal *ksig, struct pt_regs *regs)
|
||||
int ia32_setup_frame(struct ksignal *ksig, struct pt_regs *regs)
|
||||
{
|
||||
sigset_t *set = sigmask_to_save();
|
||||
struct sigframe __user *frame;
|
||||
@ -392,7 +391,7 @@ __setup_frame(struct ksignal *ksig, struct pt_regs *regs)
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
static int __setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs)
|
||||
int ia32_setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs)
|
||||
{
|
||||
sigset_t *set = sigmask_to_save();
|
||||
struct rt_sigframe __user *frame;
|
||||
@ -471,7 +470,7 @@ static unsigned long frame_uc_flags(struct pt_regs *regs)
|
||||
return flags;
|
||||
}
|
||||
|
||||
static int __setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs)
|
||||
int x64_setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs)
|
||||
{
|
||||
sigset_t *set = sigmask_to_save();
|
||||
struct rt_sigframe __user *frame;
|
||||
@ -571,11 +570,9 @@ int copy_siginfo_to_user32(struct compat_siginfo __user *to,
|
||||
return x32_copy_siginfo_to_user(to, from);
|
||||
return __copy_siginfo_to_user32(to, from);
|
||||
}
|
||||
#endif /* CONFIG_X86_X32_ABI */
|
||||
|
||||
static int x32_setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs)
|
||||
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;
|
||||
@ -622,15 +619,14 @@ static int x32_setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs)
|
||||
|
||||
regs->cs = __USER_CS;
|
||||
regs->ss = __USER_DS;
|
||||
#endif /* CONFIG_X86_X32_ABI */
|
||||
|
||||
return 0;
|
||||
#ifdef CONFIG_X86_X32_ABI
|
||||
|
||||
Efault:
|
||||
user_access_end();
|
||||
return -EFAULT;
|
||||
#endif
|
||||
}
|
||||
#endif /* CONFIG_X86_X32_ABI */
|
||||
|
||||
/*
|
||||
* Do a signal return; undo the signal stack.
|
||||
@ -770,7 +766,7 @@ setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs)
|
||||
} else if (is_x32_frame(ksig)) {
|
||||
return x32_setup_rt_frame(ksig, regs);
|
||||
} else {
|
||||
return __setup_rt_frame(ksig, regs);
|
||||
return x64_setup_rt_frame(ksig, regs);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user