-off-by: Eli Cooper
---
arch/x86/um/ptrace_32.c | 4 ++--
arch/x86/um/ptrace_64.c | 14 ++
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/arch/x86/um/ptrace_32.c b/arch/x86/um/ptrace_32.c
index 47c78d5..2eeaf2c 100644
--- a/arch/x86/um/ptrace_32.c
+++ b/arch/x86/um
are unavailable, it falls back to the old
PTRACE_GETFPREGS and PTRACE_SETFPREGS methods, which have been renamed to
save_i387_registers() and restore_i387_registers().
Signed-off-by: Eli Cooper
---
arch/um/include/shared/registers.h| 2 ++
arch/um/kernel/process.c | 2 +-
arch
This series adds support for the extended processor state (XSTATE) for
x86_64 UML, especially the YMM registers used by AVX/AVX2 instructions.
Modern userspace programs built with AVX can now run inside x86_64 UML
without YMM registers getting corrupted.
Eli Cooper (3):
um: extend _fpstate to
Extends _fpstate to _xstate, in order to hold AVX/YMM registers.
Due to increased frame size, compilers might emit some warnings.
Signed-off-by: Eli Cooper
---
arch/x86/um/signal.c | 26 +-
arch/x86/um/user-offsets.c | 2 +-
2 files changed, 14 insertions(+), 14
Hi Richard,
On 2016/3/10 4:44, Richard Weinberger wrote:
> Hmm, this needs rework. Having everything on the stack is not good.
Okay, I'll rework the functions whose stack size is greater than the
warning threshold by using kmalloc.
> Can you also create a selftest such that this bug cannot happe
Hi Richard,
On 2016/3/13 15:58, Richard Weinberger wrote:
> Eli,
>
> Am 12.03.2016 um 08:08 schrieb Eli Cooper:
>> > Hi Richard,
>> >
>> > On 2016/3/10 4:44, Richard Weinberger wrote:
>>> >> Hmm, this needs rework. Having everything on the
This patch prevents userspace() from incorrectly restoring FPU registers
after a sigreturn or rt_sigreturn system call, which has already restored
FPU registers to the state prior to the signal handler was invoked.
Fixes FPU state corruption after invoking the signal handler.
Signed-off-by: Eli
Extends _fpstate to _xstate, in order to hold AVX/YMM registers.
To avoid oversized stack frame, the following functions has been
refactored by using (k)malloc.
- copy_sc_to_user
- copy_sc_from_user
- sig_handler_common
- timer_real_alarm_handler
Signed-off-by: Eli Cooper
---
arch/um/os
-off-by: Eli Cooper
---
arch/x86/um/ptrace_32.c | 5 +++--
arch/x86/um/ptrace_64.c | 16
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/arch/x86/um/ptrace_32.c b/arch/x86/um/ptrace_32.c
index 47c78d5..ebd4dd6 100644
--- a/arch/x86/um/ptrace_32.c
+++ b/arch/x86/um
are unavailable, it falls back to the old
PTRACE_GETFPREGS and PTRACE_SETFPREGS methods, which have been renamed to
save_i387_registers() and restore_i387_registers().
Signed-off-by: Eli Cooper
---
arch/um/include/shared/registers.h| 2 ++
arch/um/kernel/process.c | 2 +-
arch
results (e.g., calculating SHA256 in OpenSSL).
Changes since v1:
- Refactor functions with oversized stack frame
- Add a tiny selftest program to the cover letter
Eli Cooper (3):
um: extend _fpstate to _xstate
um: add extended processor state save/restore support
um: fix ptrace
Hi Richard,
On 2016/3/18 6:21, Richard Weinberger wrote:
> Where exactly are the FPU regs restored in the sigregturn case?
> Not sure if I fully understand the error scenario.
Well, sys_sigreturn() or sys_rt_sigreturn() calls copy_sc_from_user(),
and the latter copies fpstate, which is the saved
This patch makes UML saves/restores FPU state from/to the fpstate in
pt_regs when setting up or returning from a signal stack, rather than
calling ptrace directly. This ensures that FPU state is correctly
preserved around signal handlers in a multi-threaded scenario.
Signed-off-by: Eli Cooper
v1:
- Refactor functions with oversized stack frame
- Add a tiny selftest program to the cover letter
Eli Cooper (3):
um: fix FPU state preservation around signal handlers
um: extend fpstate to _xstate to support YMM registers
um: add extended processor state save/restore support
arch/um
Extends fpstate to _xstate, in order to hold AVX/YMM registers.
To avoid oversized stack frame, the following functions have been
refactored by using malloc.
- sig_handler_common
- timer_real_alarm_handler
Signed-off-by: Eli Cooper
---
arch/um/os-Linux/signal.c | 28
(thus independent from HOST_FP_SIZE), and
by calling save_i387_registers() and restore_i387_registers() instead of
the extended save_fp_registers() and restore_fp_registers() functions.
Signed-off-by: Eli Cooper
---
arch/um/include/shared/registers.h| 2 ++
arch/um/kernel/process.c
Hi Richard,
On 2016/3/18 16:20, Richard Weinberger wrote:
> I wonder how other architectures handle this case?
> Ideally I'd like to avoid as much extra code as possible in userspace().
Please forgive my ignorance of other architectures. But to the best of
my knowledge, FPU state is not saved and
On 2016/4/5 5:42, Richard Weinberger wrote:
> Sorry for my late response.
> I'll put this now into -next and give it some testing.
Ping?
It has been some time but I don't see this in -next yet.
--
Mobile security can be
18 matches
Mail list logo