Re: net: do not allow changing SO_REUSEADDR/SO_REUSEPORT on bound sockets

2018-06-11 Thread Andrei Vagin
On Sun, Jun 03, 2018 at 10:47:05AM -0700, Maciej Żenczykowski wrote: > From: Maciej Żenczykowski > > 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

Re: net: do not allow changing SO_REUSEADDR/SO_REUSEPORT on bound sockets

2018-06-11 Thread Andrei Vagin
Cc: Pavel On Fri, Jun 08, 2018 at 03:07:30AM -0700, Maciej Żenczykowski wrote: > I think we probably need to make sk->sk_reuse back into a boolean. > (ie. eliminate SK_FORCE_REUSE) > > Then add a new tcp/udp sk->ignore_bind_conflicts boolean setting... > (ie. not just for tcp, but sol_socket)

Re: net: do not allow changing SO_REUSEADDR/SO_REUSEPORT on bound sockets

2018-06-08 Thread Maciej Żenczykowski
I think we probably need to make sk->sk_reuse back into a boolean. (ie. eliminate SK_FORCE_REUSE) Then add a new tcp/udp sk->ignore_bind_conflicts boolean setting... (ie. not just for tcp, but sol_socket) [or perhaps SO_REPAIR, sk->repair or something] What I'm not certain of is exactly what

Re: net: do not allow changing SO_REUSEADDR/SO_REUSEPORT on bound sockets

2018-06-06 Thread Andrei Vagin
On Wed, Jun 06, 2018 at 05:25:51PM -0700, Maciej Żenczykowski wrote: > Yes, it does, we found this internally last night and been debating > what to do about it. > > Fundamentally what it points out is that prior to this patch CRIU > could get the host into an inconsistent state. Yes, I

Re: net: do not allow changing SO_REUSEADDR/SO_REUSEPORT on bound sockets

2018-06-06 Thread Maciej Żenczykowski
Yes, it does, we found this internally last night and been debating what to do about it. Fundamentally what it points out is that prior to this patch CRIU could get the host into an inconsistent state. It inserts all the sockets into the hashtables with SO_REUSEADDR set, and then (potentially)

Re: net: do not allow changing SO_REUSEADDR/SO_REUSEPORT on bound sockets

2018-06-06 Thread Andrei Vagin
This patch breaks CRIU tests: = Run zdtm/transition/socket-tcp6 in h = Start test ./socket-tcp6 --pidfile=socket-tcp6.pid --outfile=socket-tcp6.out start time for zdtm/transition/socket-tcp6: 0.90 Run criu dump Run criu restore =[log]=>