[PATCH v3] tcp: fix race condition when creating child sockets from syncookies

2020-11-10 Thread Ricardo Dias
When the TCP stack is in SYN flood mode, the server child socket is created from the SYN cookie received in a TCP packet with the ACK flag set. The child socket is created when the server receives the first TCP packet with a valid SYN cookie from the client. Usually, this packet corresponds to the

Re: [PATCH v3] tcp: fix race condition when creating child sockets from syncookies

2020-11-11 Thread Eric Dumazet
On Wed, Nov 11, 2020 at 8:35 AM Ricardo Dias wrote: > > When the TCP stack is in SYN flood mode, the server child socket is > created from the SYN cookie received in a TCP packet with the ACK flag > set. > > The child socket is created when the server receives the first TCP > packet with a valid S

Re: [PATCH v3] tcp: fix race condition when creating child sockets from syncookies

2020-11-11 Thread Ricardo Dias
On Wed, Nov 11, 2020 at 05:05:11PM +0100, Eric Dumazet wrote: > On Wed, Nov 11, 2020 at 8:35 AM Ricardo Dias wrote: > > ... > > > + * If an existing socket already exists, it returns that socket > > + * through the osk parameter. > > > I think this deserves a third parameter, to avoid confusion