From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751252AbeC3KK0 (ORCPT ); Fri, 30 Mar 2018 06:10:26 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:34076 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751119AbeC3KKY (ORCPT ); Fri, 30 Mar 2018 06:10:24 -0400 X-Google-Smtp-Source: AIpwx4+EX0wvjDrh9hpyRHhsSHtSL14jDzqp2ExJ3mM8jGR9BJs67kcnpqd0GN2IvMzpJ37sO6tcig== Date: Fri, 30 Mar 2018 12:10:20 +0200 From: Ingo Molnar To: Dominik Brodowski Cc: linux-kernel@vger.kernel.org, viro@ZenIV.linux.org.uk, torvalds@linux-foundation.org, arnd@arndb.de, linux-arch@vger.kernel.org, Thomas Gleixner , Andi Kleen , Ingo Molnar , Andrew Morton , Andy Lutomirski , Denys Vlasenko , Brian Gerst , Peter Zijlstra , "H. Peter Anvin" , x86@kernel.org Subject: Re: [PATCH 7/7] x86/entry/64: extend register clearing on syscall entry to lower registers Message-ID: <20180330101020.6g2pib3xaftawl5h@gmail.com> References: <20180330093720.6780-1-linux@dominikbrodowski.net> <20180330093720.6780-8-linux@dominikbrodowski.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180330093720.6780-8-linux@dominikbrodowski.net> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Dominik Brodowski wrote: > .endif > pushq \rdx /* pt_regs->dx */ > + xorl %edx, %edx /* nosepc dx */ > pushq %rcx /* pt_regs->cx */ > + xorl %ecx, %ecx /* nosepc cx */ > pushq \rax /* pt_regs->ax */ > pushq %r8 /* pt_regs->r8 */ > xorl %r8d, %r8d /* nospec r8 */ > diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S > index 08425c42f8b7..23e0945959e5 100644 > --- a/arch/x86/entry/entry_64_compat.S > +++ b/arch/x86/entry/entry_64_compat.S > @@ -220,8 +220,11 @@ GLOBAL(entry_SYSCALL_compat_after_hwframe) > pushq %rax /* pt_regs->orig_ax */ > pushq %rdi /* pt_regs->di */ > pushq %rsi /* pt_regs->si */ > + xorl %esi, %esi /* nosepc si */ > pushq %rdx /* pt_regs->dx */ > + xorl %edx, %edx /* nosepc dx */ > pushq %rbp /* pt_regs->cx (stashed in bp) */ > + xorl %ecx, %ecx /* nosepc cx */ > pushq $-ENOSYS /* pt_regs->ax */ > pushq $0 /* pt_regs->r8 = 0 */ > xorl %r8d, %r8d /* nospec r8 */ > @@ -365,8 +368,11 @@ ENTRY(entry_INT80_compat) > > pushq (%rdi) /* pt_regs->di */ > pushq %rsi /* pt_regs->si */ > + xorl %esi, %esi /* nosepc si */ > pushq %rdx /* pt_regs->dx */ > + xorl %edx, %edx /* nosepc dx */ > pushq %rcx /* pt_regs->cx */ > + xorl %ecx, %ecx /* nosepc cx */ > pushq $-ENOSYS /* pt_regs->ax */ > pushq $0 /* pt_regs->r8 = 0 */ > xorl %r8d, %r8d /* nospec r8 */ s/nosepc /nospec Thanks, Ingo