summaryrefslogtreecommitdiff
path: root/fs/cifs/xattr.c
diff options
context:
space:
mode:
authorMurphy Zhou <jencce.kernel@gmail.com>2019-09-21 19:26:00 +0800
committerSteve French <stfrench@microsoft.com>2019-09-23 23:28:59 -0500
commit63d37fb4ce5ae7bf1e58f906d1bf25f036fe79b2 (patch)
tree6b113252bb7d07752f61e8983e72fca1649d71aa /fs/cifs/xattr.c
parent8559ad8e89185ca55d8c9ef1e0b20f58578a4055 (diff)
CIFS: fix max ea value size
It should not be larger then the slab max buf size. If user specifies a larger size, it passes this check and goes straightly to SMB2_set_info_init performing an insecure memcpy. Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com> Reviewed-by: Aurelien Aptel <aaptel@suse.com> CC: Stable <stable@vger.kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/xattr.c')
-rw-r--r--fs/cifs/xattr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c
index 9076150758d8..db4ba8f6077e 100644
--- a/fs/cifs/xattr.c
+++ b/fs/cifs/xattr.c
@@ -31,7 +31,7 @@
#include "cifs_fs_sb.h"
#include "cifs_unicode.h"
-#define MAX_EA_VALUE_SIZE 65535
+#define MAX_EA_VALUE_SIZE CIFSMaxBufSize
#define CIFS_XATTR_CIFS_ACL "system.cifs_acl"
#define CIFS_XATTR_ATTRIB "cifs.dosattrib" /* full name: user.cifs.dosattrib */
#define CIFS_XATTR_CREATETIME "cifs.creationtime" /* user.cifs.creationtime */