qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Fix hang with -L and symlink loop


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] Fix hang with -L and symlink loop
Date: Thu, 31 May 2018 16:26:20 +0100

On 30 May 2018 at 21:50, Richard Henderson <address@hidden> wrote:
> On 05/29/2018 04:44 PM, Evan Green wrote:
>> When using -L with Linux app emulation, there is an issue in
>> init_paths where Qemu will get lost exploring a directory tree
>> with a symlink loop in it. This causes Qemu to hang, and
>> eventually consume all memory in the system.
>>
>> Qemu's code for pre-exploring the entire directory tree is both
>> error-prone and slow. Instead, this changes uses faccessat, which
>> both avoids the symlink loop (since the entire directory space isn't
>> being explored up front), and likely speeds things up a bit.
>>
>> Partial credit goes to Richard Henderson, as it was only after staring
>> at his patch [1] that I wrote mine.
>>
>> [1] https://patchwork.kernel.org/patch/9512083/
>>
>> Signed-off-by: Evan Green <address@hidden>
>> ---
>
> I like this as an improvement on the current situation.
> Perhaps folks do like this a bit better than my more invasive patch.

It seems to me to have the same problem as your patch does,
which is that we now have a file descriptor which belongs
not to the guest but to QEMU, but we make no effort to
hide it from the guest, and so for instance code like that
xinetd "close every fd above 2" loop will break us.

This probably is overall better than the current situation,
though, since it will only kick in if you use -L. But if we're
going to fix this, I think I preferred your patch.

thanks
-- PMM



reply via email to

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