summaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2proto.h
diff options
context:
space:
mode:
authorPaulo Alcantara <paulo@paulo.ac>2018-06-15 10:22:44 -0300
committerSteve French <stfrench@microsoft.com>2018-06-15 19:17:40 -0500
commit35e2cc1ba755cf9dbd042e308b2928c868767a98 (patch)
tree7a4480897728404002b2a388f6f4245c902e90b4 /fs/cifs/smb2proto.h
parentd819d298c7258849d56eb400be436aff3ba2aae2 (diff)
downloadlinux-35e2cc1ba755cf9dbd042e308b2928c868767a98.tar.gz
linux-35e2cc1ba755cf9dbd042e308b2928c868767a98.tar.bz2
linux-35e2cc1ba755cf9dbd042e308b2928c868767a98.zip
cifs: Use correct packet length in SMB2_TRANSFORM header
In smb3_init_transform_rq(), 'orig_len' was only counting the request length, but forgot to count any data pages in the request. Writing or creating files with the 'seal' mount option was broken. In addition, do some code refactoring by exporting smb2_rqst_len() to calculate the appropriate packet size and avoid duplicating the same calculation all over the code. The start of the io vector is either the rfc1002 length (4 bytes) or a SMB2 header which is always > 4. Use this fact to check and skip the rfc1002 length if requested. Signed-off-by: Paulo Alcantara <palcantara@suse.de> Reviewed-by: Aurelien Aptel <aaptel@suse.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/smb2proto.h')
-rw-r--r--fs/cifs/smb2proto.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/cifs/smb2proto.h b/fs/cifs/smb2proto.h
index 78371c1a6503..3ae208ac2a77 100644
--- a/fs/cifs/smb2proto.h
+++ b/fs/cifs/smb2proto.h
@@ -113,6 +113,8 @@ extern int smb2_unlock_range(struct cifsFileInfo *cfile,
extern int smb2_push_mandatory_locks(struct cifsFileInfo *cfile);
extern void smb2_reconnect_server(struct work_struct *work);
extern int smb3_crypto_aead_allocate(struct TCP_Server_Info *server);
+extern unsigned long
+smb2_rqst_len(struct smb_rqst *rqst, bool skip_rfc1002_marker);
/*
* SMB2 Worker functions - most of protocol specific implementation details