[PATCH] elf: Add la_objsearch2 with lmid parameter for rtld-audit [BZ #34093]
DJ Delorie
dj@redhat.com
Wed Sep 23 20:27:26 GMT 2026
On Wed, Sep 23, 2026 at 3:55 PM Adhemerval Zanella Netto
<adhemerval.zanella@linaro.org> wrote:
> Right, but then you move the version check from glibc to the audit
> module itself. I am not sure if this is a better semantic.
I think there's a couple of scenarios to consider:
1. Existing auditors will request the old LAV_CURRENT (say, 2). New
glibc will need to support that version. sysdeps/generic has the
right logic, but aarch64 and loongarch will need a range check
(currently they use ==) since the previous version is incompatible.
2. A new auditor that allows but does not require the new function can
return the OLD version (LAV_CURRENT-1) and dynamically adapt to
whatever callbacks happen.
3. An auditor requires the new callback, is built with the new
headers, and will fail to load on old glibc's.
4. A new auditor wants the old callback, but builds with the new
LAV_CURRENT.
I think bumping LAV_CURRENT will work in all cases. Not bumping it
works for 1 and 2 but not 3.
Case 4 requires glibc internals to detect which is requested, which
Fred's patch does.
Case 2 is more flexible for auditor deployers but is trickier to code,
especially as the LAV_CURRENT values are inconsistent across targets.
The only time we MUST bump LAV_CURRENT is when an existing callback
changes in a way that breaks existing auditors.
More information about the Libc-alpha
mailing list