From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5D2033EC for ; Mon, 16 Jan 2023 15:56:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E1AEC433D2; Mon, 16 Jan 2023 15:56:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673884568; bh=Gq3FUgU9XTso0yZnbVpNl0BOHlb8C6A4IaHqKpIY3fI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bUlbD/4a0wXp0QyH3rKKiqoAYmQwm5LtBebWdWvBp7sG9hBGP/ILHN7tJyMIokbay 4yW6rAdjOKCCa5w3c77c/uhGU8Pjb5zCqMshaSATFD/7WFnOrEq4+K9oFFKAU4dcPU LczF9dslwyIhB+XfBImSlHkNfsjC/YSn+Yc1atCk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Volker Lendecke , Tom Talpey , "Paulo Alcantara (SUSE)" , Steve French Subject: [PATCH 6.1 038/183] cifs: Fix uninitialized memory read for smb311 posix symlink create Date: Mon, 16 Jan 2023 16:49:21 +0100 Message-Id: <20230116154804.991119873@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116154803.321528435@linuxfoundation.org> References: <20230116154803.321528435@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Volker Lendecke 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 --- fs/cifs/link.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/cifs/link.c +++ b/fs/cifs/link.c @@ -428,6 +428,7 @@ smb3_create_mf_symlink(unsigned int xid, 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);