Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp837249imu; Thu, 3 Jan 2019 08:01:53 -0800 (PST) X-Google-Smtp-Source: ALg8bN5nFEHAayj/qCVsmITffYQLhfzUk96N9ivGepNQ76VygFzbLxDLiuIgS9FKxUJ7uh1qY6WS X-Received: by 2002:a17:902:30a3:: with SMTP id v32mr47943497plb.26.1546531313101; Thu, 03 Jan 2019 08:01:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546531313; cv=none; d=google.com; s=arc-20160816; b=mFGj34z8FPST46nRxe7NMleQ5OAK/FC6Bb6TVBCqAxDPNmPh3Ffubfz8do22BIciaz TTSa5cAnOLt4mKeNJ4qMGUc7M4hy3ne3eewoLuYvSk0hQZ89wYk4N7lRIWmn9E/k2jee 8EkURDB+CN0FzEbnewdXgTNRNMGr5gs0PwbA1kYC4R2jMyHc6+BR8A6eZ6c+Ij6l/2e/ 2HUTEGteIu9yNBBuUqZAO089UlIIYKg3Pr+Z0eXffmKJk9yZfZnA6LUnegdDNuCtnhYh u3oowR46YhMk+qGWJin3ImPd1JUXrnFW9hSjW8FaYiyc+pgobdjhrbBoGK6zQN/HCbzU 3yag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=nUGd3LG97xl0iv/WmRXqnCVYU+ycXnSsd2tNGjTAy+Q=; b=0GuOcnph/WyNRD8q9e8r+sBU6pjzV8XIDQRa6jj+/0x5prLJ1lX8H0DSk784XNX2Mz 8Wl1VSnRFXGze09a6MovMk9euqkt8elE/6U8XQHCVJ1/bfKPapj8xj6wDy4wWuqdzeob KgXFBuF6isUmD5XyWkSdIYJz3CwVWHkD9/FrwRm8n80Ihl3O1VFlOZq3Kqlt62qhWHxD 26fhuzQxyXg/frnNBriZJzW/pp9xRU7/VN7AvOVahzKRtHFcProAdoe6Ebg7Y0nyxpim YhTzcOpec4ppOoN5pDOl3XYDGd3iPpQCCnXf5GDhV1FFUv3vIHbcDANEHOtwRUWYxSdz WQUg== ARC-Authentication-Results: i=1; mx.google.com; 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 r8si8794719plo.203.2019.01.03.08.01.37; Thu, 03 Jan 2019 08:01:53 -0800 (PST) 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; 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 S1730712AbfACLuW (ORCPT + 99 others); Thu, 3 Jan 2019 06:50:22 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:47858 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726345AbfACLuV (ORCPT ); Thu, 3 Jan 2019 06:50:21 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E8DAFA78; Thu, 3 Jan 2019 03:50:20 -0800 (PST) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8EC5E3F5D4; Thu, 3 Jan 2019 03:50:19 -0800 (PST) Date: Thu, 3 Jan 2019 11:50:12 +0000 From: Dave Martin To: Pi-Hsun Shih Cc: Mark Rutland , Catalin Marinas , Will Deacon , open list , Dominik Brodowski , "moderated list:ARM64 PORT AARCH64 ARCHITECTURE" Subject: Re: [PATCH] arm64: Mirror arm for small unimplemented compat syscalls Message-ID: <20190103114959.GA3529@e103592.cambridge.arm.com> References: <20190103074550.217421-1-pihsun@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190103074550.217421-1-pihsun@chromium.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 03, 2019 at 03:45:47PM +0800, Pi-Hsun Shih wrote: > For syscall number smaller than 0xf0000, arm calls sys_ni_syscall > instead of arm_syscall in arch/arm/kernel/entry-common.S, which returns > -ENOSYS instead of raising SIGILL. Mirror this behavior for compat > syscalls in arm64. > > Fixes: 532826f3712b607 ("arm64: Mirror arm for unimplemented compat > syscalls") > Signed-off-by: Pi-Hsun Shih > --- > arch/arm64/kernel/syscall.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c > index 8f3371415642ad..95fd8c7ec8a171 100644 > --- a/arch/arm64/kernel/syscall.c > +++ b/arch/arm64/kernel/syscall.c > @@ -21,7 +21,7 @@ asmlinkage long do_ni_syscall(struct pt_regs *regs) > { > #ifdef CONFIG_COMPAT > long ret; > - if (is_compat_task()) { > + if (is_compat_task() && regs->regs[7] >= __ARM_NR_COMPAT_BASE) { compat_arm_syscall() ignores all bits r7 except for bits [15:0]. So, doesn't this mean that 0xf0000, 0x100000, 0x110000 will all do the same thing now? (Previously to your patch, 0xe0000, 0xd0000 etc. would also match in this code I've misunderstood something.) The gating check in arch/arm/kernel/trapc.s:arm_syscall() is if ((no >> 16) != (__ARM_NR_BASE>> 16)) I would expect that arm64 needs a similar check somewhere. Is the check already present? I may have missed it. Cheers ---Dave