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 <cg2v@andrew.cmu.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 8e68e08901b0ad003ad1e5114a155bfac83bdd83)

Change-Id: Id34b50e91c54f6f984c67ed18fad58ebe225c635
Reviewed-on: http://gerrit.openafs.org/8609
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
This commit is contained in:
Jeffrey Altman 2012-11-24 20:10:49 -05:00 committed by Paul Smeddle
parent 795a22793f
commit 6ed24963f7

View File

@ -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;