[PATCH v2] dlfcn: Add dlinfo request type RTLD_DI_ORIGIN_PATH (bug #24298)
Florian Weimer
fweimer@redhat.com
Fri Jan 16 15:54:51 GMT 2026
* Arjun Shankar:
> The existing dlinfo request type RTLD_DI_ORIGIN used for querying the
> value of the '$ORIGIN' dynamic string token is prone to buffer
> overflows.
>
> This commit adds a new request type named RTLD_DI_ORIGIN_PATH that
> returns a pointer to the dynamic string token (i.e. the 'l_origin' field
> in the link map) instead. The dlinfo manual is updated with the new
> request type, and the description of RTLD_DI_ORIGIN is updated to
> recommend RTLD_DI_ORIGIN_PATH instead.
>
> A test for the new request type is also added to tst-dlinfo.
> ---
> v1: https://inbox.sourceware.org/libc-alpha/20260116141039.3823661-1-arjun@redhat.com/
> Changes in v2: Addressed Florian's review comments on the manual change:
> * Mention that the function returns 0 even when the result is NULL.
> * Recommend RTLD_DI_ORIGIN_PATH in the description of RTLD_DI_ORIGIN.
This version looks okay to me.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
However, I believe that this is glibc 2.44 material at this point.
Thanks,
Florian
More information about the Libc-alpha
mailing list