[1/3] elf/dl-open: fix audit wrt RTLD_NOLOAD [BZ #30127]
Checks
Context |
Check |
Description |
dj/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
Commit Message
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(-)
@@ -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()"));