kernel_samsung_a53x/net/sctp
Xin Long 31c0dc7bbd sctp: ensure sk_state is set to CLOSED if hashing fails in sctp_listen_start
[ Upstream commit 4d5c70e6155d5eae198bade4afeab3c1b15073b6 ]

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@gmail.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:21:52 +01:00
..
associola.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
auth.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bind_addr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
chunk.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
debug.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
diag.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
endpointola.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
input.c sctp: Fix null-ptr-deref in reuseport_add_sock(). 2024-11-23 23:20:22 +01:00
inqueue.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ipv6.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
objcnt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
offload.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
output.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
outqueue.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
primitive.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
proc.c sctp: move hlist_node and hashent out of sctp_ep_common 2024-11-23 23:20:22 +01:00
protocol.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sm_make_chunk.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sm_sideeffect.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sm_statefuns.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sm_statetable.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
socket.c sctp: ensure sk_state is set to CLOSED if hashing fails in sctp_listen_start 2024-11-23 23:21:52 +01:00
stream.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stream_interleave.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stream_sched.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stream_sched_prio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stream_sched_rr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sysctl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
transport.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tsnmap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ulpevent.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ulpqueue.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00