cifs: modefromsid: make room for 4 ACE
authorAurelien Aptel <aaptel@suse.com>
Mon, 16 Sep 2019 02:28:36 +0000 (04:28 +0200)
committerSteve French <stfrench@microsoft.com>
Mon, 16 Sep 2019 16:43:38 +0000 (11:43 -0500)
when mounting with modefromsid, we end up writing 4 ACE in a security
descriptor that only has room for 3, thus triggering an out-of-bounds
write. fix this by changing the min size of a security descriptor.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifsacl.h

index dd95a6f..eb42834 100644 (file)
@@ -45,7 +45,7 @@
  */
 #define DEFAULT_SEC_DESC_LEN (sizeof(struct cifs_ntsd) + \
                              sizeof(struct cifs_acl) + \
-                             (sizeof(struct cifs_ace) * 3))
+                             (sizeof(struct cifs_ace) * 4))
 
 /*
  * Maximum size of a string representation of a SID: