From 6ed24963f7b52ac57732c4349a6f86864ea33e3b Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sat, 24 Nov 2012 20:10:49 -0500 Subject: [PATCH] rx: set abort client_initiated flag to match direction In a recent incident involving packet reflection back to the file server, aborts were being sent by the file server in response to a server sent packet. The aborts sent in response also failed to set the CLIENT_INITIATED flag in the header which permitted the the actual client to confuse the Abort as applying to its client initiated connection. in rxi_SendRawAbort, set the CLIENT_INITIATED flag to the opposite of the packet the abort is being sent in response to. Thanks to Chaskiel Grundman for the suggestion. Reviewed-on: http://gerrit.openafs.org/8513 Reviewed-by: Chaskiel Grundman Tested-by: BuildBot Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear (cherry picked from commit 8e68e08901b0ad003ad1e5114a155bfac83bdd83) Change-Id: Id34b50e91c54f6f984c67ed18fad58ebe225c635 Reviewed-on: http://gerrit.openafs.org/8609 Reviewed-by: Stephan Wiesand Tested-by: Stephan Wiesand Reviewed-by: Jeffrey Altman Tested-by: BuildBot Reviewed-by: Paul Smeddle --- src/rx/rx_packet.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rx/rx_packet.c b/src/rx/rx_packet.c index 4d733dea4e..89f56da8e3 100644 --- a/src/rx/rx_packet.c +++ b/src/rx/rx_packet.c @@ -2566,6 +2566,14 @@ rxi_SendRawAbort(osi_socket socket, afs_uint32 host, u_short port, theader.securityIndex = source->header.securityIndex; theader.cid = htonl(source->header.cid); + /* + * If the abort is being sent in response to a server initiated packet, + * set client_initiated in the abort to ensure it is not associated by + * the receiver with a connection in the opposite direction. + */ + if ((source->header.flags & RX_CLIENT_INITIATED) != RX_CLIENT_INITIATED) + theader.flags |= RX_CLIENT_INITIATED; + error = htonl(error); iov[0].iov_base = &theader;