[PATCH 1/3] elf/dl-open: fix audit wrt RTLD_NOLOAD [BZ #30127]
Stas Sergeev
stsp2@yandex.ru
Thu Mar 2 19:40:49 GMT 2023
Currently dlmopen() does not allow to load objects into an audit
namespace. But the RTLD_NOLOAD case was forgotten, so the too
restrictive check prevents even getting a handle for an objects
in an audit namespace.
This patch fixes the problem by relaxing a check in case of
RTLD_NOLOAD.
Test-case on x86_64 revealed no regressions.
Signed-off-by: Stas Sergeev <stsp2@yandex.ru>
---
elf/dl-open.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 91a2d8a538..c7ce0396d3 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -864,7 +864,8 @@ no more namespaces available for dlmopen()"));
DL_NNS is 1 and so any NSID != 0 is invalid. */
|| DL_NNS == 1
|| GL(dl_ns)[nsid]._ns_nloaded == 0
- || GL(dl_ns)[nsid]._ns_loaded->l_auditing))
+ || (GL(dl_ns)[nsid]._ns_loaded->l_auditing &&
+ !(mode & RTLD_NOLOAD))))
_dl_signal_error (EINVAL, file, NULL,
N_("invalid target namespace in dlmopen()"));
--
2.37.2
More information about the Libc-alpha
mailing list