]> git.baikalelectronics.ru Git - kernel.git/commit
RDS: TCP: Add/use rds_tcp_reset_callbacks to reset tcp socket safely
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Sat, 4 Jun 2016 20:59:58 +0000 (13:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 Jun 2016 22:10:15 +0000 (15:10 -0700)
commitcc98067fac39d717baae6f754f6d97e31a80f7c7
treec09223b2cdbe5b6a9d876ad07a9ee29cebcb8588
parent73a95281f8658d5d234459365ff4980fa25e6ae0
RDS: TCP: Add/use rds_tcp_reset_callbacks to reset tcp socket safely

When rds_tcp_accept_one() has to replace the existing tcp socket
with a newer tcp socket (duelling-syn resolution), it must lock_sock()
to suppress the rds_tcp_data_recv() path while callbacks are being
changed.  Also, existing RDS datagram reassembly state must be reset,
so that the next datagram on the new socket  does not have corrupted
state. Similarly when resetting the newly accepted socket, appropriate
locks and synchronization is needed.

This commit ensures correct synchronization by invoking
kernel_sock_shutdown to reset a newly accepted sock, and by taking
appropriate lock_sock()s (for old and new sockets) when resetting
existing callbacks.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/tcp.c
net/rds/tcp.h
net/rds/tcp_listen.c