kernel_samsung_a53x/net/rds
Allison Henderson 5c07cf9908 net:rds: Fix possible deadlock in rds_message_put
commit f1acf1ac84d2ae97b7889b87223c1064df850069 upstream.

Functions rds_still_queued and rds_clear_recv_queue lock a given socket
in order to safely iterate over the incoming rds messages. However
calling rds_inc_put while under this lock creates a potential deadlock.
rds_inc_put may eventually call rds_message_purge, which will lock
m_rs_lock. This is the incorrect locking order since m_rs_lock is
meant to be locked before the socket. To fix this, we move the message
item to a local list or variable that wont need rs_recv_lock protection.
Then we can safely call rds_inc_put on any item stored locally after
rs_recv_lock is released.

Fixes: bdbe6fbc6a2f ("RDS: recv.c")
Reported-by: syzbot+f9db6ff27b9bfdcfeca0@syzkaller.appspotmail.com
Reported-by: syzbot+dcd73ff9291e6d34b3ab@syzkaller.appspotmail.com
Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
Link: https://lore.kernel.org/r/20240209022854.200292-1-allison.henderson@oracle.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-23 23:20:54 +01:00
..
af_rds.c net/rds: Fix UBSAN: array-index-out-of-bounds in rds_cmsg_recv 2024-11-18 12:13:00 +01:00
bind.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cong.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
connection.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ib.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ib.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ib_cm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ib_frmr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ib_mr.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ib_rdma.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ib_recv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ib_ring.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ib_send.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ib_stats.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ib_sysctl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
info.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
info.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
loop.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
loop.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
message.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
page.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rdma.c net/rds: fix possible cp null dereference 2024-11-19 09:22:45 +01:00
rdma_transport.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rdma_transport.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rds.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rds_single_path.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
recv.c net:rds: Fix possible deadlock in rds_message_put 2024-11-23 23:20:54 +01:00
send.c rds: introduce acquire/release ordering in acquire/release_in_xmit() 2024-11-19 08:44:59 +01:00
stats.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sysctl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tcp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tcp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tcp_connect.c net: prevent address rewrite in kernel_bind() 2024-11-08 11:25:44 +01:00
tcp_listen.c net: prevent address rewrite in kernel_bind() 2024-11-08 11:25:44 +01:00
tcp_recv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tcp_send.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tcp_stats.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
threads.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
transport.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00