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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 682C7C433E0 for ; Tue, 22 Dec 2020 16:23:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E50A23105 for ; Tue, 22 Dec 2020 16:23:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728110AbgLVQXe (ORCPT ); Tue, 22 Dec 2020 11:23:34 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:37667 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728090AbgLVQXd (ORCPT ); Tue, 22 Dec 2020 11:23:33 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 27A265C00AB; Tue, 22 Dec 2020 11:22:22 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 22 Dec 2020 11:22:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tycho.pizza; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=7l9FwVWMt0lhChPES7y4KGsYeP9 QeYxFohpctDuoPzk=; b=fow6qqKZCy1e29PzP504o/np8ROIMv4EF4lHHVCVwsz /qk7EpjYDDqlFrvg8vaAF9HqdF2v6xuGZ0/HBIDEvZ0A9vkLCaHlCnEOXyZ14ezZ oVPugSt2xgph7SKV7EEdxqciMUsPC+WZi2evB5DE3dt2lasulz4NrH4imVZs6/Ca d6Ef9vBgUlRihSNKoR3j5c2w88a47sGFf9zhjpqAGdiWzWU+OiAs/CTKO4+6oLY8 VYcq95+HQpwDy3ORiT+z4dI68VsI0uxTWDvbtlr4NI/hqHTEdVmxA+Vs9EOqaxzM XoiDTo943YbB9pypXMgtQCt05a9BHmcjkNZP3esGpWA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=7l9FwV WMt0lhChPES7y4KGsYeP9QeYxFohpctDuoPzk=; b=TzkByXBZ3GEBX8ayZGFwnL N6YbXfMQrtJqwjWg/0dUeKtGpCP6z8OkKHwEQaaposdBq9RwC3rL64RoXFvE8PsZ 4pXneKsNBMgUrmFVv54DgrQ3zHyUO2gQImLAp70vOEOJX3b6SFXQ0ms6gh4Ltqeg hw8hln6myiq5cpCGry/vf0/aA4A1MQfzNwlGDHJgzYvjcYexEuICwyivDgf933q2 e87+TVbHXnjykhgAqAgriPLoPD55bCgzOjp8D/h7S/TgmU9S4Tfg00mAZftwz56s dmxgHnqM0IAO30a2RJfPiuX+wGanwj9aXZRxrRGYt1/bDl/gzOcrwM+HNgVAqdPQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvddtgedgkeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefvhigthhho ucetnhguvghrshgvnhcuoehthigthhhosehthigthhhordhpihiiiigrqeenucggtffrrg htthgvrhhnpeeifffffeekkeeifffhteekleejhfetledvvdeileefheffveduveevleef lefgtdenucffohhmrghinhepvghnthhrhidrshgsnecukfhppeejuddrheeirdduleefrd duieeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep thihtghhohesthihtghhohdrphhiiiiirg X-ME-Proxy: Received: from cisco (unknown [71.56.193.168]) by mail.messagingengine.com (Postfix) with ESMTPA id C466A108005B; Tue, 22 Dec 2020 11:22:20 -0500 (EST) Date: Tue, 22 Dec 2020 09:22:19 -0700 From: Tycho Andersen To: Andreas Schwab Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , Paul Walmsley , David Abdurachmanov Subject: Re: [PATCH] riscv: return -ENOSYS for syscall -1 Message-ID: <20201222162219.GA710211@cisco> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 21, 2020 at 11:52:00PM +0100, Andreas Schwab wrote: > Properly return -ENOSYS for syscall -1 instead of leaving the return value > uninitialized. This fixes the strace teststuite. > > Fixes: 5340627e3fe0 ("riscv: add support for SECCOMP and SECCOMP_FILTER") > Signed-off-by: Andreas Schwab > --- > arch/riscv/kernel/entry.S | 9 +-------- > 1 file changed, 1 insertion(+), 8 deletions(-) > > diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S > index 524d918f3601..d07763001eb0 100644 > --- a/arch/riscv/kernel/entry.S > +++ b/arch/riscv/kernel/entry.S > @@ -186,14 +186,7 @@ check_syscall_nr: > * Syscall number held in a7. > * If syscall number is above allowed value, redirect to ni_syscall. > */ > - bge a7, t0, 1f > - /* > - * Check if syscall is rejected by tracer, i.e., a7 == -1. > - * If yes, we pretend it was executed. > - */ > - li t1, -1 > - beq a7, t1, ret_from_syscall_rejected > - blt a7, t1, 1f > + bgeu a7, t0, 1f IIUC, this is all dead code anyway for the path where seccomp actually rejects the syscall, since it should do the rejection directly in handle_syscall_trace_enter(), which is called above this hunk. So it seems good to me. Reviewed-by: Tycho Andersen