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: <1eed08d1-c100-6ca5-63f3-73487970b08e@linuxfoundation.org>
Date:   Tue, 17 Jan 2023 12:11:30 -0700
From:   Shuah Khan <skhan@...uxfoundation.org>
To:     Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        Ingo Molnar <mingo@...nel.org>
Cc:     kernel test robot <lkp@...el.com>, Shuah Khan <shuah@...nel.org>,
        oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
        x86@...nel.org, Peter Zijlstra <peterz@...radead.org>,
        linux-kselftest@...r.kernel.org,
        Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [tip:sched/core 7/28] rseq.c:139:37: error: 'AT_RSEQ_ALIGN'
 undeclared; did you mean 'R_SH_ALIGN'?

On 1/17/23 10:44, Mathieu Desnoyers wrote:
> On 2023-01-17 04:06, Ingo Molnar wrote:
>>
>> * Shuah Khan <skhan@...uxfoundation.org> wrote:
>>
>>> On 1/16/23 13:18, Mathieu Desnoyers wrote:
>>>> On 2023-01-16 14:40, kernel test robot wrote:
>>>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core
>>>>> head:   79ba1e607d68178db7d3fe4f6a4aa38f06805e7b
>>>>> commit: 03f5c0272d1b59343144e199becc911dae52c37e [7/28] selftests/rseq: Use ELF auxiliary vector for extensible rseq
>>>>> compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
>>>>> reproduce:
>>>>>           # https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=03f5c0272d1b59343144e199becc911dae52c37e
>>>>>           git remote add tip https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
>>>>>           git fetch --no-tags tip sched/core
>>>>>           git checkout 03f5c0272d1b59343144e199becc911dae52c37e
>>>>>           make O=/tmp/kselftest headers
>>>>>           make O=/tmp/kselftest -C tools/testing/selftests
>>>>>
>>>>> If you fix the issue, kindly add following tag where applicable
>>>>> | Reported-by: kernel test robot <lkp@...el.com>
>>>>
>>>> In order to fix this, I need to change -I../../../../usr/include/ for $(KHDR_INCLUDES) in tools/testing/selftests/rseq/Makefile
>>>>
>>>> I can find 25 odd uses of the same pattern in the kernel selftests. Should I fix them all in one go ?
>>>
>>> kselftest build depends on headers installed in the root directory.
> 
> By "root directory", do you mean kernel sources root directory or build output root directory ?
> 
>>> The main makefile enforces this dependency.
> 
> How ? I figure that tools/testing/selftests/lib.mk overrides KHDR_INCLUDES if it is not defined yet:
> 
> ifeq ($(KHDR_INCLUDES),)
> KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include
> endif
> 
> and selftests makefiles include ../lib.mk.
> 
> This KHDR_INCLUDES can be modified by O=... when built from the kernel top level, thus using tools/testing/selftests/Makefile:
> 
> ifneq ($(KBUILD_OUTPUT),)
> [...]
>    KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include
> else
> [...]
>    KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include
> endif
> 
> But it's up to the individual selftests to actually use $(KHDR_INCLUDES). In many cases, they hardcode -I../../../../usr/include/ which is bogus when the build root (O=...) differs from the source root.
> 
>   If this test is being
>>> built without installing headers by itself, I think the scripts that
>>> build individual tests have to makes sure headers are installed first.
> 
> The headers were previously built by "make O=/tmp/kselftest headers", as it should, it's just that the selftest makefile uses a hardcoded path that is relative to the source directory, and it appears that this pattern is repeated all across the selftests.
> 

selftests Makefile used to install headers and there has been a recent
change to have mani Makefile (root) to install it. As a result individual
test builds (running make in the test directory) requires header install
now.

I think the hard-coded includes are a problem and we have to fix them for
all cases i.e make O=, individual test builds.

If you are still up for it, please send patch.

thanks,
-- Shuah

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ