[PATCH] elf: Make string tunables startup-only
Andreas Schwab
schwab@suse.de
Thu Jun 18 07:59:58 GMT 2026
On Jun 17 2026, Adhemerval Zanella wrote:
> @@ -460,6 +461,12 @@ __tunable_get_val (tunable_id_t id, void *valp, tunable_callback_t callback)
> }
> case TUNABLE_TYPE_STRING:
> {
> + /* String tunables reference the environment block and are only
> + valid during early startup; once sealed they must not be read. */
> + if (__glibc_unlikely (cur->sealed))
> + _dl_fatal_printf ("Inconsistency detected: trying to read the %s "
> + "string tunable after process initialization\n",
> + cur->name);
Why do you need the sealed member? Wouldn't it be enough to check for
NULL in strval?
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
More information about the Libc-alpha
mailing list