Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2989560imm; Sun, 1 Jul 2018 09:49:28 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLY2yjSPFA32bWkzjcjhqFLVQuGSpw0EzGpPbz8upNjw8HNL9xdccyT2Vs7bPi3aW+CtNLD X-Received: by 2002:a17:902:89:: with SMTP id a9-v6mr22231439pla.326.1530463768023; Sun, 01 Jul 2018 09:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530463767; cv=none; d=google.com; s=arc-20160816; b=MiDZ+43jUdwlEWg39x4BxvBnyOIuXXa2BKEfANxt4KI32JHsZqB5mtNfubVOAdsSsD Nhxe7V+gdApoxMihR8pFKtTQ7ck40+Cm0cdgbuTIKdsZDmYmPsfGuyG836HHQ9RrcycD d6n246s/B+OSye4a/mCOW18OKVLGtKyZhkt3QgApLOi0eVefWEZpX1vI7RT7VMfTTpLV 9U+CTVN3pF0IQbMLETLzv8V8YsLr/NG7tb4neonWrLueTPh/oeWAv5KF8vtaNRy1/iwp 6azqAXp/ZNPs80RQ3jweOtOH0JYCtet6jkTqP12RCGjM0GBEgU81PrnxSt5UmbIb41Se SKSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=yXgzAu3O/yg7zIfdWmjlL40sMDb+vqe7XUr/fki1evs=; b=XLtaDDRR6GRAGy9/jtqlbKxZxwEdpnlAUwE2bHtPPcG0Cfa+JO6XjXQuFzhr6g90jm 4BbSrWrBYVGzoliZA3mYG1Ca7i4EWs31KWq7mmZAspLHsYtxG9v39CM1WeKphK94Kf/x quveP65I0+Uyhy+K+lBL6VZwZroXm75GxAJrC4QyGvYLgilE51yHJJsAasrNlv37Pkyd IoKGamY25ufX+vU5DWlMf0M/A88Rhm0EqEithpt67FA1XlJ2fDDEP66isB/+j1TwnU/p jJuxS+SurjFPl1zYV8SwUY85WBKfgAEpa3AzbnAUpMuPDvyHIv8od6kWbyFFq8SrAPtK stDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5-v6si3447738pll.412.2018.07.01.09.49.14; Sun, 01 Jul 2018 09:49:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032552AbeGAQqp (ORCPT + 99 others); Sun, 1 Jul 2018 12:46:45 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38488 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753780AbeGAQqi (ORCPT ); Sun, 1 Jul 2018 12:46:38 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4D31CACD; Sun, 1 Jul 2018 16:46:37 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, zhijianx.li@intel.com, Andy Lutomirski , Arjan van de Ven , Borislav Petkov , Dan Williams , Dave Hansen , David Woodhouse , Josh Poimboeuf , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Ingo Molnar Subject: [PATCH 4.17 216/220] x86/entry/64/compat: Fix "x86/entry/64/compat: Preserve r8-r11 in int $0x80" Date: Sun, 1 Jul 2018 18:24:00 +0200 Message-Id: <20180701160917.167286801@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andy Lutomirski commit 22cd978e598618e82c3c3348d2069184f6884182 upstream. Commit: 8bb2610bc496 ("x86/entry/64/compat: Preserve r8-r11 in int $0x80") was busted: my original patch had a minor conflict with some of the nospec changes, but "git apply" is very clever and silently accepted the patch by making the same changes to a different function in the same file. There was obviously a huge offset, but "git apply" for some reason doesn't feel any need to say so. Move the changes to the correct function. Now the test_syscall_vdso_32 selftests passes. If anyone cares to observe the original problem, try applying the patch at: https://lore.kernel.org/lkml/d4c4d9985fbe64f8c9e19291886453914b48caee.1523975710.git.luto@kernel.org/raw to the kernel at 316d097c4cd4e7f2ef50c40cff2db266593c4ec4: - "git am" and "git apply" accept the patch without any complaints at all - "patch -p1" at least prints out a message about the huge offset. Reported-by: zhijianx.li@intel.com Signed-off-by: Andy Lutomirski Cc: Arjan van de Ven Cc: Borislav Petkov Cc: Dan Williams Cc: Dave Hansen Cc: David Woodhouse Cc: Greg Kroah-Hartman Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: stable@vger.kernel.org #v4.17+ Fixes: 8bb2610bc496 ("x86/entry/64/compat: Preserve r8-r11 in int $0x80") Link: http://lkml.kernel.org/r/6012b922485401bc42676e804171ded262fc2ef2.1530078306.git.luto@kernel.org Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- arch/x86/entry/entry_64_compat.S | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) --- a/arch/x86/entry/entry_64_compat.S +++ b/arch/x86/entry/entry_64_compat.S @@ -84,13 +84,13 @@ ENTRY(entry_SYSENTER_compat) pushq %rdx /* pt_regs->dx */ pushq %rcx /* pt_regs->cx */ pushq $-ENOSYS /* pt_regs->ax */ - pushq %r8 /* pt_regs->r8 */ + pushq $0 /* pt_regs->r8 = 0 */ xorl %r8d, %r8d /* nospec r8 */ - pushq %r9 /* pt_regs->r9 */ + pushq $0 /* pt_regs->r9 = 0 */ xorl %r9d, %r9d /* nospec r9 */ - pushq %r10 /* pt_regs->r10 */ + pushq $0 /* pt_regs->r10 = 0 */ xorl %r10d, %r10d /* nospec r10 */ - pushq %r11 /* pt_regs->r11 */ + pushq $0 /* pt_regs->r11 = 0 */ xorl %r11d, %r11d /* nospec r11 */ pushq %rbx /* pt_regs->rbx */ xorl %ebx, %ebx /* nospec rbx */ @@ -374,13 +374,13 @@ ENTRY(entry_INT80_compat) pushq %rcx /* pt_regs->cx */ xorl %ecx, %ecx /* nospec cx */ pushq $-ENOSYS /* pt_regs->ax */ - pushq $0 /* pt_regs->r8 = 0 */ + pushq %r8 /* pt_regs->r8 */ xorl %r8d, %r8d /* nospec r8 */ - pushq $0 /* pt_regs->r9 = 0 */ + pushq %r9 /* pt_regs->r9 */ xorl %r9d, %r9d /* nospec r9 */ - pushq $0 /* pt_regs->r10 = 0 */ + pushq %r10 /* pt_regs->r10*/ xorl %r10d, %r10d /* nospec r10 */ - pushq $0 /* pt_regs->r11 = 0 */ + pushq %r11 /* pt_regs->r11 */ xorl %r11d, %r11d /* nospec r11 */ pushq %rbx /* pt_regs->rbx */ xorl %ebx, %ebx /* nospec rbx */