Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5102979pxu; Tue, 22 Dec 2020 08:25:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYMoEUsby/11HJBeFbvJ+vtBQLZf0dOFJZadf4VCzYGAAsavmwcGx49VgE1KXfNLHWbh3M X-Received: by 2002:a17:906:b217:: with SMTP id p23mr16153504ejz.461.1608654320825; Tue, 22 Dec 2020 08:25:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608654320; cv=none; d=google.com; s=arc-20160816; b=yaWkPFcc87hH1lLMP/m9sqztKN+YkyFBOGZ2OvuKJT/Hut6yU9a0WCf+CFcwdsMVuE ff6qQll12AmxMIrByHtA12/HSWOtblKbLLlEiHKcScpvmf/YCLv2kZ9gREkAVE/jrDHS ctpY93MiVCiXqfQft4Qn53JgHhItcIXIw2duDCf1DCc3vJsNhcQO47i2YzerxkAU88bb sSrhw7Q/HqGnKnZtQ2YssXHUyu0zfRyYH0f2VYcKDc/HK3/d78cIzLgGFXQTuDcMUmQ+ Nh2Bf/9ek/rZ9uOJgoqQ2MTWNZ9IM3Z7Lgo+qJF6yIZ9XwujT/BlPJynkiU+WzgDXlqS EZuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=7l9FwVWMt0lhChPES7y4KGsYeP9QeYxFohpctDuoPzk=; b=0VmbOp9wWYhbe96K6X83XbYA8NcTwpsyBaALw3vL76DEQnRXdOtGuFI/S8EIcr78Zx a9KsCU3tlkdELojWhdgq3ybyqp/6FNmTd6yssmo4vD+yg13KFJHu6Tu+rT9524L6q6/t WKj+Doodk48hkvAqdlx4dknhar9P8j+JHo5g7Umi10ktKT5eSX12gALw7zklq1vgzd9i OjBy7EHs6u19ue+94yQBcEGna/s4TOqwxElBN72lIZtitd6umebAUMb/gF2AeIGkP5XU Q2ZzgNBbbWdLCEwF0z1mycluC5wqnl7UhCVLxCvOPE0uFrFzKI/xQG7Lkz0lgsNPSGw1 NiXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tycho.pizza header.s=fm2 header.b=fow6qqKZ; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=TzkByXBZ; 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 k11si12543817edq.414.2020.12.22.08.24.58; Tue, 22 Dec 2020 08:25:20 -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; dkim=pass header.i=@tycho.pizza header.s=fm2 header.b=fow6qqKZ; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=TzkByXBZ; 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 S1728093AbgLVQXe (ORCPT + 99 others); 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