Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/833237/?format=api
{ "id": 833237, "url": "http://patchwork.ozlabs.org/api/1.2/patches/833237/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20171102070312.18903-3-lsahlber@redhat.com/", "project": { "id": 12, "url": "http://patchwork.ozlabs.org/api/1.2/projects/12/?format=api", "name": "Linux CIFS Client", "link_name": "linux-cifs-client", "list_id": "linux-cifs.vger.kernel.org", "list_email": "linux-cifs@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20171102070312.18903-3-lsahlber@redhat.com>", "list_archive_url": null, "date": "2017-11-02T07:02:55", "name": "[02/19] cifs: remove rfc1002 header from smb2_negotiate_req", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "f1be2a51b9db8ba45fa907ef4f326891eef068c3", "submitter": { "id": 72324, "url": "http://patchwork.ozlabs.org/api/1.2/people/72324/?format=api", "name": "Ronnie Sahlberg", "email": "lsahlber@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20171102070312.18903-3-lsahlber@redhat.com/mbox/", "series": [ { "id": 11445, "url": "http://patchwork.ozlabs.org/api/1.2/series/11445/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=11445", "date": "2017-11-02T07:03:12", "name": "cifs: remove rfc1002 header from all smb2 requests", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/11445/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/833237/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/833237/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linux-cifs-owner@vger.kernel.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-cifs-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=lsahlber@redhat.com" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3ySGM76PHWz9s7c\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 2 Nov 2017 18:05:39 +1100 (AEDT)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1754817AbdKBHFi (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tThu, 2 Nov 2017 03:05:38 -0400", "from mx1.redhat.com ([209.132.183.28]:35118 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1752966AbdKBHFi (ORCPT <rfc822;linux-cifs@vger.kernel.org>);\n\tThu, 2 Nov 2017 03:05:38 -0400", "from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 26FFDC0587DE;\n\tThu, 2 Nov 2017 07:05:38 +0000 (UTC)", "from test1190.test.redhat.com (vpn2-54-17.bne.redhat.com\n\t[10.64.54.17])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 73ADE60618;\n\tThu, 2 Nov 2017 07:05:36 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 26FFDC0587DE", "From": "Ronnie Sahlberg <lsahlber@redhat.com>", "To": "linux-cifs <linux-cifs@vger.kernel.org>", "Cc": "Steve French <smfrench@gmail.com>", "Subject": "[PATCH 02/19] cifs: remove rfc1002 header from smb2_negotiate_req", "Date": "Thu, 2 Nov 2017 18:02:55 +1100", "Message-Id": "<20171102070312.18903-3-lsahlber@redhat.com>", "In-Reply-To": "<20171102070312.18903-1-lsahlber@redhat.com>", "References": "<20171102070312.18903-1-lsahlber@redhat.com>", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.13", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tThu, 02 Nov 2017 07:05:38 +0000 (UTC)", "Sender": "linux-cifs-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<linux-cifs.vger.kernel.org>", "X-Mailing-List": "linux-cifs@vger.kernel.org" }, "content": "Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>\n---\n fs/cifs/smb2pdu.c | 26 +++++++++++---------------\n fs/cifs/smb2pdu.h | 2 +-\n 2 files changed, 12 insertions(+), 16 deletions(-)", "diff": "diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c\nindex 5331631386a2..2adb66cec917 100644\n--- a/fs/cifs/smb2pdu.c\n+++ b/fs/cifs/smb2pdu.c\n@@ -398,8 +398,8 @@ small_smb2_init(__le16 smb2_command, struct cifs_tcon *tcon,\n }\n \n #ifdef CONFIG_CIFS_SMB311\n-/* offset is sizeof smb2_negotiate_req - 4 but rounded up to 8 bytes */\n-#define OFFSET_OF_NEG_CONTEXT 0x68 /* sizeof(struct smb2_negotiate_req) - 4 */\n+/* offset is sizeof smb2_negotiate_req but rounded up to 8 bytes */\n+#define OFFSET_OF_NEG_CONTEXT 0x68 /* sizeof(struct smb2_negotiate_req) */\n \n \n #define SMB2_PREAUTH_INTEGRITY_CAPABILITIES\tcpu_to_le16(1)\n@@ -429,9 +429,7 @@ build_encrypt_ctxt(struct smb2_encryption_neg_context *pneg_ctxt)\n static void\n assemble_neg_contexts(struct smb2_negotiate_req *req)\n {\n-\n-\t/* +4 is to account for the RFC1001 len field */\n-\tchar *pneg_ctxt = (char *)req + OFFSET_OF_NEG_CONTEXT + 4;\n+\tchar *pneg_ctxt = (char *)req + OFFSET_OF_NEG_CONTEXT;\n \n \tbuild_preauth_ctxt((struct smb2_preauth_neg_context *)pneg_ctxt);\n \t/* Add 2 to size to round to 8 byte boundary */\n@@ -439,8 +437,6 @@ assemble_neg_contexts(struct smb2_negotiate_req *req)\n \tbuild_encrypt_ctxt((struct smb2_encryption_neg_context *)pneg_ctxt);\n \treq->NegotiateContextOffset = cpu_to_le32(OFFSET_OF_NEG_CONTEXT);\n \treq->NegotiateContextCount = cpu_to_le16(2);\n-\tinc_rfc1001_len(req, 4 + sizeof(struct smb2_preauth_neg_context)\n-\t\t\t+ sizeof(struct smb2_encryption_neg_context)); /* calculate hash */\n }\n #else\n static void assemble_neg_contexts(struct smb2_negotiate_req *req)\n@@ -477,6 +473,7 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)\n \tint blob_offset, blob_length;\n \tchar *security_blob;\n \tint flags = CIFS_NEG_OP;\n+\tunsigned int total_len;\n \n \tcifs_dbg(FYI, \"Negotiate protocol\\n\");\n \n@@ -485,30 +482,30 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)\n \t\treturn -EIO;\n \t}\n \n-\trc = small_smb2_init(SMB2_NEGOTIATE, NULL, (void **) &req);\n+\trc = smb2_plain_req_init(SMB2_NEGOTIATE, NULL, (void **) &req, &total_len);\n \tif (rc)\n \t\treturn rc;\n \n-\treq->hdr.sync_hdr.SessionId = 0;\n+\treq->sync_hdr.SessionId = 0;\n \n \tif (strcmp(ses->server->vals->version_string,\n \t\t SMB3ANY_VERSION_STRING) == 0) {\n \t\treq->Dialects[0] = cpu_to_le16(SMB30_PROT_ID);\n \t\treq->Dialects[1] = cpu_to_le16(SMB302_PROT_ID);\n \t\treq->DialectCount = cpu_to_le16(2);\n-\t\tinc_rfc1001_len(req, 4);\n+\t\ttotal_len += 4;\n \t} else if (strcmp(ses->server->vals->version_string,\n \t\t SMBDEFAULT_VERSION_STRING) == 0) {\n \t\treq->Dialects[0] = cpu_to_le16(SMB21_PROT_ID);\n \t\treq->Dialects[1] = cpu_to_le16(SMB30_PROT_ID);\n \t\treq->Dialects[2] = cpu_to_le16(SMB302_PROT_ID);\n \t\treq->DialectCount = cpu_to_le16(3);\n-\t\tinc_rfc1001_len(req, 6);\n+\t\ttotal_len += 6;\n \t} else {\n \t\t/* otherwise send specific dialect */\n \t\treq->Dialects[0] = cpu_to_le16(ses->server->vals->protocol_id);\n \t\treq->DialectCount = cpu_to_le16(1);\n-\t\tinc_rfc1001_len(req, 2);\n+\t\ttotal_len += 2;\n \t}\n \n \t/* only one of SMB2 signing flags may be set in SMB2 request */\n@@ -531,10 +528,9 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)\n \t\t\tassemble_neg_contexts(req);\n \t}\n \tiov[0].iov_base = (char *)req;\n-\t/* 4 for rfc1002 length field */\n-\tiov[0].iov_len = get_rfc1002_length(req) + 4;\n+\tiov[0].iov_len = total_len;\n \n-\trc = SendReceive2(xid, ses, iov, 1, &resp_buftype, flags, &rsp_iov);\n+\trc = SendReceive3(xid, ses, iov, 1, &resp_buftype, flags, &rsp_iov);\n \tcifs_small_buf_release(req);\n \trsp = (struct smb2_negotiate_rsp *)rsp_iov.iov_base;\n \t/*\ndiff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h\nindex c2ec934be968..0fe2382597ad 100644\n--- a/fs/cifs/smb2pdu.h\n+++ b/fs/cifs/smb2pdu.h\n@@ -195,7 +195,7 @@ struct smb2_symlink_err_rsp {\n #define SMB2_CLIENT_GUID_SIZE 16\n \n struct smb2_negotiate_req {\n-\tstruct smb2_hdr hdr;\n+\tstruct smb2_sync_hdr sync_hdr;\n \t__le16 StructureSize; /* Must be 36 */\n \t__le16 DialectCount;\n \t__le16 SecurityMode;\n", "prefixes": [ "02/19" ] }