Re: [PATCH 04/16] elf, uapi: Add definitions for VER_FLG_BASE and VER_FLG_WEAK

From: Kees Cook
Date: Tue Feb 04 2025 - 10:32:24 EST


On Tue, Feb 04, 2025 at 04:17:03PM +0100, Thomas Weißschuh wrote:
> On Tue, Feb 04, 2025 at 07:10:00AM -0800, Kees Cook wrote:
> > On Mon, Feb 03, 2025 at 10:05:05AM +0100, Thomas Weißschuh wrote:
> > > The definitions are used by tools/testing/selftests/vDSO/parse_vdso.c.
> > > To be able to build the vDSO selftests without a libc dependency,
> > > add the definitions to the kernels own UAPI headers.
> >
> > For all the UAPI changes, where are the defines "normally" found? i.e.
> > how does adding these to UAPI not break something that already has them?
> > Or have these never been defined before? I'm confused about how removing
> > the libc dependency exposes the lack of these defines. Are they defined
> > in a non-exported libc header somewhere?
>
> They are normally defined directly in libc <elf.h>, which does not use
> UAPI headers. Libc elf.h and Linux UAPI elf.h can not be used at the
> same time because they define the same symbols.
> In theory some user of UAPI elf.h could have defined these new symbols
> on their own without ifdef guards. However UAPI elf.h is regularly
> updated with new symbols.

Okay, great. As long as the collision risk is low, I'm fine with all the
UAPI additions. Thanks for doing this!

--
Kees Cook