All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org,
	Alexey Dobriyan
	<adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH] c/r: Add AF_UNIX support (v3)
Date: Mon, 06 Jul 2009 15:12:01 -0700	[thread overview]
Message-ID: <87tz1psbpq.fsf@caffeine.danplanet.com> (raw)
In-Reply-To: <4A524B40.4040600-eQaUEPhvms7ENvBUuze7eA@public.gmane.org> (Oren Laadan's message of "Mon\, 06 Jul 2009 15\:06\:40 -0400")

OL> (You'll need to slightly refactor sock_setsockopt() for that).

It seems much easier and less invasive to just check against
sysctl_{r,w}mem_max.  I've got that added to the patch now.

OL> 2) 	s = socket(.., SOCK_DGRAM,...);
OL> 	bind(s, any_addr);
OL> 	connect(s, other_addr, ...);
--> now s is connected, but after restart you can't connect another
OL> socket to it because the address wasn't bind() properly.

Okay, I guess that's true.  So, since there isn't a "I'm bound, but
not listening or connected" flag anywhere, does it suffice to bind()
any socket that is not connected but that does have a local address?
Sockets that get a local address via connect() should never transition
through that state, so I think that should work.  At least for INET,
any socket that is restored into a connected state is properly hashed
such that another socket can't bind() to its local address (tested).

OL> (And if the address was a pathname, but already unlinked, then
OL> also unlink after the bind, FWIW).

For path-based UNIX sockets, we don't care about this exclusion,
right?  As long as we make the socket owner think everything is as it
was, that is.  Given that a normal system doesn't fail the bind of b
in this case:

  a = socket(AF_UNIX);
  b = socket(AF_UNIX);

  bind(a, addr);
  unlink(addr);
  bind(b, addr);

-- 
Dan Smith
IBM Linux Technology Center
email: danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org

  parent reply	other threads:[~2009-07-06 22:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-16 15:55 [PATCH] c/r: Add AF_UNIX support (v3) Dan Smith
     [not found] ` <1245167716-28906-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-06-25  2:30   ` Oren Laadan
2009-06-29 17:29     ` Dan Smith
     [not found]       ` <871vp3x81s.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2009-07-02  9:15         ` Oren Laadan
2009-07-06 18:31           ` Dan Smith
     [not found]             ` <87y6r1slxz.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2009-07-06 19:06               ` Oren Laadan
     [not found]                 ` <4A524B40.4040600-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-07-06 22:12                   ` Dan Smith [this message]
     [not found]                     ` <87tz1psbpq.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2009-07-06 22:46                       ` Oren Laadan
     [not found]                         ` <4A527EB8.4060201-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-07-07 14:52                           ` Dan Smith
     [not found]                             ` <87prccsfyp.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2009-07-07 15:15                               ` Oren Laadan
     [not found]                                 ` <Pine.LNX.4.64.0907071102341.24765-CXF6herHY6ykSYb+qCZC/1i27PF6R63G9nwVQlTi/Pw@public.gmane.org>
2009-07-07 15:24                                   ` Dan Smith
2009-07-07 15:33                               ` Oren Laadan
2009-07-07 15:36                                 ` Dan Smith
     [not found]                                   ` <87ab3gsdwx.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2009-07-07 15:48                                     ` Oren Laadan
     [not found]                                       ` <4A536E44.6050601-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-07-07 16:04                                         ` Dan Smith

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=87tz1psbpq.fsf@caffeine.danplanet.com \
    --to=danms-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org \
    /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.