From: Murphy Zhou Date: Sat, 21 Sep 2019 11:26:00 +0000 (+0800) Subject: CIFS: fix max ea value size X-Git-Tag: v3.16.79~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4e46ee82413a78d41945e4e60e2121fd6c8b0f8;p=thirdparty%2Fkernel%2Fstable.git 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 Reviewed-by: Aurelien Aptel Signed-off-by: Steve French [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c index 5ac836a86b188..16dc931ea787c 100644 --- a/fs/cifs/xattr.c +++ b/fs/cifs/xattr.c @@ -29,7 +29,7 @@ #include "cifsproto.h" #include "cifs_debug.h" -#define MAX_EA_VALUE_SIZE 65535 +#define MAX_EA_VALUE_SIZE CIFSMaxBufSize #define CIFS_XATTR_DOS_ATTRIB "user.DosAttrib" #define CIFS_XATTR_CIFS_ACL "system.cifs_acl"