linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] cifs: modefromsid: make room for 4 ACE
@ 2019-09-16  2:28 Aurelien Aptel
  2019-09-16  2:28 ` [PATCH 2/2] cifs: modefromsid: write mode ACE with DENY first Aurelien Aptel
  0 siblings, 1 reply; 2+ messages in thread
From: Aurelien Aptel @ 2019-09-16  2:28 UTC (permalink / raw)
  To: linux-cifs; +Cc: smfrench, Aurelien Aptel

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>
---
 fs/cifs/cifsacl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h
index dd95a6fa24bf..eb428349f29a 100644
--- a/fs/cifs/cifsacl.h
+++ b/fs/cifs/cifsacl.h
@@ -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:
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-16  2:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-16  2:28 [PATCH 1/2] cifs: modefromsid: make room for 4 ACE Aurelien Aptel
2019-09-16  2:28 ` [PATCH 2/2] cifs: modefromsid: write mode ACE with DENY first Aurelien Aptel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).