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=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,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 D6EFDC433E0 for ; Tue, 22 Dec 2020 16:22:37 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 82E8D229C6 for ; Tue, 22 Dec 2020 16:22:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 82E8D229C6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=tycho.pizza Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zEFwEHvKCs2jOQ6UHOcFTXv3OVuNQ34TTvi7Yi7bK2E=; b=odOPFWtKWML2ey0nGy1dkCLrG qungRphFZIYWuXTYy+ddX4qu+q8pO9Q9LhOa/El9VWBdyjjDYO6r/tw4M8NiBO/5wnNQ6XNXr9gwa CwPOsxB5yy0TrpwVIIamp1BWES70X/11Kf1NeerjWaGBC7Fw5/a8Xe2MF62OcdDEjrtRB+O9haX2b 8nqeK2dNDuqIlDCpP+/TpaEvEhCaOvdT9FAS+Qqs8NPiUs7Vdeby1TJoFv0uaBpSXhjMtDEU0cG2I yJmnNVCO58BPJ3uNz++zgJqJ0kDw82tfoSQQEE9OSBMukRXxX7kYcCGTjEH4w8UyyrgV8AbtpayFi Z6dEPb86Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1krkQg-0001uH-K6; Tue, 22 Dec 2020 16:22:30 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1krkQd-0001tU-Gh for linux-riscv@lists.infradead.org; Tue, 22 Dec 2020 16:22:28 +0000 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 Subject: Re: [PATCH] riscv: return -ENOSYS for syscall -1 Message-ID: <20201222162219.GA710211@cisco> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201222_112227_805366_C270BB67 X-CRM114-Status: GOOD ( 16.54 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Abdurachmanov , linux-riscv@lists.infradead.org, Palmer Dabbelt , linux-kernel@vger.kernel.org, Paul Walmsley Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv