Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4114621pxb; Mon, 8 Feb 2021 08:16:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNYaoUErvWq+fi4ypuEj0BS9NkNG4hSgDYHSW/VBJFwglmtAHHGgfyYro7/3dzlss6erz4 X-Received: by 2002:a17:906:3285:: with SMTP id 5mr17934506ejw.356.1612801012009; Mon, 08 Feb 2021 08:16:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612801012; cv=none; d=google.com; s=arc-20160816; b=tNh4LFqU+nm7nELv2RRXwz3zq9eetVNB65v+Ej6iEJPOWPCC2yc6UGwm+tHFMGHcyO tzdeGJGiqnhLfiDXAxTrBjnvn5NxHM6jlyO48h3qqyuaVLzpmilWCDBEKoOvAZl1imis dQ51+GeJi7harO7ZovP1oArbFYeRhB+DlIdsavH3MO7MHWYQeUY0JVTTUXiQYBFxqt1m 1/4lAQBa8P56U682wiO2VnZOY9owE2CNcpb8GVg+0gY1+NFU4GWiCYq+qpo1bG8cw+1T lsTihLoDrxcoG/lvPGtJ3G6KVQJEsLbohf8QdEIa0hBhALYZMFidat+Y+fX+0S6zX+jj 3eIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:references:in-reply-to :message-id; bh=LZj+we1aZtGvzKNOxxcT9Y/1+uLYNg44oiizMrYRxVE=; b=tZsKEChmXEtm1wXSsvgBlDp8j6FSX05sxG/KYnAqBW/1PgND1qSaqX5G08YoU8nkQS t/Dp/ZebxQYhDIuZuwMuA0EihRh9fl6ZgYTR4MkGH4d0hCQ4UhkppFxg2gfPHxFlzgra Zqz0W/0/4i4vo4gHhGRW1XiyQ9RkzJSqoriuL9iV0/tjmzbipFVZxUzhgKguI7g0+FYs cVdJTqXhaGIHbNk4iVPo2k6Pir9N36GbLd28mAak/XiL/uz+xGsGr5q+34S2qfbWemQC UuHTb+o3oPFAu/IQXhmu9GSdCnhNQLjxefFwfX9iHJK7AdoxMcptZwIOZGOTB2P1CQob 0RDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j16si1512887ejy.305.2021.02.08.08.16.26; Mon, 08 Feb 2021 08:16:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233255AbhBHQPw (ORCPT + 99 others); Mon, 8 Feb 2021 11:15:52 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:38589 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232524AbhBHPLE (ORCPT ); Mon, 8 Feb 2021 10:11:04 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4DZ8bC4Zpnz9vBn7; Mon, 8 Feb 2021 16:10:15 +0100 (CET) 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 gKTZq4CerUPD; Mon, 8 Feb 2021 16:10:15 +0100 (CET) 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 4DZ8bC3Vk5z9vBn3; Mon, 8 Feb 2021 16:10:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D31988B7B3; Mon, 8 Feb 2021 16:10:20 +0100 (CET) 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 8YNh5aPoktjj; Mon, 8 Feb 2021 16:10:20 +0100 (CET) Received: from po16121vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.230.103]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 72EFC8B7B2; Mon, 8 Feb 2021 16:10:20 +0100 (CET) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 690CC6733E; Mon, 8 Feb 2021 15:10:20 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v5 01/22] powerpc/32s: Add missing call to kuep_lock on syscall entry To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , npiggin@gmail.com, msuchanek@suse.de Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Mon, 8 Feb 2021 15:10:20 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Userspace Execution protection and fast syscall entry were implemented independently from each other and were both merged in kernel 5.2, leading to syscall entry missing userspace execution protection. On syscall entry, execution of user space memory must be locked in the same way as on exception entry. Fixes: b86fb88855ea ("powerpc/32: implement fast entry for syscalls on non BOOKE") Cc: stable@vger.kernel.org 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 b102b40c4988..b1e36602c013 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S @@ -351,6 +351,9 @@ trace_syscall_entry_irq_off: .globl transfer_to_syscall transfer_to_syscall: +#ifdef CONFIG_PPC_BOOK3S_32 + kuep_lock r11, r12 +#endif #ifdef CONFIG_TRACE_IRQFLAGS andi. r12,r9,MSR_EE beq- trace_syscall_entry_irq_off -- 2.25.0