summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2023-01-11 12:37:58 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-18 11:30:52 +0100
commit707682dbab5b61d6b7a95b05491b476510aeeb64 (patch)
tree7d29558c48960fd331ad64529a6ee9143ac8ebff /fs/cifs
parent5b2ea7e91352165054c5b3f8e5442cd31c3e73f9 (diff)
downloadlinux-stable-707682dbab5b61d6b7a95b05491b476510aeeb64.tar.gz
linux-stable-707682dbab5b61d6b7a95b05491b476510aeeb64.tar.bz2
linux-stable-707682dbab5b61d6b7a95b05491b476510aeeb64.zip
cifs: Fix uninitialized memory read for smb311 posix symlink create
commit a152d05ae4a71d802d50cf9177dba34e8bb09f68 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/link.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index 5b1c33d9283a..f590149e21ba 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -481,6 +481,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);