qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] util/path: Always translate /etc/ld.so.cache


From: Andrey Smirnov
Subject: Re: [Qemu-devel] [PATCH] util/path: Always translate /etc/ld.so.cache
Date: Fri, 27 Jan 2017 12:15:19 -0800

On Fri, Jan 27, 2017 at 10:53 AM, Peter Maydell
<address@hidden> wrote:
> On 27 January 2017 at 18:31, Andrey Smirnov <address@hidden> wrote:
>> Always translate /etc/ld.so.cache to point somwhere inside of guest's
>> filesystem tree pointed to by 'prefix'. This prevents guest's libc from
>> reading /etc/ld.so.cache of the host and potentialy failing. One of the
>> manifestation of the problem could be easily reproduced by executing and
>> simple application compiled for PowerPC on a x86 host using
>> linux-use/qemu-ppc emulation.
>>
>> Anything as simple as:
>>
>>          qemu-ppc -L <prefix> <prefix>/bin/ls
>>
>> should trigger the problem.
>>
>> Signed-off-by: Andrey Smirnov <address@hidden>
>
> Have you tested that this doesn't cause execution inside a chroot
> to behave wrongly (in a chroot, the host fs /etc/ld.so.cache is
> definitely the one you want to use) ?

No, I have not. I'll go back and do more homework. Just to make sure
that my assumptions are correct, I consider "qemu-ppc -L<foo>" and
"chroot <foo> qemu-ppc" to be the only use-cases supported, and
"chroot <foo> qemu-ppc -L <bar>" is not something that is expected to
work correctly. Is that a correct assumption to make?

>
> (glibc really ought to fix their ld.so.cache reading bugs.)
>

I agree. I am planning on taking a look at the glibc side of things to
see if there's a simple way to fix the problem there, but in the
meantime I thought it would be good to float this patch and get some
feedback.

Cheers!

Andrey Smirnov



reply via email to

[Prev in Thread] Current Thread [Next in Thread]