android_kernel_motorola_sm6375/net/sctp
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Chengfeng Ye 4d8fc61377 sctp: fix potential deadlock on &net->sctp.addr_wq_lock
[ Upstream commit 6feb37b3b06e9049e20dcf7e23998f92c9c5be9a ]

As &net->sctp.addr_wq_lock is also acquired by the timer
sctp_addr_wq_timeout_handler() in protocal.c, the same lock acquisition
at sctp_auto_asconf_init() seems should disable irq since it is called
from sctp_accept() under process context.

Possible deadlock scenario:
sctp_accept()
    -> sctp_sock_migrate()
    -> sctp_auto_asconf_init()
    -> spin_lock(&net->sctp.addr_wq_lock)
        <timer interrupt>
        -> sctp_addr_wq_timeout_handler()
        -> spin_lock_bh(&net->sctp.addr_wq_lock); (deadlock here)

This flaw was found using an experimental static analysis tool we are
developing for irq-related deadlock.

The tentative patch fix the potential deadlock by spin_lock_bh().

Signed-off-by: Chengfeng Ye <[email protected]>
Fixes: 34e5b0118685 ("sctp: delay auto_asconf init until binding the first addr")
Acked-by: Xin Long <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2023-07-27 08:37:22 +02: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 an error code in sctp_sf_eat_auth() 2023-06-21 15:44:11 +02:00
sm_statetable.c
socket.c sctp: fix potential deadlock on &net->sctp.addr_wq_lock 2023-07-27 08:37:22 +02:00
stream.c sctp: fix memory leak in sctp_stream_outq_migrate() 2022-12-08 11:23:03 +01:00
stream_interleave.c sctp: fix a potential overflow in sctp_ifwdtsn_skip 2023-04-20 12:07:36 +02:00
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