From: Konrad Rzeszutek Wilk Date: Tue, 9 Jan 2018 04:09:53 +0000 (-0500) Subject: x86/ia32: don't save registers on audit call X-Git-Tag: v4.1.12-124.31.3~1282 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8c51a99e0cbbb8fab93159d39eb6c437caa6f2d0;p=users%2Fjedix%2Flinux-maple.git x86/ia32: don't save registers on audit call This is a followup on (x86/ia32: save and clear registers on syscall.) where we would save the registers at the start of the system call and also clear them (r8->15). But the ptrace syscall would do the same thing (save) which meant we would end up over-writting them with zeros. Orabug: 27344012 CVE:CVE-2017-5715 Reviewed-by: Kris Van Hees Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Brian Maly Signed-off-by: Kirtikar Kashyap --- diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 36d3ec7e4cdc..7b268913340f 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S @@ -313,7 +313,6 @@ sysenter_tracesys: testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT), ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS) jz sysenter_auditsys #endif - SAVE_EXTRA_REGS CLEAR_RREGS movq $-ENOSYS,RAX(%rsp)/* ptrace can change this for a bad syscall */ movq %rsp,%rdi /* &pt_regs -> arg1 */