public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* RFC: system-wide default tunables
@ 2023-10-04 20:55 DJ Delorie
  2023-10-06 14:44 ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 20+ messages in thread
From: DJ Delorie @ 2023-10-04 20:55 UTC (permalink / raw)
  To: libc-alpha


Before I start on actual coding, I'm sharing my thoughts on this
project to gain consensus...

Problem: tunables are set by an environment variable, and may be
limited by security settings, containerization, etc.  Plus users may
not assume that the env var is pre-set, and just overwrite it.

Solution: Add a way to specify system-wide defaults for tunables.

Ideas:

* Specify some file or files in /etc that contain tunables settings.
  Follow the ld.so.conf patterns, allow subdirectories, etc.

* Store tunables info in /etc/ld.so.cache in a new slot at the end,
  with a new enum for the chunk.  This way older glibc will just
  ignore it.  Parsing and storing will be done via ldconfig.

* Values in ld.so.cache will be parsed but not range checked; that's
  dependent on what the glibc app expects.

* read those, do range checking, and call callbacks at runtime

* To speed processing, encode a hash for each tunable name, both in
  glibc's table (which is built at glibc build time) and in
  /etc/ld.so.cache.  Comparing the hash typically fails but avoids a
  string compare.  Matching hashes are followed by a string compare to
  verify.  The hash need not be crypographically secure.

* I'm not going to try to add some "syntax" to specify if a tunable is
  overridable or not; this is a simple default-only change.

* Tunables set by these defaults will not be disabled for setuid
  programs; it's assumed they're a "trusted source".


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2023-10-18 14:20 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-04 20:55 RFC: system-wide default tunables DJ Delorie
2023-10-06 14:44 ` Adhemerval Zanella Netto
2023-10-06 17:12   ` Adhemerval Zanella Netto
2023-10-06 18:29   ` DJ Delorie
2023-10-06 19:14     ` Adhemerval Zanella Netto
2023-10-06 20:25       ` DJ Delorie
2023-10-17 14:10         ` Adhemerval Zanella Netto
2023-10-17 14:17           ` Siddhesh Poyarekar
2023-10-17 14:37             ` Siddhesh Poyarekar
2023-10-17 15:43             ` DJ Delorie
2023-10-17 15:58               ` Siddhesh Poyarekar
2023-10-17 16:45             ` DJ Delorie
2023-10-17 16:55               ` Siddhesh Poyarekar
2023-10-17 17:14                 ` DJ Delorie
2023-10-18 14:20                   ` Siddhesh Poyarekar
2023-10-17 17:40           ` Zack Weinberg
2023-10-17 17:47             ` DJ Delorie
2023-10-17 18:17               ` Zack Weinberg
2023-10-17 18:21                 ` DJ Delorie
2023-10-06 22:04       ` DJ Delorie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).