Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757843AbXFZPZN (ORCPT ); Tue, 26 Jun 2007 11:25:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755842AbXFZPY6 (ORCPT ); Tue, 26 Jun 2007 11:24:58 -0400 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:38078 "EHLO ebiederm.dsl.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754138AbXFZPY5 (ORCPT ); Tue, 26 Jun 2007 11:24:57 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Miklos Szeredi Cc: davem@davemloft.net, viro@ftp.linux.org.uk, alan@lxorguk.ukuu.org.uk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fix race in AF_UNIX References: <20070605.224128.104032917.davem@davemloft.net> <20070607.184731.10907840.davem@davemloft.net> Date: Tue, 26 Jun 2007 09:24:08 -0600 In-Reply-To: (Miklos Szeredi's message of "Tue, 26 Jun 2007 10:54:32 +0200") Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) 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: 1505 Lines: 38 Miklos Szeredi writes: > > And I think incremental GC algorithms are much too complex for this > task. What I've realized, is that in fact we don't require a generic > garbage collection algorithm, just a much more specialized cycle > collection algorithm, since refcounting in struct file takes care of > the rest. > > This would help with localizing the problem to the problematic sockets > (which have an in-flight unix socket), instead of having to blindly > traverse _all_ unix sockets in the system. > > I'll look at reimplementing the GC with such an algorithm. Ok. If you can do it more simply have at it. There are incremental garbage collectors that are essentially just the current algorithm with fine-grained locking. So we don't have to live in a spin-lock the whole time. If your approach fails we can look at something more fine-grained. >> It appears clear that since we can't stop the world and garbage >> collect we need an incremental collector. > > Constraining ourselves to stopping unix sockets from going in flight > or coming out of flight during garbage collection should be OK I > think. There's still a possibility of a DoS there, but it would only > be able to affect _very_ few applications. Yes. Eric - 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/