Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756083AbeAJBEy (ORCPT + 1 other); Tue, 9 Jan 2018 20:04:54 -0500 Received: from mga06.intel.com ([134.134.136.31]:42595 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755358AbeAJBDt (ORCPT ); Tue, 9 Jan 2018 20:03:49 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,337,1511856000"; d="scan'208";a="8854893" From: Andi Kleen To: tglx@linutronix.de Cc: x86@kernel.org, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, dwmw@amazon.co.uk, pjt@google.com, luto@kernel.org, peterz@infradead.org, thomas.lendacky@amd.com, tim.c.chen@linux.intel.com, gregkh@linux-foundation.org, dave.hansen@intel.com, jikos@kernel.org, Andi Kleen Subject: [PATCH v1 4/8] x86/entry/retpoline: Clear extra registers for compat syscalls Date: Tue, 9 Jan 2018 17:03:24 -0800 Message-Id: <20180110010328.22163-5-andi@firstfloor.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180110010328.22163-1-andi@firstfloor.org> References: <20180110010328.22163-1-andi@firstfloor.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Andi Kleen Clear all registers for compat calls on 64bit kernels. All arguments are initially passed through the stack, so this is fairly simple without additional stubs. Signed-off-by: Andi Kleen --- arch/x86/entry/entry_64_compat.S | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S index 98d5358e4041..16fd2643a77f 100644 --- a/arch/x86/entry/entry_64_compat.S +++ b/arch/x86/entry/entry_64_compat.S @@ -95,6 +95,8 @@ ENTRY(entry_SYSENTER_compat) pushq $0 /* pt_regs->r14 = 0 */ pushq $0 /* pt_regs->r15 = 0 */ cld + /* Can clear all because arguments are passed through the stack */ + CLEAR_ALL_REGS /* * SYSENTER doesn't filter flags, so we need to clear NT and AC @@ -223,6 +225,8 @@ GLOBAL(entry_SYSCALL_compat_after_hwframe) pushq $0 /* pt_regs->r13 = 0 */ pushq $0 /* pt_regs->r14 = 0 */ pushq $0 /* pt_regs->r15 = 0 */ + /* Can clear all because arguments are passed through the stack */ + CLEAR_ALL_REGS /* * User mode is traced as though IRQs are on, and SYSENTER @@ -348,6 +352,8 @@ ENTRY(entry_INT80_compat) pushq %r14 /* pt_regs->r14 */ pushq %r15 /* pt_regs->r15 */ cld + /* Can clear all because arguments are passed through the stack */ + CLEAR_ALL_REGS /* * User mode is traced as though IRQs are on, and the interrupt -- 2.14.3