lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f01c3383-0184-9770-c72e-7fe08b552112@kernel.org>
Date:   Thu, 29 Aug 2019 18:45:58 -0600
From:   shuah <shuah@...nel.org>
To:     Kees Cook <keescook@...omium.org>
Cc:     Tycho Andersen <tycho@...ho.ws>, linux-kselftest@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Alakesh Haloi <alakesh.haloi@...il.com>,
        shuah <shuah@...nel.org>
Subject: Re: [PATCH] selftests/seccomp: fix build on older kernels

On 8/29/19 11:06 AM, Kees Cook wrote:
> On Mon, Aug 26, 2019 at 08:43:02AM -0600, Tycho Andersen wrote:
>> The seccomp selftest goes to some length to build against older kernel
>> headers, viz. all the #ifdefs at the beginning of the file. 201766a20e30
>> ("ptrace: add PTRACE_GET_SYSCALL_INFO request") introduces some additional
>> macros, but doesn't do the #ifdef dance. Let's add that dance here to
>> avoid:
>>
>> gcc -Wl,-no-as-needed -Wall  seccomp_bpf.c -lpthread -o seccomp_bpf
>> In file included from seccomp_bpf.c:51:
>> seccomp_bpf.c: In function ‘tracer_ptrace’:
>> seccomp_bpf.c:1787: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:1787:2: note: in expansion of macro ‘EXPECT_EQ’
>>    EXPECT_EQ(entry ? PTRACE_EVENTMSG_SYSCALL_ENTRY
>>    ^~~~~~~~~
>> seccomp_bpf.c:1787: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:1787:2: note: in expansion of macro ‘EXPECT_EQ’
>>    EXPECT_EQ(entry ? PTRACE_EVENTMSG_SYSCALL_ENTRY
>>    ^~~~~~~~~
>> seccomp_bpf.c:1788:6: error: ‘PTRACE_EVENTMSG_SYSCALL_EXIT’ undeclared (first use in this function); did you mean ‘PTRACE_EVENT_EXIT’?
>>      : PTRACE_EVENTMSG_SYSCALL_EXIT, msg);
>>        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> ../kselftest_harness.h:608:13: note: in definition of macro ‘__EXPECT’
>>    __typeof__(_expected) __exp = (_expected); \
>>               ^~~~~~~~~
>> seccomp_bpf.c:1787:2: note: in expansion of macro ‘EXPECT_EQ’
>>    EXPECT_EQ(entry ? PTRACE_EVENTMSG_SYSCALL_ENTRY
>>    ^~~~~~~~~
>> make: *** [Makefile:12: seccomp_bpf] Error 1
>>
>> Signed-off-by: Tycho Andersen <tycho@...ho.ws>
>> Fixes: 201766a20e30 ("ptrace: add PTRACE_GET_SYSCALL_INFO request")
> 
> Acked-by: Kees Cook <keescook@...omium.org>
> 
> Alakesh Haloi also sent a fix[1] for this. I prefer Tycho's solution
> (one #ifndef and a Fixes line). Shuah, can you please apply this?
> 

Kees,

Yes I will pick this up.

thanks,
-- Shuah

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ