mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-07 07:08:07 +00:00
x86: copy_fpstate_to_sigframe(): have fpregs_soft_get() use kernel buffer
... then copy_to_user() the results Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
b3a9e3b962
commit
36c8673f90
1 changed files with 6 additions and 6 deletions
|
@ -170,14 +170,14 @@ int copy_fpstate_to_sigframe(void __user *buf, void __user *buf_fx, int size)
|
||||||
ia32_fxstate &= (IS_ENABLED(CONFIG_X86_32) ||
|
ia32_fxstate &= (IS_ENABLED(CONFIG_X86_32) ||
|
||||||
IS_ENABLED(CONFIG_IA32_EMULATION));
|
IS_ENABLED(CONFIG_IA32_EMULATION));
|
||||||
|
|
||||||
|
if (!static_cpu_has(X86_FEATURE_FPU)) {
|
||||||
|
struct user_i387_ia32_struct fp;
|
||||||
|
fpregs_soft_get(current, NULL, 0, sizeof(fp), &fp, NULL);
|
||||||
|
return copy_to_user(buf, &fp, sizeof(fp)) ? -EFAULT : 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!access_ok(buf, size))
|
if (!access_ok(buf, size))
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
|
|
||||||
if (!static_cpu_has(X86_FEATURE_FPU))
|
|
||||||
return fpregs_soft_get(current, NULL, 0,
|
|
||||||
sizeof(struct user_i387_ia32_struct), NULL,
|
|
||||||
(struct _fpstate_32 __user *) buf) ? -1 : 1;
|
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
/*
|
/*
|
||||||
* Load the FPU registers if they are not valid for the current task.
|
* Load the FPU registers if they are not valid for the current task.
|
||||||
|
|
Loading…
Add table
Reference in a new issue