summaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2pdu.h
diff options
context:
space:
mode:
authorRonnie Sahlberg <lsahlber@redhat.com>2017-09-28 09:39:58 +1000
committerSteve French <smfrench@gmail.com>2017-10-18 11:52:39 -0500
commit7cb3def44ce834e5ea462fd900505af4cd68b3d5 (patch)
tree0dd9ce55764c6c44d2a851e63770cbe8ee0fc078 /fs/cifs/smb2pdu.h
parent06e2290844fa408d3295ac03a1647f0798518ebe (diff)
downloadlinux-stable-7cb3def44ce834e5ea462fd900505af4cd68b3d5.tar.gz
linux-stable-7cb3def44ce834e5ea462fd900505af4cd68b3d5.tar.bz2
linux-stable-7cb3def44ce834e5ea462fd900505af4cd68b3d5.zip
cifs: handle large EA requests more gracefully in smb2+
Update reading the EA using increasingly larger buffer sizes until the response will fit in the buffer, or we exceed the (arbitrary) maximum set to 64kb. Without this change, a user is able to add more and more EAs using setfattr until the point where the total space of all EAs exceed 2kb at which point the user can no longer list the EAs at all and getfattr will abort with an error. The same issue still exists for EAs in SMB1. Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Reported-by: Xiaoli Feng <xifeng@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2pdu.h')
-rw-r--r--fs/cifs/smb2pdu.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
index 6c9653a130c8..4c155b95b558 100644
--- a/fs/cifs/smb2pdu.h
+++ b/fs/cifs/smb2pdu.h
@@ -1178,7 +1178,8 @@ struct smb2_file_link_info { /* encoding of request for level 11 */
char FileName[0]; /* Name to be assigned to new link */
} __packed; /* level 11 Set */
-#define SMB2_MAX_EA_BUF 2048
+#define SMB2_MIN_EA_BUF 2048
+#define SMB2_MAX_EA_BUF 65536
struct smb2_file_full_ea_info { /* encoding of response for level 15 */
__le32 next_entry_offset;