From: Volker Lendecke Date: Wed, 11 Jan 2023 11:37:58 +0000 (+0100) Subject: cifs: Fix uninitialized memory read for smb311 posix symlink create X-Git-Tag: v5.15.92~411 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0072068adaf9ff224c17dc56ed3f02c5621de80;p=platform%2Fkernel%2Flinux-rpi.git 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 Reviewed-by: Tom Talpey Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/cifs/link.c b/fs/cifs/link.c index bbdf328..4308b27 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c @@ -459,6 +459,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);