]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cifs: refactor create_sd_buf() and and avoid corrupting the buffer
authorRonnie Sahlberg <lsahlber@redhat.com>
Mon, 30 Nov 2020 01:29:20 +0000 (11:29 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Dec 2020 12:22:06 +0000 (13:22 +0100)
commit21ba03ff5aee160f66f7a595c2e99e4f23a20243
tree55081aff9079101e7e54473b17be5cfa7bbcc947
parent08a257a3ff0c3947b5d8de06588a148d2ec2bcc2
cifs: refactor create_sd_buf() and and avoid corrupting the buffer

commit ea64370bcae126a88cd26a16f1abcc23ab2b9a55 upstream.

When mounting with "idsfromsid" mount option, Azure
corrupted the owner SIDs due to excessive padding
caused by placing the owner fields at the end of the
security descriptor on create.  Placing owners at the
front of the security descriptor (rather than the end)
is also safer, as the number of ACEs (that follow it)
are variable.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Suggested-by: Rohith Surabattula <rohiths@microsoft.com>
CC: Stable <stable@vger.kernel.org> # v5.8
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb2pdu.c
fs/cifs/smb2pdu.h