Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6725886ybe; Wed, 18 Sep 2019 08:05:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTdfVLNujEdE+Q0zMHBi/qDdxGaDderrzSMN9rp/Td//U2oKZX653tVV5QVjUQNZcdCUNg X-Received: by 2002:a17:906:860d:: with SMTP id o13mr9854100ejx.284.1568819152808; Wed, 18 Sep 2019 08:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568819152; cv=none; d=google.com; s=arc-20160816; b=pqMrynMd0IQ73LWaWoaG1Altq7kSt3n8BjZBo+4mzDioXs07y0EyjtPVGr7tCv6U8w nG5W4P9lTjCaV+pkL+NtHdyyb19b0u6VJOPifYzshknnSGzcihiMCv6KkNvC3GZVWHC6 3eCbXFusC4yjp1sTEwI18GLeQ+0NztLSqvy9CndAHetusFexdNxbC7d11h0Qp1HbvD8F yTwzE8IBTW7EyNlsFWS9iGaO1kqJy101doplLqNGP87IiKlpmMer+tGaxoFVlATq6Skg UA7Bp/S+IiQyyDbbllWhPNnDqLZIqKJBl1deCBphlB5/Io+qrNKKnX0m6re6oWV1gkwp 6Tbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=HMeAZSeEid9YSvf1tYj9mbf5cq9nR/LUwcATB9JOFFc=; b=xbjjAN37Y00al+xzIYrdo/ghkI8kfyOZK5m7BqK2Wfkbr+Sd9q57fhYXbAvcm2iVE6 cMa0SjObkMHcBomEeKF92T6Dowq0Niqi77Sn/F+KLBuVYmwlO7roJbWHzkIfKEW+GgFI r/JxtdZhRR3Csm7yUizNLofPwBj3KVUkJhnYRRWVwNDXwgfiO3tuixYAOYhxoxTXvHvE 4JXUePIbVwCNQKQh0rxkvvFWjwdWvrp8/kLZ5CMgSYcA7ORO/MRAUHnlf/naJ/X1MoTy ImdueWYNnrd3c6TpZgAJHnNxwlr/eyHUlOOwv5n89bhPWb93p75rWgOgveJzOEeEF8i+ 3Mgw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f13si3255310edr.445.2019.09.18.08.05.28; Wed, 18 Sep 2019 08:05:52 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729053AbfIRJPV (ORCPT + 99 others); Wed, 18 Sep 2019 05:15:21 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:42732 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbfIRJPV (ORCPT ); Wed, 18 Sep 2019 05:15:21 -0400 Received: from static-dcd-cqq-121001.business.bouyguestelecom.com ([212.194.121.1] helo=elm) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iAW3O-0006i4-C9; Wed, 18 Sep 2019 09:15:14 +0000 Date: Wed, 18 Sep 2019 11:15:12 +0200 From: Tyler Hicks To: Christian Brauner Cc: keescook@chromium.org, luto@amacapital.net, jannh@google.com, wad@chromium.org, shuah@kernel.org, ast@kernel.org, daniel@iogearbox.net, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Tycho Andersen , stable@vger.kernel.org Subject: Re: [PATCH 2/4] seccomp: add two missing ptrace ifdefines Message-ID: <20190918091512.GA5088@elm> References: <20190918084833.9369-1-christian.brauner@ubuntu.com> <20190918084833.9369-3-christian.brauner@ubuntu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190918084833.9369-3-christian.brauner@ubuntu.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-09-18 10:48:31, Christian Brauner wrote: > Add tw missing ptrace ifdefines to avoid compilation errors on systems > that do not provide PTRACE_EVENTMSG_SYSCALL_ENTRY or > PTRACE_EVENTMSG_SYSCALL_EXIT or: > > gcc -Wl,-no-as-needed -Wall seccomp_bpf.c -lpthread -o seccomp_bpf > In file included from seccomp_bpf.c:52:0: > seccomp_bpf.c: In function ‘tracer_ptrace’: > seccomp_bpf.c:1792:20: error: ‘PTRACE_EVENTMSG_SYSCALL_ENTRY’ undeclared (first use in this function); did you mean ‘PTRACE_EVENT_CLONE’? > EXPECT_EQ(entry ? PTRACE_EVENTMSG_SYSCALL_ENTRY > ^ > ../kselftest_harness.h:608:13: note: in definition of macro ‘__EXPECT’ > __typeof__(_expected) __exp = (_expected); \ > ^~~~~~~~~ > seccomp_bpf.c:1792:2: note: in expansion of macro ‘EXPECT_EQ’ > EXPECT_EQ(entry ? PTRACE_EVENTMSG_SYSCALL_ENTRY > ^~~~~~~~~ > seccomp_bpf.c:1792:20: note: each undeclared identifier is reported only once for each function it appears in > EXPECT_EQ(entry ? PTRACE_EVENTMSG_SYSCALL_ENTRY > ^ > ../kselftest_harness.h:608:13: note: in definition of macro ‘__EXPECT’ > __typeof__(_expected) __exp = (_expected); \ > ^~~~~~~~~ > seccomp_bpf.c:1792:2: note: in expansion of macro ‘EXPECT_EQ’ > EXPECT_EQ(entry ? PTRACE_EVENTMSG_SYSCALL_ENTRY > ^~~~~~~~~ > seccomp_bpf.c:1793:6: error: ‘PTRACE_EVENTMSG_SYSCALL_EXIT’ undeclared (first use in this function); did you mean ‘PTRACE_EVENTMSG_SYSCALL_ENTRY’? > : PTRACE_EVENTMSG_SYSCALL_EXIT, msg); > ^ > ../kselftest_harness.h:608:13: note: in definition of macro ‘__EXPECT’ > __typeof__(_expected) __exp = (_expected); \ > ^~~~~~~~~ > seccomp_bpf.c:1792:2: note: in expansion of macro ‘EXPECT_EQ’ > EXPECT_EQ(entry ? PTRACE_EVENTMSG_SYSCALL_ENTRY > ^~~~~~~~~ > > Fixes: 6a21cc50f0c7 ("seccomp: add a return code to trap to userspace") I think this Fixes line is incorrect and should be changed to: Fixes: 201766a20e30 ("ptrace: add PTRACE_GET_SYSCALL_INFO request") With that changed, Reviewed-by: Tyler Hicks Tyler > Signed-off-by: Christian Brauner > Cc: Kees Cook > Cc: Andy Lutomirski > Cc: Will Drewry > Cc: Shuah Khan > Cc: Alexei Starovoitov > Cc: Daniel Borkmann > Cc: Martin KaFai Lau > Cc: Song Liu > Cc: Yonghong Song > Cc: Tycho Andersen > CC: Tyler Hicks > Cc: Jann Horn > Cc: stable@vger.kernel.org > Cc: linux-kselftest@vger.kernel.org > Cc: netdev@vger.kernel.org > Cc: bpf@vger.kernel.org > --- > tools/testing/selftests/seccomp/seccomp_bpf.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c > index 6ef7f16c4cf5..ee52eab01800 100644 > --- a/tools/testing/selftests/seccomp/seccomp_bpf.c > +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c > @@ -155,6 +155,14 @@ struct seccomp_data { > #ifndef PTRACE_SECCOMP_GET_METADATA > #define PTRACE_SECCOMP_GET_METADATA 0x420d > > +#ifndef PTRACE_EVENTMSG_SYSCALL_ENTRY > +#define PTRACE_EVENTMSG_SYSCALL_ENTRY 1 > +#endif > + > +#ifndef PTRACE_EVENTMSG_SYSCALL_EXIT > +#define PTRACE_EVENTMSG_SYSCALL_EXIT 2 > +#endif > + > struct seccomp_metadata { > __u64 filter_off; /* Input: which filter */ > __u64 flags; /* Output: filter's flags */ > -- > 2.23.0 >