Ubuntu-focal-kernel/net/rds
Allison Henderson c8c25c6b07 net:rds: Fix possible deadlock in rds_message_put
BugLink: https://bugs.launchpad.net/bugs/2080595

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: bdbe6fbc6a ("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>
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2024-09-27 10:50:27 +02:00
..
Kconfig
Makefile
af_rds.c net/rds: Fix UBSAN: array-index-out-of-bounds in rds_cmsg_recv 2024-03-28 15:18:31 +01:00
bind.c
cong.c
connection.c
ib.c
ib.h
ib_cm.c
ib_fmr.c
ib_frmr.c
ib_mr.h
ib_rdma.c
ib_recv.c
ib_ring.c
ib_send.c
ib_stats.c
ib_sysctl.c
info.c
info.h
loop.c
loop.h
message.c rds: rds_rm_zerocopy_callback() correct order for list_add_tail() 2023-05-12 17:15:01 +02:00
page.c
rdma.c net/rds: fix possible cp null dereference 2024-06-07 15:01:38 +02:00
rdma_transport.c net: rds: Fix possible NULL-pointer dereference 2024-01-05 14:29:47 +01:00
rdma_transport.h
rds.h
rds_single_path.h
recv.c net:rds: Fix possible deadlock in rds_message_put 2024-09-27 10:50:27 +02:00
send.c rds: introduce acquire/release ordering in acquire/release_in_xmit() 2024-06-07 15:01:31 +02:00
stats.c
sysctl.c
tcp.c
tcp.h
tcp_connect.c net: prevent address rewrite in kernel_bind() 2024-01-05 14:29:53 +01:00
tcp_listen.c net: prevent address rewrite in kernel_bind() 2024-01-05 14:29:53 +01:00
tcp_recv.c
tcp_send.c
tcp_stats.c
threads.c
transport.c