cifs: Fix uninitialized memory read in smb3_qfs_tcon()
authorVolker Lendecke <vl@samba.org>
Wed, 11 Jan 2023 11:37:58 +0000 (12:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:39:56 +0000 (09:39 +0100)
commit d447e794a37288ec7a080aa1b044a8d9deebbab7 upstream.

oparms was not fully initialized

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb2ops.c

index 817d78129bd2ef62e1e427b0699a073ac5ce2b29..1fef721f60c945bad6bde29b891a20a808ab8ac2 100644 (file)
@@ -966,12 +966,13 @@ smb3_qfs_tcon(const unsigned int xid, struct cifs_tcon *tcon,
        struct cifs_fid fid;
        struct cached_fid *cfid = NULL;
 
-       oparms.tcon = tcon;
-       oparms.desired_access = FILE_READ_ATTRIBUTES;
-       oparms.disposition = FILE_OPEN;
-       oparms.create_options = cifs_create_options(cifs_sb, 0);
-       oparms.fid = &fid;
-       oparms.reconnect = false;
+       oparms = (struct cifs_open_parms) {
+               .tcon = tcon,
+               .desired_access = FILE_READ_ATTRIBUTES,
+               .disposition = FILE_OPEN,
+               .create_options = cifs_create_options(cifs_sb, 0),
+               .fid = &fid,
+       };
 
        rc = open_cached_dir(xid, tcon, "", cifs_sb, &cfid);
        if (rc == 0)