]> www.infradead.org Git - users/jedix/linux-maple.git/commit
RDS: TCP: Add/use rds_tcp_reset_callbacks to reset tcp socket safely
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Tue, 7 Jun 2016 14:52:23 +0000 (07:52 -0700)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Wed, 10 Aug 2016 23:04:31 +0000 (16:04 -0700)
commit3fb663be325e3ba30393d2a5516f47c3e624b6c2
treeeb48984e62e77e2a1be9517f195595df87bd392d
parentc4e3bd6deaee652f72faa437a6ee8761c985e793
RDS: TCP: Add/use rds_tcp_reset_callbacks to reset tcp socket safely

Orabug: 23542064

Backport of upstream commit 335b48d980f6 ("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