* [Qemu-devel] elf interpreter prefix scanning can get stuck in a loop
@ 2004-12-18 22:09 Lennert Buytenhek
2004-12-20 5:23 ` Karl Magdsick
0 siblings, 1 reply; 2+ messages in thread
From: Lennert Buytenhek @ 2004-12-18 22:09 UTC (permalink / raw)
To: qemu-devel
Hi,
init_paths() seems to be able to get stuck in an 'infinite' loop. For
example when encountering a '.' symlink:
open("/data/fc2/arm/root/usr/include/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/asm-generic", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 27
I'd suggest to always skip symlinks but that doesn't seem like the right
thing to do..
--L
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] elf interpreter prefix scanning can get stuck in a loop
2004-12-18 22:09 [Qemu-devel] elf interpreter prefix scanning can get stuck in a loop Lennert Buytenhek
@ 2004-12-20 5:23 ` Karl Magdsick
0 siblings, 0 replies; 2+ messages in thread
From: Karl Magdsick @ 2004-12-20 5:23 UTC (permalink / raw)
To: qemu-devel
Under Linux (or maybe it's inside bash), there is a hard-coded limit
to the maximum number of symlinks to be followed in any path. I've
hit this limit before, but I'm not sure what it is. A maximum symlink
count sounds like a quick-and dirty way to prevent infinite recursion.
The limit I hit seemed too restrictive, but something around 256
symlink traversals seems reasonable. Once you've followed 256
symlinks, it's a fair bet that something is wrong. The limit I hit
seemed to be in the neighborhood of 10.
-Karl
On Sat, 18 Dec 2004 23:09:03 +0100, Lennert Buytenhek
<buytenh@wantstofly.org> wrote:
> Hi,
>
> init_paths() seems to be able to get stuck in an 'infinite' loop. For
> example when encountering a '.' symlink:
>
> open("/data/fc2/arm/root/usr/include/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/beecrypt/asm-generic", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 27
>
> I'd suggest to always skip symlinks but that doesn't seem like the right
> thing to do..
>
> --L
>
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-12-20 5:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-18 22:09 [Qemu-devel] elf interpreter prefix scanning can get stuck in a loop Lennert Buytenhek
2004-12-20 5:23 ` Karl Magdsick
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).