android_kernel_motorola_sm6375/net/sctp
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Xin Long cec326443f sctp: add a refcnt in sctp_stream_priorities to avoid a nested loop
[ Upstream commit 68ba44639537de6f91fe32783766322d41848127 ]

With this refcnt added in sctp_stream_priorities, we don't need to
traverse all streams to check if the prio is used by other streams
when freeing one stream's prio in sctp_sched_prio_free_sid(). This
can avoid a nested loop (up to 65535 * 65535), which may cause a
stuck as Ying reported:

    watchdog: BUG: soft lockup - CPU#23 stuck for 26s! [ksoftirqd/23:136]
    Call Trace:
     <TASK>
     sctp_sched_prio_free_sid+0xab/0x100 [sctp]
     sctp_stream_free_ext+0x64/0xa0 [sctp]
     sctp_stream_free+0x31/0x50 [sctp]
     sctp_association_free+0xa5/0x200 [sctp]

Note that it doesn't need to use refcount_t type for this counter,
as its accessing is always protected under the sock lock.

v1->v2:
 - add a check in sctp_sched_prio_set to avoid the possible prio_head
   refcnt overflow.

Fixes: 9ed7bfc79542 ("sctp: fix memory leak in sctp_stream_outq_migrate()")
Reported-by: Ying Xu <yinxu@redhat.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Link: https://lore.kernel.org/r/825eb0c905cb864991eba335f4a2b780e543f06b.1677085641.git.lucien.xin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-11 16:44:11 +01:00
..
associola.c sctp: leave the err path free in sctp_stream_init to sctp_stream_free 2022-08-03 11:59:41 +02:00
auth.c sctp: handle the error returned from sctp_auth_asoc_init_active_key 2022-10-26 13:22:26 +02:00
bind_addr.c sctp: fail if no bound addresses can be used for a given scope 2023-02-06 07:52:46 +01:00
chunk.c
debug.c
diag.c sctp: sctp_sock_filter(): avoid list_entry() on possibly empty list 2023-02-22 12:50:40 +01:00
endpointola.c sctp: use call_rcu to free endpoint 2022-01-05 12:37:44 +01:00
input.c sctp: read sk->sk_bound_dev_if once in sctp_rcv() 2022-06-14 18:11:37 +02:00
inqueue.c
ipv6.c
Kconfig
Makefile
objcnt.c
offload.c
output.c
outqueue.c
primitive.c
proc.c
protocol.c ip: Fix data-races around sysctl_ip_nonlocal_bind. 2022-07-29 17:14:11 +02:00
sm_make_chunk.c sctp: account stream padding length for reconf chunk 2021-10-20 11:40:15 +02:00
sm_sideeffect.c sctp: check asoc strreset_chunk in sctp_generate_reconf_event 2022-05-09 09:03:24 +02:00
sm_statefuns.c sctp: fix the processing for INIT chunk 2022-03-19 13:40:13 +01:00
sm_statetable.c
socket.c sctp: Initialize daddr on peeled off socket 2022-04-20 09:19:35 +02:00
stream.c sctp: fix memory leak in sctp_stream_outq_migrate() 2022-12-08 11:23:03 +01:00
stream_interleave.c
stream_sched.c sctp: fix memory leak in sctp_stream_outq_migrate() 2022-12-08 11:23:03 +01:00
stream_sched_prio.c sctp: add a refcnt in sctp_stream_priorities to avoid a nested loop 2023-03-11 16:44:11 +01:00
stream_sched_rr.c sctp: fix memory leak in sctp_stream_outq_migrate() 2022-12-08 11:23:03 +01:00
sysctl.c
transport.c
tsnmap.c
ulpevent.c
ulpqueue.c