summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorLeonid Lisovskiy <lly.dev@gmail.com>2016-01-26 20:12:57 +0300
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-01-31 17:41:13 +0100
commitd6d36639c6a5dffbcdb77e947aafd1e858bbb714 (patch)
tree469b1367b447936a23b03fe07d9fcdf2a86ee374 /ldso
parentfb6a51ed43626cb16bda3d75b28b26cfb1449e52 (diff)
ldso: Fix fail of $ORIGIN expansion in case of RTLD_NOLOAD
$ORIGIN expansion in search_for_named_library() wrongly takes into account all bits of rflags. Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
Diffstat (limited to 'ldso')
-rw-r--r--ldso/ldso/dl-elf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 01b29da29..5b8572a8f 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -162,7 +162,9 @@ search_for_named_library(const char *name, unsigned rflags, const char *path_lis
if (plen >= 7 && _dl_memcmp(p, "$ORIGIN", 7) == 0) {
int olen;
- if (rflags && plen != 7)
+ /* $ORIGIN is not expanded for SUID/GUID programs
+ (except if it is $ORIGIN alone) */
+ if ((rflags & DL_RESOLVE_SECURE) && plen != 7)
continue;
if (origin == NULL)
continue;