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=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 7E208C433E2 for ; Tue, 15 Sep 2020 15:57:31 +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 11492206B7 for ; Tue, 15 Sep 2020 15:57:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hgTIZuvE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 11492206B7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ubuntu.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=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=cLdqlfGej+d/6YCwccvvKB81UdXQrYnmBrEYCizqW1k=; b=hgTIZuvEgn9pxVXNrGAyruAa1 JSUpLcsqaEhgk74T0nXAJ8FL5QdT4IYoKIpvTH92q21qkaSq0J6PoBuwWf15tUXS+St1VLSw+xhmY 9pI8u+rxiXDk5X8EbAaOXd7VNTNS8XANaNjZKL2wSlWMWj1+rt9I8ZLuuhFwCrIAMq+81NTaxQj5R 8IHwmoY0HRfyFMBZ5pA6+dc988ZP5qHcWycYyG/RwZF7CsdezSZn6tJzRiIgJ4hHWwJupV4Lyw2Rp mSdPApf0HHIQ9pSlayGhaVhWnwqTSctW9U4XDAHcQpGlMk0d4vUmRNKv9C9FLe+Gc4Yez3gOGhXAf WLRfg7vYw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIDJR-0007O5-G0; Tue, 15 Sep 2020 15:56:09 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIDJN-0007Mq-GN for linux-arm-kernel@lists.infradead.org; Tue, 15 Sep 2020 15:56:06 +0000 Received: from ip5f5af089.dynamic.kabel-deutschland.de ([95.90.240.137] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kIDJ4-0005bW-Pu; Tue, 15 Sep 2020 15:55:46 +0000 Date: Tue, 15 Sep 2020 17:55:46 +0200 From: Christian Brauner To: Kees Cook Subject: Re: [PATCH 03/15] selftests/seccomp: mips: Define SYSCALL_NUM_SET macro Message-ID: <20200915155546.ht4vo7nqswxrgymb@wittgenstein> References: <20200912110820.597135-1-keescook@chromium.org> <20200912110820.597135-4-keescook@chromium.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200912110820.597135-4-keescook@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200915_115605_709266_18CACE33 X-CRM114-Status: GOOD ( 14.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thadeu Lima de Souza Cascardo , Will Drewry , linux-xtensa@linux-xtensa.org, Michael Ellerman , linux-kernel@vger.kernel.org, Andy Lutomirski , Max Filippov , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Christian Brauner Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Sep 12, 2020 at 04:08:08AM -0700, Kees Cook wrote: > Remove the mips special-case in change_syscall(). > > Signed-off-by: Kees Cook > --- > tools/testing/selftests/seccomp/seccomp_bpf.c | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > > diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c > index 1c83e743bfb1..02a9a6599746 100644 > --- a/tools/testing/selftests/seccomp/seccomp_bpf.c > +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c > @@ -1742,6 +1742,13 @@ TEST_F(TRACE_poke, getpid_runs_normally) > # define ARCH_REGS struct pt_regs > # define SYSCALL_NUM(_regs) (_regs).regs[2] > # define SYSCALL_SYSCALL_NUM regs[4] > +# define SYSCALL_NUM_SET(_regs, _nr) \ > + do { \ > + if ((_regs).regs[2] == __NR_O32_Linux) \ > + (_regs).regs[4] = _nr; \ > + else \ > + (_regs).regs[2] = _nr; \ > + } while (0) I think that # define SYSCALL_NUM_SET(_regs, _nr) \ do { \ if (SYSCALL_NUM(_regs) == __NR_O32_Linux) \ (_regs).regs[4] = _nr; \ else \ (_regs).regs[2] = _nr; \ } while (0) would read better but that's just a matter of taste. :) Looks good! Acked-by: Christian Brauner _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel