Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1360304ybb; Sun, 29 Mar 2020 02:42:03 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuuCIKZOvXRQXDHzf2FjsQ9O25/UQ3zoZCG1KGf4eHXQX0yIICkgItr1OEbMQEg6FUDm/2U X-Received: by 2002:a05:6830:1da4:: with SMTP id z4mr5276603oti.5.1585474922982; Sun, 29 Mar 2020 02:42:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585474922; cv=none; d=google.com; s=arc-20160816; b=vGhMGvEgNA5lCiyLaUt6+ofPGLbJ+I/Q/ErMGvDWIxHJkDDcPw0XgAArttUWEQFa4Z qzLkrw1vRtrdxrxusJ7eppvGVhpz4oWtoOJVKpyfYXfnXCe3Egd5e92pGQ30/QPnXlWn WBU4qf+PGh3Hgw8rz1MGmR37Zn+UZw+4p29ReWBU93oitUGBSfgb/JfO/gZj+HZL/35l dNuh+4nMVpKJHbwVmOe770ux4qZxKadS4Rheb1OLGkjAriEcr32BIxFVUy/V26NA4/8a i3d7gLan6Vxma2Wgu697xk0kjjLNIItFajIRTHa2DNG7s7KZwXVZx9HCvBUSWjBX4s5A HslA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=5Z80nlld36RF3eOx9WYuiv3G1+IfkGQr5tws21gb9v8=; b=bv9Dg2Y1ra3737y5VslyGccODOxnE+CmYkmN3qmiFME7EveLMdKNR6ulJRoaw9V0o8 I7Pk0DV6VE1e+IOPUCs5QteL6TIpv9yOgjRQVD4ftl9zCAzgjUpuMzBs/6GFMqt1QnGp 7iEAwrv95006byM9Iq3iCwB13uvL9zfdQZjjrs/ak/+7viQ7AbhSF/NHOFvRxEvB3eAE q9fZM6e71UZj/7g9+bP+d16WgiYN8cdJeA6VkIvu8NrzSlPZ7hG9pp1O9516/SgOZEel HYu26cI4iPwTNpiHCpEaMWn4OS3fWNX4N08RpeCP/3B9WsgG0BUfshFyaZnAkQcSkGc7 mtHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=frgwwyW8; 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 q11si4816447oti.46.2020.03.29.02.41.50; Sun, 29 Mar 2020 02:42:02 -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=@c-s.fr header.s=mail header.b=frgwwyW8; 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 S1728073AbgC2JlV (ORCPT + 99 others); Sun, 29 Mar 2020 05:41:21 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:18170 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728065AbgC2JlS (ORCPT ); Sun, 29 Mar 2020 05:41:18 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48qrFQ4t7pz9v0Cf; Sun, 29 Mar 2020 11:41:14 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=frgwwyW8; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id OdyRlKg0hoWX; Sun, 29 Mar 2020 11:41:14 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 48qrFQ3mRMz9v0Bs; Sun, 29 Mar 2020 11:41:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1585474874; bh=5Z80nlld36RF3eOx9WYuiv3G1+IfkGQr5tws21gb9v8=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=frgwwyW8uuEtZGart6137dHKnFqR3QQnisuiQzZtt64mrfa9ZDh/Z6R2CKZhb8RHT Yvf/ZVOG61ExYE6xKoTQIXU2vlKHNXmB25NYyV+n99MyYsD7EH7F+0I6ubpmM5D8al 49Ck/Dj1xHtzBvz2WynCKIDyEilrOXz5/2QEAeB4= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 63AA68B770; Sun, 29 Mar 2020 11:41:12 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id Ql--TI0mgLMC; Sun, 29 Mar 2020 11:41:12 +0200 (CEST) Received: from pc16570vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id CF09D8B752; Sun, 29 Mar 2020 11:41:11 +0200 (CEST) Received: by pc16570vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 9E6EF65653; Sun, 29 Mar 2020 09:41:11 +0000 (UTC) Message-Id: <51d2b8f8edf167a3084a08091a42c57f93ea4d8c.1585474724.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH 11/12] powerpc/entry32: Blacklist syscall exit points for kprobe. To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , naveen.n.rao@linux.vnet.ibm.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Sun, 29 Mar 2020 09:41:11 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kprobe does not handle events happening in real mode. The very last part of syscall cannot support a trap. Add a symbol syscall_exit_finish to identify that part and blacklist it from kprobe. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/entry_32.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index 9a1a45d6038a..7035e838d422 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S @@ -463,6 +463,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX) lwz r7,_NIP(r1) lwz r2,GPR2(r1) lwz r1,GPR1(r1) +syscall_exit_finish: #if defined(CONFIG_PPC_8xx) && defined(CONFIG_PERF_EVENTS) mtspr SPRN_NRI, r0 #endif @@ -470,6 +471,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX) mtspr SPRN_SRR1,r8 SYNC RFI +_ASM_NOKPROBE_SYMBOL(syscall_exit_finish) #ifdef CONFIG_44x 2: li r7,0 iccci r0,r0 @@ -604,6 +606,7 @@ ret_from_kernel_syscall: mtspr SPRN_SRR1, r10 SYNC RFI +_ASM_NOKPROBE_SYMBOL(ret_from_kernel_syscall) /* * The fork/clone functions need to copy the full register set into -- 2.25.0