From: ebiederm@xmission.com (Eric W. Biederman)
To: Miklos Szeredi <miklos@szeredi.hu>
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
Date: Sat, 23 Jun 2007 10:42:05 -0600 [thread overview]
Message-ID: <m1ir9eaahu.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <E1I21IL-0004LH-00@dorka.pomaz.szeredi.hu> (Miklos Szeredi's message of "Sat, 23 Jun 2007 10:48:37 +0200")
Miklos Szeredi <miklos@szeredi.hu> writes:
> Right. But the devil is in the details, and (as you correctly point
> out later) to implement this, the whole locking scheme needs to be
> overhauled. Problems:
>
> - Using the queue lock to make the dequeue and the fd detach atomic
> wrt the GC is difficult, if not impossible: they are are far from
> each other with various magic in between. It would need thorough
> understanding of these functions and _big_ changes to implement.
>
> - Sleeping on u->readlock in GC is currently not possible, since that
> could deadlock with unix_dgram_recvmsg(). That function could
> probably be modified to release u->readlock, while waiting for
> data, similarly to unix_stream_recvmsg() at the cost of some added
> complexity.
>
> - Sleeping on u->readlock is also impossible, because GC is holding
> unix_table_lock for the whole operation. We could release
> unix_table_lock, but then would have to cope with sockets coming
> and going, making the current socket iterator unworkable.
>
> So theoretically it's quite simple, but it needs big changes. And
> this wouldn't even solve all the problems with the GC, like being a
> possible DoS vector.
Making the GC fully incremental will solve the DoS vector problem as
well. Basically you do a fixed amount of reclaim in the new socket
allocation code.
It appears clear that since we can't stop the world and garbage
collect we need an incremental collector.
Eric
next prev parent reply other threads:[~2007-06-23 16:48 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-02 21:50 [PATCH] fix race in AF_UNIX Miklos Szeredi
2007-06-02 22:11 ` Arnaldo Carvalho de Melo
2007-06-04 9:45 ` Miklos Szeredi
2007-06-05 7:02 ` David Miller
2007-06-05 7:42 ` Miklos Szeredi
2007-06-05 7:55 ` David Miller
2007-06-05 8:11 ` Miklos Szeredi
2007-06-05 8:19 ` David Miller
2007-06-05 20:11 ` David Miller
2007-06-06 0:31 ` David Miller
2007-06-06 5:26 ` Miklos Szeredi
2007-06-06 5:41 ` David Miller
2007-06-06 8:08 ` Miklos Szeredi
2007-06-06 8:12 ` David Miller
2007-06-08 1:47 ` David Miller
2007-06-11 9:57 ` Miklos Szeredi
2007-06-18 7:49 ` Miklos Szeredi
2007-06-18 7:57 ` David Miller
2007-06-18 8:20 ` Miklos Szeredi
2007-06-18 9:18 ` David Miller
2007-06-18 9:29 ` Miklos Szeredi
2007-06-18 9:35 ` David Miller
2007-06-18 9:44 ` Miklos Szeredi
2007-06-18 9:48 ` David Miller
2007-06-18 9:55 ` Miklos Szeredi
2007-06-18 9:59 ` David Miller
2007-06-18 10:32 ` Thomas Graf
2007-06-18 10:39 ` Miklos Szeredi
2007-06-18 10:43 ` Thomas Graf
2007-06-18 12:01 ` Alan Cox
2007-06-18 10:40 ` Thomas Graf
2007-06-18 10:47 ` Miklos Szeredi
2007-06-18 10:51 ` David Miller
2007-06-18 10:55 ` Miklos Szeredi
2007-06-18 11:02 ` David Miller
2007-06-18 11:06 ` Miklos Szeredi
2007-06-18 11:09 ` David Miller
2007-06-18 11:46 ` Miklos Szeredi
2007-06-18 11:47 ` Alan Cox
2007-06-18 11:45 ` Jan Engelhardt
2007-06-18 12:00 ` Miklos Szeredi
2007-06-21 15:18 ` Eric W. Biederman
2007-06-23 8:48 ` Miklos Szeredi
2007-06-23 16:42 ` Eric W. Biederman [this message]
2007-06-26 8:54 ` Miklos Szeredi
2007-06-26 15:24 ` Eric W. Biederman
2007-06-04 9:53 ` Miklos Szeredi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1ir9eaahu.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=netdev@vger.kernel.org \
--cc=viro@ftp.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.