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: <c5e41f55-4f9e-81a3-2d45-befddee42d13@163.com>
Date:   Wed, 13 Nov 2019 11:44:59 +0800
From:   Xiao Yang <ice_yangxiao@....com>
To:     Daniel Borkmann <daniel@...earbox.net>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Will Deacon <will@...nel.org>
Cc:     linux-arch <linux-arch@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Alexei Starovoitov <ast@...nel.org>
Subject: Re: Question about "asm/rwonce.h: No such file or directory"

On 11/12/19 11:13 PM, Daniel Borkmann wrote:
> On 11/12/19 1:50 PM, Masahiro Yamada wrote:
>> On Tue, Nov 12, 2019 at 9:31 PM Will Deacon <will@...nel.org> wrote:
>>>
>>> [+lkml, Masahiro, Alexei and Daniel]
>>>
>>> On Tue, Nov 12, 2019 at 04:56:39PM +0800, Xiao Yang wrote:
>>>> With your patch[1], I alway get the following error when building
>>>> tools/bpf:
>>>
>>> In case people want to reproduce this, my branch is here:
>>>
>>> https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/log/?h=lto 
>>>
>>>
>>>> ---------------------------------------------------------------------------------- 
>>>>
>>>>
>>>> make -C tools/bpf/
>>>> make: Entering directory
>>>> '/usr/src/perf_selftests-x86_64-rhel-7.6-642a312d47ceb54603630d9d04f5052f3b46d9a3/tools/bpf' 
>>>>
>>>>
>>>> Auto-detecting system features:
>>>> ... libbfd: [ on ]
>>>> ... disassembler-four-args: [ OFF ]
>>>>
>>>> CC bpf_jit_disasm.o
>>>> CC bpf_dbg.o
>>>> In file included from
>>>> /usr/src/perf_selftests-x86_64-rhel-7.6-642a312d47ceb54603630d9d04f5052f3b46d9a3/include/uapi/linux/filter.h:9:0, 
>>>>
>>>> from
>>>> /usr/src/perf_selftests-x86_64-rhel-7.6-642a312d47ceb54603630d9d04f5052f3b46d9a3/tools/bpf/bpf_dbg.c:41: 
>>>>
>>>> /usr/src/perf_selftests-x86_64-rhel-7.6-642a312d47ceb54603630d9d04f5052f3b46d9a3/include/linux/compiler.h:247:24: 
>>>>
>>>> fatal error: asm/rwonce.h: No such file or directory
>>>> #include <asm/rwonce.h>
>>>> ^
>>>> compilation terminated.
>>>> Makefile:61: recipe for target 'bpf_dbg.o' failed
>>>> make: *** [bpf_dbg.o] Error 1
>>>> make: *** Waiting for unfinished jobs....
>>>> make: Leaving directory
>>>>
>>>> ---------------------------------------------------------------------------------- 
>>>>
>>>>
>>>> [1] 
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/commit/?h=lto&id=642a312d47ceb54603630d9d04f5052f3b46d9a3
>>>>
>>>> It seems that include/linux/compiler.h cannot find the asm/rwonce.h 
>>>> because
>>>> tools/bpf/Makefile doesn't include 
>>>> arch/*/include/generated/asm/rwonce.h.
>>>
>>> The problem with referring to the generated files is that they don't 
>>> exist
>>> unless you've configured the main source directory. The real problem 
>>> here
>>> seems to be that tools/bpf/ refers directly to header files in the 
>>> kernel
>>> sources without any understanding of kbuild, and therefore mandatory-y
>>> headers simply don't exist when it goes looking for them.
>
> Hmm, I am puzzled why that is. :/ I think there are two options, i) 
> remove it
> from CFLAGS like below (at least this doesn't let the build fail in my 
> case
> but requires linux headers to be installed) or ii) add a copy of 
> filter.h to
> tools/include/uapi/linux/filter.h so the few tools can just reuse it. 
> We do have
> bpf_common.h and bpf.h there already.

Hi Daniel,


Thanks for your suggestions.

Did you mean that building bpf uses the filter.h from installed linux 
header rather than include/uapi/linux/filter.h in kernel?

It seems that you just try to workaround the issue by using 
linux/filter.h from linux header.

The root casue is that include/linux/compiler.h cannot find the location 
of <asm/rwonce.h>.


Thanks,

Xiao Yang

>
> diff --git a/tools/bpf/Makefile b/tools/bpf/Makefile
> index 5d1995fd369c..08dfd289174c 100644
> --- a/tools/bpf/Makefile
> +++ b/tools/bpf/Makefile
> @@ -10,7 +10,6 @@ MAKE = make
>  INSTALL ?= install
>
>  CFLAGS += -Wall -O2
> -CFLAGS += -D__EXPORTED_HEADERS__ -I$(srctree)/include/uapi 
> -I$(srctree)/include
>
>  # This will work when bpf is built in tools env. where srctree
>  # isn't set and when invoked from selftests build, where srctree
>
> Thanks,
> Daniel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ