Received: by 10.223.185.116 with SMTP id b49csp1000848wrg; Wed, 21 Feb 2018 10:21:18 -0800 (PST) X-Google-Smtp-Source: AH8x224Opa3GDggR2b6Os+qu1puWQFtbKvNoERPFVrfB5fBPxd4KGgPX/fbHWLEuDKZdGlwduGvo X-Received: by 2002:a17:902:7b98:: with SMTP id w24-v6mr3943777pll.328.1519237278305; Wed, 21 Feb 2018 10:21:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519237278; cv=none; d=google.com; s=arc-20160816; b=ogpqGFOEaW4VcNEltn+ThgyiZw2/l8DhuD0iVrWKt0C5BErB1Y6lZCc80szIBm0JVK fRoibrVqsL91JJB7j9Nv5MYPAdn3MJgFhZW5+QmICLYbSCBdUnWKGgjk2+hLiDTTcacL w+I77mQWanFCdLiT/1nUSIlNM7zjEh5tVy0h3n47n/dgy39zDLznLacvbX6YTchfDAOC yhwNUfzZzgiX/N91LReVBBu3LnX3Sx4HBH7MKv5F6UEK3DUA/J+apxFmbm6q3TstgUba MtFNyjzU8oOYKdCwBXqQZf0lU2gumnQKI7fUSBwkx8R+AK3kWto8WbOaJ4CFpOMAcZSO DzKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=RAhOT26S4EMpLdL01maOm9PpLOk207eoLmvg8ewiMlM=; b=JwmFPWjGSRq5W+6XxkAuOkgwCIhqjRi3+K0r/uIsvEbuWS77k3fE0YVScAJl3/Q9hd OXX3QTLZ9zX/TaKOrnlEcUTPCc8K9Vv/ejS2qqyR3eqDH6+cS0JcLXa5+ZqVUngcPKZR 3hU3bZm7DfU1tiv8eW5DN+QV/Fq7D81eEoC4yWHCtRLMybuGIWj2Usce/NgyPHFa8+MW 9EbVeSfCNmb8iqyMBZlBiOqUIJ8OPOVyQbmKVGh/8oAa3L7T7ePJBG4D93OXr+CUjRNN m8cjQ65+CnfSN2Z4G+FW1gxKYcZWhhqtGwFs2KO0Rie/WwLwijKipj73Vj7UTfp80IXB Dk1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i6-v6si1644448plt.437.2018.02.21.10.20.29; Wed, 21 Feb 2018 10:21:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935075AbeBUM7T (ORCPT + 99 others); Wed, 21 Feb 2018 07:59:19 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:36452 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935025AbeBUM7O (ORCPT ); Wed, 21 Feb 2018 07:59:14 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 27BDBFE1; Wed, 21 Feb 2018 12:59:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anders Roxell , Naresh Kamboju , Kees Cook , Shuah Khan Subject: [PATCH 4.14 009/167] selftests: seccomp: fix compile error seccomp_bpf Date: Wed, 21 Feb 2018 13:47:00 +0100 Message-Id: <20180221124525.113392115@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180221124524.639039577@linuxfoundation.org> References: <20180221124524.639039577@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Anders Roxell commit 912ec316686df352028afb6efec59e47a958a24d upstream. aarch64-linux-gnu-gcc -Wl,-no-as-needed -Wall -lpthread seccomp_bpf.c -o seccomp_bpf seccomp_bpf.c: In function 'tracer_ptrace': seccomp_bpf.c:1720:12: error: '__NR_open' undeclared (first use in this function) if (nr == __NR_open) ^~~~~~~~~ seccomp_bpf.c:1720:12: note: each undeclared identifier is reported only once for each function it appears in In file included from seccomp_bpf.c:48:0: seccomp_bpf.c: In function 'TRACE_syscall_ptrace_syscall_dropped': seccomp_bpf.c:1795:39: error: '__NR_open' undeclared (first use in this function) EXPECT_SYSCALL_RETURN(EPERM, syscall(__NR_open)); ^ open(2) is a legacy syscall, replaced with openat(2) since 2.6.16. Thus new architectures in the kernel, such as arm64, don't implement these legacy syscalls. Fixes: a33b2d0359a0 ("selftests/seccomp: Add tests for basic ptrace actions") Signed-off-by: Anders Roxell Tested-by: Naresh Kamboju Cc: stable@vger.kernel.org Acked-by: Kees Cook Signed-off-by: Shuah Khan Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/seccomp/seccomp_bpf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/tools/testing/selftests/seccomp/seccomp_bpf.c +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c @@ -1717,7 +1717,7 @@ void tracer_ptrace(struct __test_metadat if (nr == __NR_getpid) change_syscall(_metadata, tracee, __NR_getppid); - if (nr == __NR_open) + if (nr == __NR_openat) change_syscall(_metadata, tracee, -1); } @@ -1792,7 +1792,7 @@ TEST_F(TRACE_syscall, ptrace_syscall_dro true); /* Tracer should skip the open syscall, resulting in EPERM. */ - EXPECT_SYSCALL_RETURN(EPERM, syscall(__NR_open)); + EXPECT_SYSCALL_RETURN(EPERM, syscall(__NR_openat)); } TEST_F(TRACE_syscall, syscall_allowed)