WSL2-Linux-Kernel/net/rds
Quentin Casasnovas 8c7188b234 RDS: fix race condition when sending a message on unbound socket
Sasha's found a NULL pointer dereference in the RDS connection code when
sending a message to an apparently unbound socket.  The problem is caused
by the code checking if the socket is bound in rds_sendmsg(), which checks
the rs_bound_addr field without taking a lock on the socket.  This opens a
race where rs_bound_addr is temporarily set but where the transport is not
in rds_bind(), leading to a NULL pointer dereference when trying to
dereference 'trans' in __rds_conn_create().

Vegard wrote a reproducer for this issue, so kindly ask him to share if
you're interested.

I cannot reproduce the NULL pointer dereference using Vegard's reproducer
with this patch, whereas I could without.

Complete earlier incomplete fix to CVE-2015-6937:

  74e98eb085 ("RDS: verify the underlying transport exists before creating a connection")

Cc: David S. Miller <davem@davemloft.net>
Cc: stable@vger.kernel.org

Reviewed-by: Vegard Nossum <vegard.nossum@oracle.com>
Reviewed-by: Sasha Levin <sasha.levin@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-11-24 17:20:09 -05:00
..
Kconfig
Makefile
af_rds.c RDS: convert bind hash table to re-sizable hashtable 2015-11-02 15:36:23 -05:00
bind.c RDS: convert bind hash table to re-sizable hashtable 2015-11-02 15:36:23 -05:00
cong.c
connection.c RDS: fix race condition when sending a message on unbound socket 2015-11-24 17:20:09 -05:00
ib.c Initial 4.4 merge window submission 2015-11-07 13:33:07 -08:00
ib.h Initial 4.4 merge window submission 2015-11-07 13:33:07 -08:00
ib_cm.c Initial 4.4 merge window submission 2015-11-07 13:33:07 -08:00
ib_rdma.c RDS: IB: split mr pool to improve 8K messages performance 2015-10-05 11:19:02 -07:00
ib_recv.c mm, page_alloc: distinguish between being unable to sleep, unwilling to sleep and avoiding waking kswapd 2015-11-06 17:50:42 -08:00
ib_ring.c
ib_send.c Initial 4.4 merge window submission 2015-11-07 13:33:07 -08:00
ib_stats.c RDS: IB: split mr pool to improve 8K messages performance 2015-10-05 11:19:02 -07:00
ib_sysctl.c
info.c
info.h
iw.c IB/cma: Add support for network namespaces 2015-10-28 12:32:48 -04:00
iw.h RDS/IW: Convert to new memory registration API 2015-10-28 22:27:18 -04:00
iw_cm.c IB/cma: Add support for network namespaces 2015-10-28 12:32:48 -04:00
iw_rdma.c Initial 4.4 merge window submission 2015-11-07 13:33:07 -08:00
iw_recv.c
iw_ring.c
iw_send.c RDS/IW: Convert to new memory registration API 2015-10-28 22:27:18 -04:00
iw_stats.c
iw_sysctl.c
loop.c
loop.h
message.c
page.c
rdma.c RDS: Fix rds MR reference count in rds_rdma_unuse() 2015-08-25 16:28:10 -07:00
rdma_transport.c IB/cma: Add support for network namespaces 2015-10-28 12:32:48 -04:00
rdma_transport.h
rds.h RDS: convert bind hash table to re-sizable hashtable 2015-11-02 15:36:23 -05:00
recv.c
send.c RDS: fix race condition when sending a message on unbound socket 2015-11-24 17:20:09 -05:00
stats.c
sysctl.c
tcp.c RDS-TCP: Do not bloat sndbuf/rcvbuf in rds_tcp_tune 2015-10-05 03:34:53 -07:00
tcp.h RDS-TCP: Support multiple RDS-TCP listen endpoints, one per netns. 2015-08-07 11:29:58 -07:00
tcp_connect.c RDS-TCP: Support multiple RDS-TCP listen endpoints, one per netns. 2015-08-07 11:29:58 -07:00
tcp_listen.c RDS-TCP: Reset tcp callbacks if re-using an outgoing socket in rds_tcp_accept_one() 2015-10-13 04:22:41 -07:00
tcp_recv.c RDS-TCP: Recover correctly from pskb_pull()/pksb_trim() failure in rds_tcp_data_recv 2015-10-27 19:46:34 -07:00
tcp_send.c RDS-TCP: Set up MSG_MORE and MSG_SENDPAGE_NOTLAST as appropriate in rds_tcp_xmit 2015-10-05 03:34:53 -07:00
tcp_stats.c
threads.c RDS: use rds_send_xmit() state instead of RDS_LL_SEND_FULL 2015-10-05 11:19:01 -07:00
transport.c RDS-TCP: Make RDS-TCP work correctly when it is set up in a netns other than init_net 2015-08-07 11:29:57 -07:00