Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757539AbXFIRIS (ORCPT ); Sat, 9 Jun 2007 13:08:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754821AbXFIRIJ (ORCPT ); Sat, 9 Jun 2007 13:08:09 -0400 Received: from x35.xmailserver.org ([64.71.152.41]:2826 "EHLO x35.xmailserver.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753957AbXFIRIG (ORCPT ); Sat, 9 Jun 2007 13:08:06 -0400 X-AuthUser: davidel@xmailserver.org Date: Sat, 9 Jun 2007 10:08:04 -0700 (PDT) From: Davide Libenzi X-X-Sender: davide@alien.or.mcafeemobile.com To: Al Viro cc: Ulrich Drepper , Linus Torvalds , Alan Cox , Theodore Tso , Eric Dumazet , Kyle Moffett , Linux Kernel Mailing List , Andrew Morton , Ingo Molnar Subject: Re: [patch 7/8] fdmap v2 - implement sys_socket2 In-Reply-To: Message-ID: References: <4669A674.4080309@redhat.com> <20070609003622.GB4095@ftp.linux.org.uk> <466A0020.50406@redhat.com> <20070609014140.GC4095@ftp.linux.org.uk> <466A0BFB.3070908@redhat.com> <20070609151521.GD4095@ftp.linux.org.uk> <466AD4BA.80407@redhat.com> <20070609165454.GE4095@ftp.linux.org.uk> X-GPG-FINGRPRINT: CFAE 5BEE FD36 F65E E640 56FE 0974 BF23 270F 474E X-GPG-PUBLIC_KEY: http://www.xmailserver.org/davidel.asc MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1208 Lines: 30 On Sat, 9 Jun 2007, Davide Libenzi wrote: > On Sat, 9 Jun 2007, Al Viro wrote: > > > That's simply not true. On the current kernel nothing stops you from e.g. > > picking a random number and using F_DUPFD. Voila - there's your randomized > > descriptor. Portable to earlier kernels. > > > > Moreover, nonsense^H^H^Hq_fd() can be implemented in userland just fine > > if we allow F_DUPFD to arbitrary number - just pass it a random one *or* > > base chosen like davedel is doing (constant + 20bit random chosen at start > > time). > > That does not work. Or better, it works but it forces *huge* fdtables to > be created. To do that, you need "start" to be over NR_FILE, and this > creates an fdtable bigger than NR_FILE ((pointer-size + a-few-bits) * > NR_FILE) propagated down to every app you fork. Keep in mind also, that quite a few places in the code, walk through the whole fdtable memory. So it is not only a problem of wasted RAM. - Davide - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/