linux-stable/net/rds
Sowmini Varadhan a93d01f577 RDS: TCP: avoid bad page reference in rds_tcp_listen_data_ready
As the existing comments in rds_tcp_listen_data_ready() indicate,
it is possible under some race-windows to get to this function with the
accept() socket. If that happens, we could run into a sequence whereby

   thread 1				thread 2

rds_tcp_accept_one() thread
sets up new_sock via ->accept().
The sk_user_data is now
sock_def_readable
					data comes in for new_sock,
					->sk_data_ready is called, and
					we land in rds_tcp_listen_data_ready
rds_tcp_set_callbacks()
takes the sk_callback_lock and
sets up sk_user_data to be the cp
					read_lock sk_callback_lock
					ready = cp
					unlock sk_callback_lock
					page fault on ready

In the above sequence, we end up with a panic on a bad page reference
when trying to execute (*ready)(). Instead we need to call
sock_def_readable() safely, which is what this patch achieves.

Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-07-15 11:36:57 -07:00
..
af_rds.c RDS: Add support for SO_TIMESTAMP for incoming messages 2016-03-02 14:13:17 -05:00
bind.c RDS: convert bind hash table to re-sizable hashtable 2015-11-02 15:36:23 -05:00
cong.c RDS: split out connection specific state from rds_connection to rds_conn_path 2016-06-14 23:50:41 -07:00
connection.c RDS: TCP: Simplify reconnect to avoid duelling reconnnect attempts 2016-07-01 16:45:17 -04:00
ib_cm.c RDS: TCP: Hooks to set up a single connection path 2016-07-01 16:45:17 -04:00
ib_fmr.c RDS: IB: move FMR code to its own file 2016-03-02 14:13:18 -05:00
ib_frmr.c IB/core: Add passing an offset into the SG to ib_map_mr_sg 2016-05-13 13:37:11 -04:00
ib_mr.h RDS: IB: Support Fastreg MR (FRMR) memory registration mode 2016-03-02 14:13:19 -05:00
ib_rdma.c RDS: split out connection specific state from rds_connection to rds_conn_path 2016-06-14 23:50:41 -07:00
ib_recv.c RDS: TCP: make receive path use the rds_conn_path 2016-07-01 16:45:17 -04:00
ib_ring.c RDS/IW+IB: Set recv ring low water mark to 1/2 full. 2009-04-09 17:21:14 -07:00
ib_send.c RDS: Rework path specific indirections 2016-07-01 16:45:17 -04:00
ib_stats.c RDS: IB: add mr reused stats 2016-03-02 14:13:19 -05:00
ib_sysctl.c net: Convert uses of typedef ctl_table to struct ctl_table 2013-06-13 02:36:09 -07:00
ib.c RDS: TCP: Hooks to set up a single connection path 2016-07-01 16:45:17 -04:00
ib.h RDS: TCP: Hooks to set up a single connection path 2016-07-01 16:45:17 -04:00
info.c rds: fix an integer overflow test in rds_info_getsockopt() 2015-08-03 15:20:16 -07:00
info.h RDS: Info and stats 2009-02-26 23:39:25 -08:00
Kconfig RDS: Drop stale iWARP RDMA transport 2016-03-02 14:13:17 -05:00
loop.c RDS: TCP: Hooks to set up a single connection path 2016-07-01 16:45:17 -04:00
loop.h RDS: loopback 2009-02-26 23:39:26 -08:00
Makefile RDS: IB: Support Fastreg MR (FRMR) memory registration mode 2016-03-02 14:13:19 -05:00
message.c rds: Make rds_message_copy_from_user() return 0 on success. 2015-02-07 22:41:56 -08:00
page.c RDS: memory allocated must be align to 8 2016-04-07 16:58:27 -04:00
rdma_transport.c RDS: split out connection specific state from rds_connection to rds_conn_path 2016-06-14 23:50:41 -07:00
rdma_transport.h RDS: Drop stale iWARP RDMA transport 2016-03-02 14:13:17 -05:00
rdma.c RDS: Fix rds MR reference count in rds_rdma_unuse() 2015-08-25 16:28:10 -07:00
rds_single_path.h RDS: split out connection specific state from rds_connection to rds_conn_path 2016-06-14 23:50:41 -07:00
rds.h RDS: TCP: Hooks to set up a single connection path 2016-07-01 16:45:17 -04:00
recv.c RDS: Do not send a pong to an incoming ping with 0 src port 2016-07-01 16:45:18 -04:00
send.c RDS: Rework path specific indirections 2016-07-01 16:45:17 -04:00
stats.c net/rds: zero last byte for strncpy 2013-03-08 00:35:44 -05:00
sysctl.c net: rds: fix coding style issues 2016-06-18 21:34:09 -07:00
tcp_connect.c RDS: TCP: Hooks to set up a single connection path 2016-07-01 16:45:17 -04:00
tcp_listen.c RDS: TCP: avoid bad page reference in rds_tcp_listen_data_ready 2016-07-15 11:36:57 -07:00
tcp_recv.c RDS: TCP: make receive path use the rds_conn_path 2016-07-01 16:45:17 -04:00
tcp_send.c RDS: TCP: make ->sk_user_data point to a rds_conn_path 2016-07-01 16:45:17 -04:00
tcp_stats.c net: rds: fix const array syntax 2011-07-01 16:16:19 -07:00
tcp.c RDS: TCP: avoid bad page reference in rds_tcp_listen_data_ready 2016-07-15 11:36:57 -07:00
tcp.h RDS: TCP: avoid bad page reference in rds_tcp_listen_data_ready 2016-07-15 11:36:57 -07:00
threads.c RDS: TCP: Simplify reconnect to avoid duelling reconnnect attempts 2016-07-01 16:45:17 -04:00
transport.c net: rds: fix coding style issues 2016-06-18 21:34:09 -07:00