[PATCH 0/2] Make tunable a default feature
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Wed Mar 22 17:58:02 GMT 2023
On 22/03/23 12:21, Siddhesh Poyarekar wrote:
> On 2023-03-22 10:40, Adhemerval Zanella Netto wrote:
>>
>>
>> On 20/03/23 20:15, Siddhesh Poyarekar wrote:
>>> On 2023-03-20 12:59, Adhemerval Zanella Netto wrote:
>>>> I think it might make sense for tunables that change the program semantic, such
>>>> as security hardening; although I don't think it really fits for performance
>>>> oriented ones (such malloc or pthread tuning). So maybe we can define a global
>>>
>>> Administrative level performance tuning defaults for setuid binaries?
>>
>> I was thinking more of opt-in security features (such as mte_state on aarch64),
>> although it might fit better on some ABI extension (such as done by cet).
>
> Yeah, that too.
>
>>>> file format where the administrator can set where setuid binaries can use it,
>>>> and if uses can overwrite it. My initial idea would be something quite simple,
>>>> similar to sysctl.conf:
>>>
>>> Yes, I think Florian suggested reusing ld.so.conf instead. I don't have a strong preference either way so y'all can fight that one out - potato potato ;)
>>
>> Did he mean add the tunable information on ld.so.conf or using a similar scheme
>> where the file is preprocessed by a tool so loader can just mmap a file without
>> the need any parsing?
>>
>> For later, I don't have a strong opinion. I assume that a global tunable won't
>> be a default configuration, like loader cache; and parsing should really easy
>> (it a ini like file).
>
> Just the former IIRC, i.e. extending ld.so.conf to add a section for systemwide tunables.
I am not very found of mixing too different libc facilities in the same config
file and the syntax won't be the same and there are two different
>
>>>
>>>> And I was thinking about an DF_1_NODEFLIB analogous so the program can opt-out
>>>> any performance or behavior difference any tunable might incur. Although with
>>>> your idea of enforceable tunable, I think it does not make much sense.
>>>
>>> Yeah an ELF flag to override all tunables seems counter to the whole idea, but ELF flags to override specific tunables may make sense. E.g. memory tagging enabled by default in the system and a program built with DF_NO_MEMTAG overrides that systemwide setting.
>>
>> The issue of a per-tunable flag is it will require to settle a minimum ABI for
>> tunable, or adding a ELF extension with a string blob that is only understable
>> by an specific glibc version. I am not sure, maybe we can it only if required.
>
> We shouldn't need a flag for *every* tunable, only those that would have practical benefit from having ELF overrides, e.g. those that control architecture-specific features.
>
> That is, the ELF flag should not be tied to a tunable, but a tunable could change behaviour based on an ELF flag.
I think it might be an option if the flag is opaque to ELF itself, like a string
that glibc would parse. But I don't have a strong preference.
I still think the simplest solution would to have a textual glibc-tunables.conf
similar to sysctl.conf.
More information about the Libc-alpha
mailing list