summaryrefslogtreecommitdiff
path: root/fs/cifs
diff options
context:
space:
mode:
authorMurphy Zhou <jencce.kernel@gmail.com>2019-09-21 19:26:00 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-05 12:48:12 +0200
commit786292c6b9fe2f6a330a232ef88c2ab0e1ffd74a (patch)
treeaba90983f5fbab2a5ec232d94fd2bbbcee1ff315 /fs/cifs
parent0c98d9c3d49205bb9e1f9a73e5d5453bb71257b4 (diff)
CIFS: fix max ea value size
commit 63d37fb4ce5ae7bf1e58f906d1bf25f036fe79b2 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/cifs')
-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 52f975d848a0..26219d9db575 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 */