From patchwork Thu Dec 27 13:05:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 1912881 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 3BB21DF2A2 for ; Thu, 27 Dec 2012 13:05:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752642Ab2L0NFR (ORCPT ); Thu, 27 Dec 2012 08:05:17 -0500 Received: from mail-yh0-f54.google.com ([209.85.213.54]:64913 "EHLO mail-yh0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752046Ab2L0NFQ (ORCPT ); Thu, 27 Dec 2012 08:05:16 -0500 Received: by mail-yh0-f54.google.com with SMTP id s35so1640511yhf.27 for ; Thu, 27 Dec 2012 05:05:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=HP2beSBi6RCOGyb4xyc8/nIHfO90B1nmiJ9bWIRcW7E=; b=gIi7Mj75/2+OMq6gdjQLB+Lr5VTIwWVkLJQQ6DtA21YPsIZIsL1WqUKDDGs7gyrVYV e4pUD8lgsKOTCw/baXC0EnjP/XRbOZbZk+ltwvUpCtvfjSP4uNINkWi6vaijamQJUnD5 2sojQbZHz8+3VN8m4Y8Yw+BfsjGqh7i0/EYk4bM5EfsF/vNbgkZfKjSOfOngsyXSNuxn z/Rm2gH/TxQWCDR6o4aIjhpubdRZgNziUe9ZPvV8Y2khMdCfq9r0gk7T8BqSWSRmYyZD tu2xCxty1J5QBgn8JPGORVRXcFck2cFRzfbZTvyx/MPAWZDloIjSgiOo5ymLDAbc2/Qo 3DRA== X-Received: by 10.236.175.104 with SMTP id y68mr27908687yhl.21.1356613515936; Thu, 27 Dec 2012 05:05:15 -0800 (PST) Received: from salusa.poochiereds.net (cpe-107-015-113-143.nc.res.rr.com. [107.15.113.143]) by mx.google.com with ESMTPS id z1sm23924761anj.2.2012.12.27.05.05.11 (version=SSLv3 cipher=OTHER); Thu, 27 Dec 2012 05:05:14 -0800 (PST) From: Jeff Layton To: smfrench@gmail.com Cc: tdparmor-sambabugs@yahoo.com, linux-cifs@vger.kernel.org Subject: [PATCH] cifs: adjust sequence number downward after signing NT_CANCEL request Date: Thu, 27 Dec 2012 08:05:03 -0500 Message-Id: <1356613503-30109-1-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.11.7 X-Gm-Message-State: ALoCoQlS2O8cHHwQIwNn1BAzLeSOtOlnY6lQAke6FaDAOwQqRxwbFkGgVE32ZyCkMTfsCuv7HYFx Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org When a call goes out, the signing code adjusts the sequence number upward by two to account for the request and the response. An NT_CANCEL however doesn't get a response of its own, it just hurries the server along to get it to respond to the original request more quickly. Therefore, we must adjust the sequence number back down by one after signing a NT_CANCEL request. Cc: Reported-by: Tim Perry Signed-off-by: Jeff Layton --- fs/cifs/smb1ops.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c index a5d234c..dd79056 100644 --- a/fs/cifs/smb1ops.c +++ b/fs/cifs/smb1ops.c @@ -53,6 +53,13 @@ send_nt_cancel(struct TCP_Server_Info *server, void *buf, mutex_unlock(&server->srv_mutex); return rc; } + + /* + * The response to this call was already factored into the sequence + * number when the call went out, so we must adjust it back downward + * after signing here. + */ + --server->sequence_number; rc = smb_send(server, in_buf, be32_to_cpu(in_buf->smb_buf_length)); mutex_unlock(&server->srv_mutex);