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=-11.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 8B693C43387 for ; Mon, 7 Jan 2019 09:40:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5CCE42070C for ; Mon, 7 Jan 2019 09:40:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546854015; bh=fJySlSaa7iGbbmSTxRYgYOpiUfiZTgzO1TiT4haK+9A=; h=Subject:To:Cc:From:Date:List-ID:From; b=Nk5n4FcIpK//qrKmXMfqfDoFxDtKJuy2cW02QdjczQM73kbG4iXwpKx8bQ7MUqzTf lZ+EccecNpYTnT1l8+DGJa+uprNHfRe6wqq/aCMFldPu2Gy6o7cs6dvvvXUvP9v+8C AxLSXeDAACSvqYnpAzAYFfQV11SNB9SxzsPwX7Bc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726562AbfAGJkP (ORCPT ); Mon, 7 Jan 2019 04:40:15 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:38653 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725550AbfAGJkO (ORCPT ); Mon, 7 Jan 2019 04:40:14 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 7D7D122A81; Mon, 7 Jan 2019 04:40:13 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 07 Jan 2019 04:40:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=iS1PrF mPBF63koVSkI3tInh4JshjlH773uFNm6SaDNg=; b=WNPqHtQDFD+fV+fHxG2C6X zUys02SdOSQ5+a6q5MmeaTRYLkYXYj9IxVDlGyiNtZzQm2zdWG5wHJdm8Sp5X5gZ 0/IZFfB81HW07RqReH7sa+tDs3aTooVvvUNE0VFCGH/kHsdXPy3QetyNdhwOY0oz alHFHDIlMqNEmAHy2o4C90MDtxYq8cTkVL9+Q2Jka+26WwwlKc/YyrjkSEsEO9je zZpnK+Umk15cbqs9d/+Mi07ZWLe7K//g0L7py2JyqeAAg7C/K7KHHLfUQ0jX1DZl 8MmdU9zgs7KV5MZbsEC5SLRE40MZHsu6c4HM+8DLnLoh+Vnw5AnJ/yoqLcwSk4BA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrvdejgddtgeculddtuddrgedtkedrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtlfenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecukfhppeekfedrkeeirdekledruddtjeenucfrrghrrghmpehmrghilhhfrhhomh epghhrvghgsehkrhhorghhrdgtohhmnecuvehluhhsthgvrhfuihiivgephe X-ME-Proxy: Received: from localhost (5356596b.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id D9D72100E5; Mon, 7 Jan 2019 04:40:12 -0500 (EST) Subject: FAILED: patch "[PATCH] arm64: compat: Don't pull syscall number from regs in" failed to apply to 4.19-stable tree To: will.deacon@arm.com, Dave.Martin@arm.com, pihsun@chromium.org, stable@vger.kernel.org Cc: From: Date: Mon, 07 Jan 2019 10:40:11 +0100 Message-ID: <154685401125140@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.19-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ From 53290432145a8eb143fe29e06e9c1465d43dc723 Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Thu, 3 Jan 2019 18:00:39 +0000 Subject: [PATCH] arm64: compat: Don't pull syscall number from regs in arm_compat_syscall The syscall number may have been changed by a tracer, so we should pass the actual number in from the caller instead of pulling it from the saved r7 value directly. Cc: Cc: Pi-Hsun Shih Reviewed-by: Dave Martin Signed-off-by: Will Deacon diff --git a/arch/arm64/kernel/sys_compat.c b/arch/arm64/kernel/sys_compat.c index a79db4e485a6..bc348ab3dd6b 100644 --- a/arch/arm64/kernel/sys_compat.c +++ b/arch/arm64/kernel/sys_compat.c @@ -66,12 +66,11 @@ do_compat_cache_op(unsigned long start, unsigned long end, int flags) /* * Handle all unrecognised system calls. */ -long compat_arm_syscall(struct pt_regs *regs) +long compat_arm_syscall(struct pt_regs *regs, int scno) { - unsigned int no = regs->regs[7]; void __user *addr; - switch (no) { + switch (scno) { /* * Flush a region from virtual address 'r0' to virtual address 'r1' * _exclusive_. There is no alignment requirement on either address; @@ -107,7 +106,7 @@ long compat_arm_syscall(struct pt_regs *regs) * way the calling program can gracefully determine whether * a feature is supported. */ - if (no < __ARM_NR_COMPAT_END) + if (scno < __ARM_NR_COMPAT_END) return -ENOSYS; break; } @@ -116,6 +115,6 @@ long compat_arm_syscall(struct pt_regs *regs) (compat_thumb_mode(regs) ? 2 : 4); arm64_notify_die("Oops - bad compat syscall(2)", regs, - SIGILL, ILL_ILLTRP, addr, no); + SIGILL, ILL_ILLTRP, addr, scno); return 0; } diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c index 032d22312881..5610ac01c1ec 100644 --- a/arch/arm64/kernel/syscall.c +++ b/arch/arm64/kernel/syscall.c @@ -13,16 +13,15 @@ #include #include -long compat_arm_syscall(struct pt_regs *regs); - +long compat_arm_syscall(struct pt_regs *regs, int scno); long sys_ni_syscall(void); -asmlinkage long do_ni_syscall(struct pt_regs *regs) +static long do_ni_syscall(struct pt_regs *regs, int scno) { #ifdef CONFIG_COMPAT long ret; if (is_compat_task()) { - ret = compat_arm_syscall(regs); + ret = compat_arm_syscall(regs, scno); if (ret != -ENOSYS) return ret; } @@ -47,7 +46,7 @@ static void invoke_syscall(struct pt_regs *regs, unsigned int scno, syscall_fn = syscall_table[array_index_nospec(scno, sc_nr)]; ret = __invoke_syscall(regs, syscall_fn); } else { - ret = do_ni_syscall(regs); + ret = do_ni_syscall(regs, scno); } regs->regs[0] = ret;