From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B27C2C04E53 for ; Wed, 15 May 2019 12:13:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8302920843 for ; Wed, 15 May 2019 12:13:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557922417; bh=KEF/opwpp5P6zojoRUh/d1gcRt1Rcv+1TnFfQsLWYfE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=NaFKbM5XHVyN+/wgNwVof/NHbJsHVyIAgHjaj7fq3NR/rf/4M2zuXIDdyql9cr0bk hLv+JCZ451jg/oGZeC1W8wwHMznEZhT6MYQW8js1htYbk2hWyLZSpNN5hR1mZHm+9e H79wkVpLQIfWi/6KldZghWuGJJJ8xu9foZ+pHX9o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727280AbfEOMNc (ORCPT ); Wed, 15 May 2019 08:13:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:34976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726990AbfEOLFD (ORCPT ); Wed, 15 May 2019 07:05:03 -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 9468D2173C; Wed, 15 May 2019 11:05:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557918303; bh=KEF/opwpp5P6zojoRUh/d1gcRt1Rcv+1TnFfQsLWYfE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jhy8g/ZI4ZJPfaLI7Sy03optvQCILS115VE006PsbwvJ+f90VPY5pXp+lGGyON4fI nZfpaMrIUKnw15eOMftiHxHtOnosDFTnzEU5p6wdg111DTl3DpFEgHrjcnmqSc8UuJ FNA/ZzhJ+kiXav9NRFXlyAxpqdmMdCk5bqMvLTTY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "linuxppc-dev@ozlabs.org, mpe@ellerman.id.au, Diana Craciun" , Michael Ellerman , Diana Craciun Subject: [PATCH 4.4 083/266] powerpc/fsl: Sanitize the syscall table for NXP PowerPC 32 bit platforms Date: Wed, 15 May 2019 12:53:10 +0200 Message-Id: <20190515090725.251133456@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090722.696531131@linuxfoundation.org> References: <20190515090722.696531131@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Diana Craciun commit c28218d4abbf4f2035495334d8bfcba64bda4787 upstream. Used barrier_nospec to sanitize the syscall table. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/entry_32.S | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S @@ -33,6 +33,7 @@ #include #include #include +#include /* * MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE. @@ -340,6 +341,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