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

2020-11-20 Thread Ricardo Dias
are adding the second child socket to the established connections socket. If an existing child socket exists, we drop the packet and discard the second child socket to the same client. Signed-off-by: Ricardo Dias --- v8 (2020-11-20): * Implemented the approach suggested by Eric where we drop the

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

2020-11-19 Thread Ricardo Dias
are adding the second child socket to the established connections socket. If an existing child socket exists, we return that socket and use it to process the TCP packet received, and discard the second child socket to the same client. Signed-off-by: Ricardo Dias --- v7 (2020-11-19): * Changed

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

2020-11-16 Thread Ricardo Dias
are adding the second child socket to the established connections socket. If an existing child socket exists, we return that socket and use it to process the TCP packet received, and discard the second child socket to the same client. Signed-off-by: Ricardo Dias --- v6 (2020-11-17): * Moved the

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

2020-11-16 Thread Ricardo Dias
Please to not consider this version for review. I'll send a new patch version soon.

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

2020-11-16 Thread Ricardo Dias
are adding the second child socket to the established connections socket. If an existing child socket exists, we return that socket and use it to process the TCP packet received, and discard the second child socket to the same client. Signed-off-by: Ricardo Dias --- include/net/inet_hashtables.h

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

2020-11-13 Thread Ricardo Dias
are adding the second child socket to the established connections socket. If an existing child socket exists, we return that socket and use it to process the TCP packet received, and discard the second child socket to the same client. Signed-off-by: Ricardo Dias --- v4 (2020-11-12): * Added

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 des

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

2020-11-10 Thread Ricardo Dias
are adding the second child socket to the established connections socket. If an existing child socket exists, we return that socket and use it to process the TCP packet received, and discard the second child socket to the same client. Signed-off-by: Ricardo Dias --- v3 (2020-11-11): * Fixed IPv6

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

2020-11-09 Thread Ricardo Dias
are adding the second child socket to the established connections socket. If an existing child socket exists, we return that socket and use it to process the TCP packet received, and discard the second child socket to the same client. Signed-off-by: Ricardo Dias Reported-by: kernel test robot

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

2020-10-23 Thread Ricardo Dias
On Fri, Oct 23, 2020 at 06:51:05PM +0200, Eric Dumazet wrote: > On Fri, Oct 23, 2020 at 6:48 PM Ricardo Dias wrote: > > > > > In that case, I can change the patch to only iterate the ehash bucket > > only when the listening socket is using the loopback interface, correct?

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

2020-10-23 Thread Ricardo Dias
On Fri, Oct 23, 2020 at 06:36:29PM +0200, Eric Dumazet wrote: > On Fri, Oct 23, 2020 at 6:06 PM Ricardo Dias wrote: > > > And what about the loopback interface? Why couldn't the loopback > > interface also use a single RX queue? > > > > Loopback is using a p

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

2020-10-23 Thread Ricardo Dias
On Fri, Oct 23, 2020 at 05:56:07PM +0200, Eric Dumazet wrote: > On Fri, Oct 23, 2020 at 5:51 PM Ricardo Dias wrote: > > > > On Fri, Oct 23, 2020 at 04:03:27PM +0200, Eric Dumazet wrote: > > > On Fri, Oct 23, 2020 at 1:14 PM Ricardo Dias wrote: > > > > > &g

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

2020-10-23 Thread Ricardo Dias
On Fri, Oct 23, 2020 at 04:03:27PM +0200, Eric Dumazet wrote: > On Fri, Oct 23, 2020 at 1:14 PM 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 > &g

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

2020-10-23 Thread Ricardo Dias
are adding the second child socket to the established connections socket. If an existing child socket exists, we return that socket and use it to process the TCP packet received, and discard the second child socket to the same client. Signed-off-by: Ricardo Dias --- include/net/inet_hashtables.h