Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4517967pxu; Mon, 21 Dec 2020 14:56:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzrmNqWcdAJGWMiTAH4vvgRr5AkCIzCMwsXA9X/xTnAkH/3sfXR0pIsKPjMK+pd9zzX0fZt X-Received: by 2002:a17:906:589:: with SMTP id 9mr17508809ejn.229.1608591384856; Mon, 21 Dec 2020 14:56:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608591384; cv=none; d=google.com; s=arc-20160816; b=ntOppTHQni2xxN0IGetu06BxF4dyAccvx4B5z1QX+grzQOTWcaR5xeSaKM23BO5QOk J5A72qm6asFYmh1U3gMi8JgMNOcJmonoTOnSpcBW2HjKQqzz9yfAKABfpE4AE8xsFlfK DgvWMwmWVRdUdkSGYwhGH5SJlRaecE4WfzhJJAL1Q4sAjH7BWNEeSi432FnHI9N+9JGy uiY8alMXuRHfp0iyAXfCVFFZitU+OgSPuUyJE1MZtzk81jphu2LFnLYEFXWKDFn6XDjO 9rr+OcadIQAwWde2twanINyyt1++tSFUm9ZixddDHSlKucYIC0FV9ZFWLCUAo3qmfAsw OhBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:date:cc :subject:to:from; bh=IvHaC4Lyqf1FdwtX8rObm3OeGGXxujoi+KgyjjpAJc0=; b=uW1hiUKFlt6gCY0d694WrM44Ar+dmaI2CcN6AWqTJ9mk5yDQR2qrPoAsJ+0b+gDU6I h3n5xLwIW+K+xwEz/AyvnV7qPnc9LnxSKpRS8gnKG2E/YnBx3L4VtdwcMGdBoYZ9NOPB 7ZVHcihMXi6aWw95eEtLqNbjmwuIIvlt21QPq2WPHmcDFCqA+j5iA09Qz36xBk2owNYh nSWpJMHezw8aXHCkCl4Xy3liptU6g69Pc1K2T+ISZDlqYZO2V979z7ADs/KfxGQG3hL1 Nefr533jyIxfg0R6LhL//zfOOGjk329aY9h/NPcW/rFdhO+bddWfahddVaYQi4C22Bju ckig== ARC-Authentication-Results: i=1; mx.google.com; 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 g16si10992100edq.329.2020.12.21.14.56.02; Mon, 21 Dec 2020 14:56:24 -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; 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 S1726190AbgLUWwn (ORCPT + 99 others); Mon, 21 Dec 2020 17:52:43 -0500 Received: from mx2.suse.de ([195.135.220.15]:54190 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbgLUWwm (ORCPT ); Mon, 21 Dec 2020 17:52:42 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5B586AC63; Mon, 21 Dec 2020 22:52:01 +0000 (UTC) From: Andreas Schwab To: linux-riscv@lists.infradead.org Subject: [PATCH] riscv: return -ENOSYS for syscall -1 CC: linux-kernel@vger.kernel.org, Palmer Dabbelt , Paul Walmsley , Tycho Andersen , David Abdurachmanov X-Yow: How do I get HOME? Date: Mon, 21 Dec 2020 23:52:00 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 /* Call syscall */ la s0, sys_call_table slli t0, a7, RISCV_LGPTR -- 2.29.0 -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."