]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.4.83/cifs-adjust-sequence-number-downward-after-signing-nt_cancel-request.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.4.83 / cifs-adjust-sequence-number-downward-after-signing-nt_cancel-request.patch
1 From f6f82cba2ccbf6a77278c7c3f2e4daf23063944a Mon Sep 17 00:00:00 2001
2 From: Jeff Layton <jlayton@redhat.com>
3 Date: Thu, 27 Dec 2012 08:05:03 -0500
4 Subject: cifs: adjust sequence number downward after signing NT_CANCEL request
5
6 From: Jeff Layton <jlayton@redhat.com>
7
8 commit 31efee60f489c759c341454d755a9fd13de8c03d upstream.
9
10 When a call goes out, the signing code adjusts the sequence number
11 upward by two to account for the request and the response. An NT_CANCEL
12 however doesn't get a response of its own, it just hurries the server
13 along to get it to respond to the original request more quickly.
14 Therefore, we must adjust the sequence number back down by one after
15 signing a NT_CANCEL request.
16
17 Reported-by: Tim Perry <tdparmor-sambabugs@yahoo.com>
18 Signed-off-by: Jeff Layton <jlayton@redhat.com>
19 Signed-off-by: Steve French <smfrench@gmail.com>
20 [bwh: Backported to 3.2: adjust filename]
21 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
22 Cc: Rui Xiang <rui.xiang@huawei.com>
23 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24
25 ---
26 fs/cifs/transport.c | 7 +++++++
27 1 file changed, 7 insertions(+)
28
29 --- a/fs/cifs/transport.c
30 +++ b/fs/cifs/transport.c
31 @@ -511,6 +511,13 @@ send_nt_cancel(struct TCP_Server_Info *s
32 mutex_unlock(&server->srv_mutex);
33 return rc;
34 }
35 +
36 + /*
37 + * The response to this call was already factored into the sequence
38 + * number when the call went out, so we must adjust it back downward
39 + * after signing here.
40 + */
41 + --server->sequence_number;
42 rc = smb_send(server, in_buf, be32_to_cpu(in_buf->smb_buf_length));
43 mutex_unlock(&server->srv_mutex);
44