elf: Do not parse ill-formatted strings
commit680c597e9c363bc74d1495b08f7a0593a80f8921
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 6 Nov 2023 20:25:39 +0000 (6 17:25 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 21 Nov 2023 19:15:42 +0000 (21 16:15 -0300)
tree20c33ed76def53a76f9ff8520c043ffed79f4b95
parentb4cf6cac73725d988957410116ddf088546239ca
elf: Do not parse ill-formatted strings

Instead of ignoring ill-formatted tunable strings, first, check all the
tunable definitions are correct and then set each tunable value. It
means that partially invalid strings, like "key1=value1:key2=key2=value'
or 'key1=value':key2=value2=value2' do not enable 'key1=value1'. It
avoids possible user-defined errors in tunable definitions.

Checked on x86_64-linux-gnu.
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
elf/dl-tunables.c
elf/tst-tunables.c