Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1327403pxu; Mon, 23 Nov 2020 18:41:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8kW3NmVaTwNwLzOTAAmQ3R6NGOTQaNfpduiXWOf3jrE9l3Po24m11ssiMMNAIyGnq7mIM X-Received: by 2002:a17:906:2742:: with SMTP id a2mr2219076ejd.219.1606185695707; Mon, 23 Nov 2020 18:41:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606185695; cv=none; d=google.com; s=arc-20160816; b=Q1LGrn344Jkc+1bhqnQLMBY0glwRNY61CdGeyJN9jCppFeolWJh17ztY9xgQs+YRq4 p+9Qfscs4Myb5IDXZNZQu84mgGPawRWi2SFtmD7zJ/B/wCcY53vKoJ9qDNB63HcXJD27 pOBZNuhCSHngDL3iUMYn7AAMU2FAHyQy3xlaCd7btSaIJTvRkDzKT19DT1hgDMRppVNA aRmnof5tqZxxQiVlTkjSmr+6f8ZYpFGsCRQBfIA25IqWjrLaG1vUGObyxsC1HBnkLj8a rQiww4i4dJYLjVyDAw+c74Q7ZTgkL3gjVpkLCuNID0gD/Yu0POV2b5+OTmMp4j7zUHIO dRBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NWilpQUoOqdCXIXRgB5NsFiM9CxGuvR26AJ8jQH9XVg=; b=g++8oqvepHOLYmLldESYWYH/UnPQ4g3KoPGocGwXd/qlSHpKWhTROd7vrbEQObnz09 Vn7mBRUNqbLkpBTkEt1pdNtJQsiuVOiBgzzdtE5aUFyQKoP9FPZBVXR8GvRQhgsHXXIv 3LmZrXW0/fQ3i4QArgFaHA4NHIs4BEORbA5lhTXgND7/Asq3K7De23C8KwCeqNh+EXHH Uz2HGHvcAd3KH68R7nZn7Vqceqtz5IsXoQVazqI1lauIxIklKc/VBocvygPVmPA4Fdhx BXkt+ZfqnrLQwJdyUFdiLXWJqw6kPOTHYZgk+h/Epk0VC2kRaPf4CgfgapYkgyLZ93nX Kx/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dAlJfE5F; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ok23si7394658ejb.243.2020.11.23.18.41.13; Mon, 23 Nov 2020 18:41:35 -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=@linuxfoundation.org header.s=korg header.b=dAlJfE5F; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387894AbgKWMyh (ORCPT + 99 others); Mon, 23 Nov 2020 07:54:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:33622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732853AbgKWMsp (ORCPT ); Mon, 23 Nov 2020 07:48:45 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A1440204EF; Mon, 23 Nov 2020 12:48:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135725; bh=1gHeG2YoVi44cfOM9wpOXmrgGLwBZx5fgGj0/eZWEmg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dAlJfE5FzHNEztwlBN+iL48VIGSo7KQX7/m6UU7Z0TJeR4oFdrvxfB+yg1RoB2tqL pPBmnKIOEJXYyZz/Rn+3S0ULled7NKfGywHUcBuvnxbzkvJ971MD/+t7QanN73q2dC 6I+4whrndNJ/0ijNPEjGieVoKg38S97KrXUPs5ko= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Paul Adrian Glaubitz , Kees Cook , Sasha Levin Subject: [PATCH 5.9 172/252] selftests/seccomp: sh: Fix register names Date: Mon, 23 Nov 2020 13:22:02 +0100 Message-Id: <20201123121843.891912494@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121835.580259631@linuxfoundation.org> References: <20201123121835.580259631@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kees Cook [ Upstream commit 4c222f31fb1db4d590503a181a6268ced9252379 ] It looks like the seccomp selftests was never actually built for sh. This fixes it, though I don't have an environment to do a runtime test of it yet. Fixes: 0bb605c2c7f2b4b3 ("sh: Add SECCOMP_FILTER") Tested-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/lkml/a36d7b48-6598-1642-e403-0c77a86f416d@physik.fu-berlin.de Signed-off-by: Kees Cook Signed-off-by: Sasha Levin --- tools/testing/selftests/seccomp/seccomp_bpf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c index 6a27b12e9b3c2..687ca8afe0e83 100644 --- a/tools/testing/selftests/seccomp/seccomp_bpf.c +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c @@ -1738,8 +1738,8 @@ TEST_F(TRACE_poke, getpid_runs_normally) #define SYSCALL_RET(_regs) (_regs).a[(_regs).windowbase * 4 + 2] #elif defined(__sh__) # define ARCH_REGS struct pt_regs -# define SYSCALL_NUM(_regs) (_regs).gpr[3] -# define SYSCALL_RET(_regs) (_regs).gpr[0] +# define SYSCALL_NUM(_regs) (_regs).regs[3] +# define SYSCALL_RET(_regs) (_regs).regs[0] #else # error "Do not know how to find your architecture's registers and syscalls" #endif -- 2.27.0