Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Murphy Zhou and committed by
Steve French
63d37fb4 8559ad8e

+1 -1
+1 -1
fs/cifs/xattr.c
··· 31 31 #include "cifs_fs_sb.h" 32 32 #include "cifs_unicode.h" 33 33 34 - #define MAX_EA_VALUE_SIZE 65535 34 + #define MAX_EA_VALUE_SIZE CIFSMaxBufSize 35 35 #define CIFS_XATTR_CIFS_ACL "system.cifs_acl" 36 36 #define CIFS_XATTR_ATTRIB "cifs.dosattrib" /* full name: user.cifs.dosattrib */ 37 37 #define CIFS_XATTR_CREATETIME "cifs.creationtime" /* user.cifs.creationtime */