Received: by 10.223.185.116 with SMTP id b49csp1011496wrg; Wed, 21 Feb 2018 10:32:06 -0800 (PST) X-Google-Smtp-Source: AH8x2277QUHxzt52KfQ2G2E9Ix4LDoDrjTyX40TKMsldYawEs7wQHXqCd9usp6uv2XTHS7qaNe/U X-Received: by 10.99.151.74 with SMTP id d10mr799996pgo.350.1519237926114; Wed, 21 Feb 2018 10:32:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519237926; cv=none; d=google.com; s=arc-20160816; b=0f0/WDeiNruBaVFF40/ePwhujTyXQnNcM6a0lE76lMmnburi+qBkXt1+ilD7DmwG+c Xd5eG1CWj/fW+wgrkkhtm6MDmcA4jCQbRaoJiyC8CEjrOF8CZloZsn/NI+p2JZSTdLN9 F5FVOJvXERB+vSxI/WHfKXWAWuetFEKwy1i4/Weif1mEklv/olHXWblwSV4/wqZ2kiDO GT8KNzdagDnp9vb+Mo7ezVIkAgPn7/Q1bXunHIjhHb8zbIrhvnyq7YAtR5m5voKo8LZO ryC0RewT+iUAa0rEFUUjQm2dP8T9CjtdESyklkkRoeC0tT4YnxPeN3HOvi5/mafu3xNn P9Cg== 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=cFpB9WfPpGU6qxRK3SrI6LmkrgMJYOoBcmpymQ1OGLM=; b=dWaEbt95iD8sA0zyEL9eR8uKpFneTVDA5Sth7kdqpK+hMMD5PTaiMj0ihILRKy+wet 9uXVhJjhGTfmE+vK3W3ijpysfrcWQGL/EHBn4ZuH0UN28vB2Efvfu8uXfXRu/oNl0VQM tRjNBie4LzcMkaqF76n2RYFs7hxtGh3CBBD2VTLncX2ZHIBiN8a5FDSD2i4m6+YWA5QA lxaHMY6lOeb+jtVl7+JwobPAxV1de/EbTsTcwKuoeEMSyBZNWbzxMkiS1IMS62FtppRZ SjNX+Zvt8lQ1GzxBLnZ6bgAs19c2Dtenq1yspxea2wtU1MytXr8IXZNXE5wdrClKV6Nx K0QA== 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 g31-v6si2998054pld.714.2018.02.21.10.31.51; Wed, 21 Feb 2018 10:32:06 -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 S965019AbeBUNGg (ORCPT + 99 others); Wed, 21 Feb 2018 08:06:36 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:41034 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964996AbeBUNGc (ORCPT ); Wed, 21 Feb 2018 08:06:32 -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 F2055D66; Wed, 21 Feb 2018 13:06:31 +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.15 008/163] selftests: seccomp: fix compile error seccomp_bpf Date: Wed, 21 Feb 2018 13:47:17 +0100 Message-Id: <20180221124530.453810501@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180221124529.931834518@linuxfoundation.org> References: <20180221124529.931834518@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.15-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)