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)
committerSteve French <stfrench@microsoft.com>
Mon, 20 Feb 2023 17:48:48 +0000 (11:48 -0600)
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>
fs/cifs/smb2ops.c

index 157a19f371d68e04554a9e5c8b285ad10cffa0dd..f22d36019ff4e81d03cf0f86a7227ff925aaac91 100644 (file)
@@ -729,12 +729,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, false, &cfid);
        if (rc == 0)