From: Jeffrey Altman Date: Mon, 16 Jul 2012 21:29:54 +0000 (-0400) Subject: rx: protect against ACKs with serial as prevPacket X-Git-Tag: openafs-stable-1_8_0pre1~2141 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=e02fd4d358f20bcf001f0486afe1750d4013dea3 rx: protect against ACKs with serial as prevPacket patchset 4e71409fe1305cde4b9b341247ba658d8d24f4d0 introduced a check in rxi_ReceiveAckPacket for out of order ack packets which relied upon the value of the previousPacket field. Unfortunately, some versions of RX store the previous packet's serial number in the field instead of previous packet's sequence number. Modify the check to only discard out of order ACKs if the previousPacket sequence number is within the valid window. Change-Id: I72885a8c1aaa69eb263335be1827545f2b4c3e09 Reviewed-on: http://gerrit.openafs.org/7785 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/rx/rx.c b/src/rx/rx.c index e344db5..6e0b367 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -4252,9 +4252,14 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, prev = ntohl(ap->previousPacket); serial = ntohl(ap->serial); - /* Ignore ack packets received out of order */ + /* + * Ignore ack packets received out of order while protecting + * against peers that set the previousPacket field to a packet + * serial number instead of a sequence number. + */ if (first < call->tfirst || - (first == call->tfirst && prev < call->tprev)) { + (first == call->tfirst && prev < call->tprev && prev < call->tfirst + + call->twind)) { return np; }