Return-Path: Received: from mail-co1nam03on0096.outbound.protection.outlook.com ([104.47.40.96]:45338 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032123AbeCAP3w (ORCPT ); Thu, 1 Mar 2018 10:29:52 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: David Woodhouse , Thomas Gleixner , Sasha Levin Subject: [added to the 4.1 stable tree] x86/retpoline/checksum32: Convert assembler indirect jumps Date: Thu, 1 Mar 2018 15:24:19 +0000 Message-ID: <20180301152116.1486-179-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: David Woodhouse This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit 5096732f6f695001fa2d6f1335a2680b37912c69 ] Convert all indirect jumps in 32bit checksum assembler code to use non-speculative sequences when CONFIG_RETPOLINE is enabled. Signed-off-by: David Woodhouse Signed-off-by: Thomas Gleixner Acked-by: Arjan van de Ven Acked-by: Ingo Molnar Cc: gnomes@lxorguk.ukuu.org.uk Cc: Rik van Riel Cc: Andi Kleen Cc: Josh Poimboeuf Cc: thomas.lendacky@amd.com Cc: Peter Zijlstra Cc: Linus Torvalds Cc: Jiri Kosina Cc: Andy Lutomirski Cc: Dave Hansen Cc: Kees Cook Cc: Tim Chen Cc: Greg Kroah-Hartman Cc: Paul Turner Link: https://lkml.kernel.org/r/1515707194-20531-11-git-send-email-dwmw@ama= zon.co.uk Signed-off-by: Sasha Levin --- arch/x86/lib/checksum_32.S | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/x86/lib/checksum_32.S b/arch/x86/lib/checksum_32.S index 9bc944a91274..b7518368492a 100644 --- a/arch/x86/lib/checksum_32.S +++ b/arch/x86/lib/checksum_32.S @@ -29,7 +29,8 @@ #include #include #include - =09 +#include + /* * computes a partial checksum, e.g. for TCP/UDP fragments */ @@ -159,7 +160,7 @@ ENTRY(csum_partial) negl %ebx lea 45f(%ebx,%ebx,2), %ebx testl %esi, %esi - jmp *%ebx + JMP_NOSPEC %ebx =20 # Handle 2-byte-aligned regions 20: addw (%esi), %ax @@ -446,7 +447,7 @@ ENTRY(csum_partial_copy_generic) andl $-32,%edx lea 3f(%ebx,%ebx), %ebx testl %esi, %esi=20 - jmp *%ebx + JMP_NOSPEC %ebx 1: addl $64,%esi addl $64,%edi=20 SRC(movb -32(%edx),%bl) ; SRC(movb (%edx),%bl) --=20 2.14.1