From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CgGDx-0006x0-Ay for qemu-devel@nongnu.org; Mon, 20 Dec 2004 00:36:49 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CgGDv-0006vX-C0 for qemu-devel@nongnu.org; Mon, 20 Dec 2004 00:36:47 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CgGDu-0006v7-Sy for qemu-devel@nongnu.org; Mon, 20 Dec 2004 00:36:46 -0500 Received: from [64.233.184.204] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CgG0j-0001mD-4s for qemu-devel@nongnu.org; Mon, 20 Dec 2004 00:23:09 -0500 Received: by wproxy.gmail.com with SMTP id 68so468402wri for ; Sun, 19 Dec 2004 21:23:08 -0800 (PST) Message-ID: Date: Mon, 20 Dec 2004 00:23:07 -0500 From: Karl Magdsick Subject: Re: [Qemu-devel] elf interpreter prefix scanning can get stuck in a loop In-Reply-To: <20041218220903.GB832@xi.wantstofly.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <20041218220903.GB832@xi.wantstofly.org> Reply-To: Karl Magdsick , qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 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 >