* elf/dl-load.c (open_path): avoid writing to 'env_path_list' when none of the search directories exist.
Commit Message
From: Bram <bug_rh@spam.wizbit.be>
---
This patch was submitted to BZ#15378 over a year ago. I have an Arch Linux
user running into this bug who confirms the patch fixes their issues.
ChangeLog:
2014-10-xx Bram <bug_rh@spam.wizbit.be>
[BZ #15378]
* elf/dl-load.c (open_path): Avoid writing to 'env_path_list'
when none of the search directories exist.
elf/dl-load.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
On Mon, Oct 13, 2014 at 10:07:26AM +1000, Allan McRae wrote:
> From: Bram <bug_rh@spam.wizbit.be>
>
> ---
>
> This patch was submitted to BZ#15378 over a year ago. I have an Arch Linux
> user running into this bug who confirms the patch fixes their issues.
>
> ChangeLog:
>
> 2014-10-xx Bram <bug_rh@spam.wizbit.be>
>
> [BZ #15378]
> * elf/dl-load.c (open_path): Avoid writing to 'env_path_list'
> when none of the search directories exist.
Fix looks OK, but maybe you could add a test case as well.
Siddhesh
On 13/10/14 16:02, Siddhesh Poyarekar wrote:
> On Mon, Oct 13, 2014 at 10:07:26AM +1000, Allan McRae wrote:
>> From: Bram <bug_rh@spam.wizbit.be>
>>
>> ---
>>
>> This patch was submitted to BZ#15378 over a year ago. I have an Arch Linux
>> user running into this bug who confirms the patch fixes their issues.
>>
>> ChangeLog:
>>
>> 2014-10-xx Bram <bug_rh@spam.wizbit.be>
>>
>> [BZ #15378]
>> * elf/dl-load.c (open_path): Avoid writing to 'env_path_list'
>> when none of the search directories exist.
>
> Fix looks OK, but maybe you could add a test case as well.
>
I have come to the conclusion that I have no idea how to write a test
case for this issue. Can anyone point me in the right direction?
Allan
On Thu, Dec 18, 2014 at 01:13:03PM +1000, Allan McRae wrote:
> I have come to the conclusion that I have no idea how to write a test
> case for this issue. Can anyone point me in the right direction?
The bug report seems to have steps to reproduce the problem. Is it
not possible to use them to write a test case?
Siddhesh
On Wed, 31 Dec 2014 15:23:29 +0530
Siddhesh Poyarekar <siddhesh@redhat.com> wrote:
> On Thu, Dec 18, 2014 at 01:13:03PM +1000, Allan McRae wrote:
> > I have come to the conclusion that I have no idea how to write a
> > test case for this issue. Can anyone point me in the right
> > direction?
>
> The bug report seems to have steps to reproduce the problem. Is it
> not possible to use them to write a test case?
I gave this a shot and it looks fairly difficult to incorporate the
test into the testsuite. The test needs a custom rpath as well as to
be invoked with a custom --library-path that points to a non-existent
directory. Such a change is not suitable for the freeze and I don't
think it is worth blocking for this fix either. I'm OK with this patch
going in without a test.
Siddhesh
@@ -1897,9 +1897,9 @@ open_path (const char *name, size_t namelen, int mode,
if (sps->malloced)
free (sps->dirs);
- /* rtld_search_dirs is attribute_relro, therefore avoid writing
- into it. */
- if (sps != &rtld_search_dirs)
+ /* rtld_search_dirs and env_path_list are attribute_relro, therefore
+ avoid writing into it. */
+ if (sps != &rtld_search_dirs && sps != &env_path_list)
sps->dirs = (void *) -1;
}