[PATCH v5 4/4] Add system-wide tunables: Filters

Yury Khrustalev yury.khrustalev@arm.com
Tue Feb 17 15:08:15 GMT 2026


On Tue, Feb 10, 2026 at 11:33:51PM -0500, DJ Delorie wrote:
> 
> Add support for [proc:*] syntax where * matches /proc/self/exe
> (fallback: argv[0]).  Tunables after such a line are limited to
> matching processes.
> 
> Note that this filter is reset when including a file or at
> end of file.
> 
> If the filename starts with a slash (example: [proc:/bin/foo]) the
> full path must match.  If not (example: [proc:foo]) the basename is
> matched.

> ...
>
> diff --git a/csu/libc-start.c b/csu/libc-start.c
> index 1c58561bce..ae36170045 100644
> --- a/csu/libc-start.c
> +++ b/csu/libc-start.c

OK

> ...
>
> diff --git a/elf/Makefile b/elf/Makefile
> index 282af88e71..b407e9e761 100644
> --- a/elf/Makefile
> +++ b/elf/Makefile
> @@ -329,6 +329,7 @@ tests-internal := \
>    $(tests-static-internal) \
>    tst-tls1 \
>    tst-tls_tp_offset \
> +  tst-tunconf1 \

What about static executables? I tried adding the same test in static
form and of course it doesn't work :)

> ...
>
> diff --git a/elf/cache.c b/elf/cache.c
> index e798f7e2d8..2809f255f5 100644
> --- a/elf/cache.c
> +++ b/elf/cache.c

OK

> ...
>
> diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c
> index 83808f75e7..4637f47875 100644
> --- a/elf/dl-tunables.c
> +++ b/elf/dl-tunables.c

OK

> +
> +	skip_due_to_filter:
>  	}
>      }
>  #endif

Nit: add // #if ... after #endif

> ...
>
> diff --git a/elf/dl-tunables.h b/elf/dl-tunables.h
> index 45aeed47bc..3f34329614 100644
> --- a/elf/dl-tunables.h
> +++ b/elf/dl-tunables.h

OK

> ...
>
> diff --git a/elf/tst-tunconf1.c b/elf/tst-tunconf1.c
> new file mode 100644
> index 0000000000..c95a7cb8ba
> --- /dev/null
> +++ b/elf/tst-tunconf1.c

OK

> ...
>
> diff --git a/elf/tst-tunconf1.root/etc/tunables.conf b/elf/tst-tunconf1.root/etc/tunables.conf
> new file mode 100644
> index 0000000000..3c7b33c399
> --- /dev/null
> +++ b/elf/tst-tunconf1.root/etc/tunables.conf

OK

> ...
>
> diff --git a/elf/tst-tunconf1.root/ldconfig.run b/elf/tst-tunconf1.root/ldconfig.run
> new file mode 100644
> index 0000000000..e69de29bb2

OK

> diff --git a/elf/tst-tunconf1.root/postclean.req b/elf/tst-tunconf1.root/postclean.req
> new file mode 100644
> index 0000000000..e69de29bb2

OK

> diff --git a/elf/tunconf.c b/elf/tunconf.c
> index ea547e95d5..cb26d47816 100644
> --- a/elf/tunconf.c
> +++ b/elf/tunconf.c

OK but we need more tests.

> ...
>
> diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
> index 0e348d6440..fe6d453756 100644
> --- a/sysdeps/mach/hurd/dl-sysdep.c
> +++ b/sysdeps/mach/hurd/dl-sysdep.c

OK

> ...
>
> diff --git a/sysdeps/unix/sysv/linux/dl-sysdep.c b/sysdeps/unix/sysv/linux/dl-sysdep.c
> index cb1f94ee23..c2701f274c 100644
> --- a/sysdeps/unix/sysv/linux/dl-sysdep.c
> +++ b/sysdeps/unix/sysv/linux/dl-sysdep.c

OK



More information about the Libc-alpha mailing list