netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: zenczykowski@gmail.com
Cc: maze@google.com, edumazet@google.com, netdev@vger.kernel.org
Subject: Re: [PATCH] net: do not allow changing SO_REUSEADDR/SO_REUSEPORT on bound sockets
Date: Mon, 04 Jun 2018 17:14:55 -0400 (EDT)	[thread overview]
Message-ID: <20180604.171455.1155660680592072439.davem@davemloft.net> (raw)
In-Reply-To: <20180603174705.51802-1-zenczykowski@gmail.com>

From: "Maciej Żenczykowski" <zenczykowski@gmail.com>
Date: Sun,  3 Jun 2018 10:47:05 -0700

> From: Maciej Żenczykowski <maze@google.com>
> 
> It is not safe to do so because such sockets are already in the
> hash tables and changing these options can result in invalidating
> the tb->fastreuse(port) caching.
> 
> This can have later far reaching consequences wrt. bind conflict checks
> which rely on these caches (for optimization purposes).
> 
> Not to mention that you can currently end up with two identical
> non-reuseport listening sockets bound to the same local ip:port
> by clearing reuseport on them after they've already both been bound.
> 
> There is unfortunately no EISBOUND error or anything similar,
> and EISCONN seems to be misleading for a bound-but-not-connected
> socket, so use EUCLEAN 'Structure needs cleaning' which AFAICT
> is the closest you can get to meaning 'socket in bad state'.
> (although perhaps EINVAL wouldn't be a bad choice either?)
> 
> This does unfortunately run the risk of breaking buggy
> userspace programs...
> 
> Signed-off-by: Maciej Żenczykowski <maze@google.com>
> Change-Id: I77c2b3429b2fdf42671eee0fa7a8ba721c94963b

Applied and queued up for -stable.

  parent reply	other threads:[~2018-06-04 21:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-03 17:47 [PATCH] net: do not allow changing SO_REUSEADDR/SO_REUSEPORT on bound sockets Maciej Żenczykowski
2018-06-03 19:54 ` Christoph Paasch
2018-06-04 17:24 ` Eric Dumazet
2018-06-04 21:14 ` David Miller [this message]
2018-06-06 23:25 ` Andrei Vagin
2018-06-07  0:25   ` Maciej Żenczykowski
2018-06-07  5:51     ` Andrei Vagin
2018-06-08 10:07       ` Maciej Żenczykowski
2018-06-11 18:35         ` Andrei Vagin
2018-06-11 18:57 ` Andrei Vagin
2018-06-11 21:25 ` [PATCH] " Marc Dionne
2018-06-11 22:29   ` Maciej Żenczykowski
2018-06-11 23:09     ` Marc Dionne

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=20180604.171455.1155660680592072439.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=maze@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=zenczykowski@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).