[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZwQQPIzvln5sLYIt@t14s.localdomain>
Date: Mon, 7 Oct 2024 13:45:48 -0300
From: Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
To: Xin Long <lucien.xin@...il.com>
Cc: network dev <netdev@...r.kernel.org>, linux-sctp@...r.kernel.org,
davem@...emloft.net, kuba@...nel.org,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net] sctp: ensure sk_state is set to CLOSED if hashing
fails in sctp_listen_start
On Mon, Oct 07, 2024 at 12:25:11PM -0400, Xin Long wrote:
> If hashing fails in sctp_listen_start(), the socket remains in the
> LISTENING state, even though it was not added to the hash table.
> This can lead to a scenario where a socket appears to be listening
> without actually being accessible.
>
> This patch ensures that if the hashing operation fails, the sk_state
> is set back to CLOSED before returning an error.
>
> Note that there is no need to undo the autobind operation if hashing
> fails, as the bind port can still be used for next listen() call on
> the same socket.
>
> Fixes: 76c6d988aeb3 ("sctp: add sock_reuseport for the sock in __sctp_hash_endpoint")
> Reported-by: Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
> Signed-off-by: Xin Long <lucien.xin@...il.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
Powered by blists - more mailing lists