]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
cifs: Fix uninitialized memory read for smb311 posix symlink create
authorVolker Lendecke <vl@samba.org>
Wed, 11 Jan 2023 11:37:58 +0000 (12:37 +0100)
committerSteve French <stfrench@microsoft.com>
Thu, 12 Jan 2023 15:51:48 +0000 (09:51 -0600)
If smb311 posix is enabled, we send the intended mode for file
creation in the posix create context. Instead of using what's there on
the stack, create the mfsymlink file with 0644.

Fixes: ce558b0e17f8a ("smb3: Add posix create context for smb3.11 posix mounts")
Cc: stable@vger.kernel.org
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Tom Talpey <tom@talpey.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/link.c

index bd374feeccaa19f021fdd03a4adf8d8e31f7d9fe..a5a097a6998371f12e3c87820d186985cbe1b3f8 100644 (file)
@@ -428,6 +428,7 @@ smb3_create_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
        oparms.disposition = FILE_CREATE;
        oparms.fid = &fid;
        oparms.reconnect = false;
+       oparms.mode = 0644;
 
        rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, NULL,
                       NULL, NULL);