netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: luoxuanqiang <luoxuanqiang@kylinos.cn>
Cc: edumazet@google.com, davem@davemloft.net, dsahern@kernel.org,
	fw@strlen.de, kuba@kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, pabeni@redhat.com, kuniyu@amazon.com,
	dccp@vger.kernel.org
Subject: Re: [PATCH net v2] Fix race for duplicate reqsk on identical SYN
Date: Fri, 14 Jun 2024 12:54:41 +0200	[thread overview]
Message-ID: <20240614105441.GA24596@breakpoint.cc> (raw)
In-Reply-To: <20240614102628.446642-1-luoxuanqiang@kylinos.cn>

luoxuanqiang <luoxuanqiang@kylinos.cn> wrote:
>  include/net/inet_connection_sock.h |  2 +-
>  net/dccp/ipv4.c                    |  2 +-
>  net/dccp/ipv6.c                    |  2 +-
>  net/ipv4/inet_connection_sock.c    | 15 +++++++++++----
>  net/ipv4/tcp_input.c               | 11 ++++++++++-
>  5 files changed, 24 insertions(+), 8 deletions(-)
> 
> diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
> index 7d6b1254c92d..8773d161d184 100644
> --- a/include/net/inet_connection_sock.h
> +++ b/include/net/inet_connection_sock.h
> @@ -264,7 +264,7 @@ struct sock *inet_csk_reqsk_queue_add(struct sock *sk,
>  				      struct request_sock *req,
>  				      struct sock *child);
>  void inet_csk_reqsk_queue_hash_add(struct sock *sk, struct request_sock *req,
> -				   unsigned long timeout);
> +				   unsigned long timeout, bool *found_dup_sk);

Nit:

I think it would be preferrable to change retval to bool rather than
bool *found_dup_sk extra arg, so one can do

bool inet_csk_reqsk_queue_hash_add(struct sock *sk, struct request_sock *req,
  				   unsigned long timeout)
{
	if (!reqsk_queue_hash_req(req, timeout))
		return false;

i.e. let retval indicate wheter reqsk was inserted or not.

Patch looks good to me otherwise.

  reply	other threads:[~2024-06-14 10:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14 10:26 [PATCH net v2] Fix race for duplicate reqsk on identical SYN luoxuanqiang
2024-06-14 10:54 ` Florian Westphal [this message]
2024-06-14 12:42   ` luoxuanqiang
2024-06-14 22:24     ` Kuniyuki Iwashima
2024-06-15  6:40       ` Eric Dumazet
2024-06-17  2:01         ` luoxuanqiang
2024-06-17  8:07         ` luoxuanqiang
2024-06-16 23:45 ` alexandre.ferrieux
     [not found] ` <1718586352627144.1.seg@mailgw.kylinos.cn>
2024-06-17  2:53   ` luoxuanqiang
2024-06-17 14:44     ` alexandre.ferrieux
2024-08-25 12:24       ` alexandre.ferrieux

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=20240614105441.GA24596@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=davem@davemloft.net \
    --cc=dccp@vger.kernel.org \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@amazon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luoxuanqiang@kylinos.cn \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).