diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2017-12-30 10:54:23 +0100 |
---|---|---|
committer | Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com> | 2018-04-06 16:23:20 -0300 |
commit | 21c5d14bfb4e08bee86f94fd815535d3be2c3869 (patch) | |
tree | c5b4450b964d8c27f4d10bd680d6f2f4ced3c62d /iconvdata/ibm1160.h | |
parent | 9d0aec236891576c7f12e935128364669b785233 (diff) | |
download | glibc-21c5d14bfb4e08bee86f94fd815535d3be2c3869.tar glibc-21c5d14bfb4e08bee86f94fd815535d3be2c3869.tar.gz glibc-21c5d14bfb4e08bee86f94fd815535d3be2c3869.tar.bz2 glibc-21c5d14bfb4e08bee86f94fd815535d3be2c3869.zip |
elf: Check for empty tokens before dynamic string token expansion [BZ #22625]
The fillin_rpath function in elf/dl-load.c loops over each RPATH or
RUNPATH tokens and interprets empty tokens as the current directory
("./"). In practice the check for empty token is done *after* the
dynamic string token expansion. The expansion process can return an
empty string for the $ORIGIN token if __libc_enable_secure is set
or if the path of the binary can not be determined (/proc not mounted).
Fix that by moving the check for empty tokens before the dynamic string
token expansion. In addition, check for NULL pointer or empty strings
return by expand_dynamic_string_token.
The above changes highlighted a bug in decompose_rpath, an empty array
is represented by the first element being NULL at the fillin_rpath
level, but by using a -1 pointer in decompose_rpath and other functions.
Changelog:
[BZ #22625]
* elf/dl-load.c (fillin_rpath): Check for empty tokens before dynamic
string token expansion. Check for NULL pointer or empty string possibly
returned by expand_dynamic_string_token.
(decompose_rpath): Check for empty path after dynamic string
token expansion.
(cherry picked from commit 3e3c904daef69b8bf7d5cc07f793c9f07c3553ef)
Diffstat (limited to 'iconvdata/ibm1160.h')
0 files changed, 0 insertions, 0 deletions