summaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2pdu.h
diff options
context:
space:
mode:
authorRonnie Sahlberg2018-09-03 05:33:50 +0200
committerSteve French2018-10-24 04:16:04 +0200
commit14e562ada2b152cdeb49a1aec40fac402d19f3ce (patch)
tree466df67b9258b0aae7bfb5bb0baea7a557ff3044 /fs/cifs/smb2pdu.h
parentcifs: change SMB2_OP_RENAME and SMB2_OP_HARDLINK to use compounding (diff)
downloadkernel-qcow2-linux-14e562ada2b152cdeb49a1aec40fac402d19f3ce.tar.gz
kernel-qcow2-linux-14e562ada2b152cdeb49a1aec40fac402d19f3ce.tar.xz
kernel-qcow2-linux-14e562ada2b152cdeb49a1aec40fac402d19f3ce.zip
cifs: create a define for the max number of iov we need for a SMB2 set_info
So we don't overflow the io vector arrays accidentally Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/smb2pdu.h')
-rw-r--r--fs/cifs/smb2pdu.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
index 8fb7887f2b3d..600e8fe1461b 100644
--- a/fs/cifs/smb2pdu.h
+++ b/fs/cifs/smb2pdu.h
@@ -1174,6 +1174,15 @@ struct smb2_query_info_rsp {
__u8 Buffer[1];
} __packed;
+/*
+ * Maximum number of iovs we need for a set-info request.
+ * The largest one is rename/hardlink
+ * [0] : struct smb2_set_info_req + smb2_file_[rename|link]_info
+ * [1] : path
+ * [2] : compound padding
+ */
+#define SMB2_SET_INFO_IOV_SIZE 3
+
struct smb2_set_info_req {
struct smb2_sync_hdr sync_hdr;
__le16 StructureSize; /* Must be 33 */