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: <CANXV_XzktootzRkRSWVCgBTUOdS5eOxKZyGV3w+uMYO1uAavKg@mail.gmail.com>
Date: Thu, 21 Mar 2024 22:50:51 +0300
From: Dmitrii Bundin <dmitrii.bundin.a@...il.com>
To: Khazhy Kumykov <khazhy@...omium.org>
Cc: Alexei Starovoitov <alexei.starovoitov@...il.com>, LKML <linux-kernel@...r.kernel.org>, 
	Daniel Xu <dxu@...uu.xyz>, Viktor Malik <vmalik@...hat.com>, Alexei Starovoitov <ast@...nel.org>, 
	Andrii Nakryiko <andrii@...nel.org>, Nick Desaulniers <ndesaulniers@...gle.com>
Subject: Re: [PATCH] tools/resolve_btfids: Include linux/types.h

On Mon, Mar 18, 2024 at 7:56 PM Khazhy Kumykov <khazhy@...omium.org> wrote:
> I'm also seeing this, on clang.

I think the error is more related to the libc version. I updated the
libc6 to 2.35 and noticed that the <linux/types.h> header is included
indirectly through <sys/stat.h>. The relevant sample of the include
hierarchy for <sys/stat.h> with libc6 v2.35 looks as follows:

 /usr/include/x86_64-linux-gnu/sys/stat.h
. /usr/include/x86_64-linux-gnu/bits/stat.h
.. /usr/include/x86_64-linux-gnu/bits/struct_stat.h
. /usr/include/x86_64-linux-gnu/bits/statx.h
.. /linux/tools/include/uapi/linux/stat.h
... /linux/tools/include/linux/types.h

The <linux/types.h> is included on the latest line of the sample.
Starting the version 2.28 there's an inclusion of <bits/statx.h> which
was not presented in 2.27.

When building the resolve_btfids with the libc6 version 2.27
<linux/types.h> is not included through <sys/stat.h>. The include
hierarchy for <sys/stat.h> with libc6 v2.27 looks as follows:

 /usr/include/x86_64-linux-gnu/sys/stat.h
. /usr/include/x86_64-linux-gnu/bits/stat.h
 /usr/include/fcntl.h

To avoid being dependent on the inclusion of <linux/types.h> at some
other place it looks reasonable to include it explicitly to bring all
the necessary declarations before their usage.

What do you think?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ