[PATCH v5 3/4] Add system-wide tunables: Apply tunables part

DJ Delorie dj@redhat.com
Wed Mar 11 20:12:28 GMT 2026


[saw this in my unsent bucket, sorry for the delay, some answers may be
obsolete by now]

Yury Khrustalev <yury.khrustalev@arm.com> writes:
> On Wed, Feb 21, 2024 at 06:49:50PM -0500, DJ Delorie wrote:
>> 
>> Load ld.so.cache and fetch the tunables extension.  Apply
>> those tunables to the current program.  We do not yet apply
>> security policies.
>
> By "security policies" do you mean "filtering" or something else?

I mean the !+- syntax in the config file which would normally prevent
the environment variable from overriding the global setting.

Filtering is in patch 4/4

>>  dl-routines += dl-cache
>> +CFLAGS-dl-tunables.c += -DUSE_LDCONFIG
>
> Shouldn't this be already present in the flags? At least it works without
> this line.

Agreed; IIRC it did not work back when I first wrote the patch.

>> +  if (cache_new && cache_new != (void *) -1)
>
> Can cache_new ever be (void *) -1? Do you mean MAP_FAILED?

No, I check for MAP_FAILED elsewhere.  I removed this check, I don't
think it can ever be -1.

>> --- a/elf/dl-tunables.c
>> +++ b/elf/dl-tunables.c
>
> This seems OK but it needs some good tests to check what happens if the
> tunables in the config file mismatch tunables supported by this Glibc.

What kinds of mismatches?  I mean, the right answer is "all" but I meant
what you were thinking of.  Generating a cache file that has, for
example, a mismatched ID might be tricky since we're always using the
matching ldconfig.

> Nit: probably add
>
>   // #if defined(SHARED) && defined (USE_LDCONFIG)

Added.



More information about the Libc-alpha mailing list