Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2445690yba; Mon, 15 Apr 2019 11:47:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHQZE7bqfm266J1AAOdDnJN4F42vKnG7J+3YdLCrYsNYP950x7AwCpYBJceiW2GWh2xzEy X-Received: by 2002:aa7:8458:: with SMTP id r24mr76220610pfn.231.1555354066656; Mon, 15 Apr 2019 11:47:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555354066; cv=none; d=google.com; s=arc-20160816; b=DmiVHni2oda5yF0efaClOS8AugmFy8yPnOhkhHgSva1D6LDMEjDa/3A4EZO8Gd7Cg+ J9kaaonIq6mTqEdfgvhHA3DNQb34bRFKUY3EwlKNli0xrBEqsYSXEyVqlhgncXhwpec1 zrk5ieEqoT5gSypdr3M7x0O0C04KsYygm+U2WTfp9v/OPSlc+BIzss8S2RvxB/Lq2i3C MG/N5fgRLnDni9VuJ1GHH7mRE3RcPVTNaC7ug4HEByQRftc0UABE9QGproERQL01KvwN zh4Fef4FPKRwiBIK5pSRpBWW9iUAOxnifpoZAybiHaHh72lDvDkJ1k5Y/4WgyxOlWthl WOOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4zZgark5RsEqg0MMzxWHOJFau9c83CWlM7HH1SHEIL4=; b=hvZR+wegmaE12ntjNdtPm6xhvrUDSeci/Uo+1m97LcdeUMMqLMCkMm5RCNlBW50Zl3 D66orWsLWJhszm1+giJeePpfWPGPbHnJRwZwCFuONVtjRSU7pEI4bwTj19RoTptrLsSn hhnZzoQcNNYPUwsx9OnfFkrSzX8anFtKHXb3DMGdhomKy5cCvGi6Z0EVaSLqtyb4TdRw nlif83VAcKEeTdeBfNVOKLxcHH/InvyBynraooyeG68M6PTMdgBLa2GePz/JKknpNG6A c/D5hCzPWSpY4nTWsOL2Gnz+abWPVcNuYeDXy4SSqqCylCZAk2l7MqrgTI+hw+Hxj9BB LNXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lIq61BsM; 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 b128si16819323pfb.141.2019.04.15.11.47.30; Mon, 15 Apr 2019 11:47:46 -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; dkim=pass header.i=@kernel.org header.s=default header.b=lIq61BsM; 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 S1728596AbfDOSq0 (ORCPT + 99 others); Mon, 15 Apr 2019 14:46:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:49058 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728569AbfDOSqU (ORCPT ); Mon, 15 Apr 2019 14:46:20 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 11A522073F; Mon, 15 Apr 2019 18:46:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555353979; bh=JbHRqqDdLox7A+1SqlhWZjj+LVtvxmrPPwy2w5Ps0vI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lIq61BsMt4+R+Bzetw4/IzjRsc34UWL2991IX6bDtfo1IF+nLK0geXnfEPk7793Lm GdwsYhqImMYI9hfeNRt+anaBJlv8CcumsFMiemu6O1UOEPLVxYM5l4RfrMt4aL5geX aBgo2V/R74zBnfcoenr7axWhd8oVNhOMkhQBsfrs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Diana Craciun , Michael Ellerman , Sasha Levin Subject: [PATCH 4.9 26/76] powerpc/fsl: Sanitize the syscall table for NXP PowerPC 32 bit platforms Date: Mon, 15 Apr 2019 20:43:50 +0200 Message-Id: <20190415183714.606590273@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183707.712011689@linuxfoundation.org> References: <20190415183707.712011689@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit c28218d4abbf4f2035495334d8bfcba64bda4787 upstream. Used barrier_nospec to sanitize the syscall table. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/kernel/entry_32.S | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index 370645687cc7..bdd88f9d7926 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S @@ -34,6 +34,7 @@ #include #include #include +#include /* * MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE. @@ -347,6 +348,15 @@ syscall_dotrace_cont: ori r10,r10,sys_call_table@l slwi r0,r0,2 bge- 66f + + barrier_nospec_asm + /* + * Prevent the load of the handler below (based on the user-passed + * system call number) being speculatively executed until the test + * against NR_syscalls and branch to .66f above has + * committed. + */ + lwzx r10,r10,r0 /* Fetch system call handler [ptr] */ mtlr r10 addi r9,r1,STACK_FRAME_OVERHEAD -- 2.19.1