diff options
author | Volker Lendecke <vl@samba.org> | 2023-01-11 12:37:58 +0100 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2023-02-20 11:48:48 -0600 |
commit | de036dcaca65cf94bf7ff09c571c077f02bc92b4 (patch) | |
tree | cf0ccb33f88531be01aa185c8fb5246f41d8c1b0 /fs/cifs/dir.c | |
parent | 5574920c7a6b0ce7f3d0888ccf1efb9b7870b928 (diff) | |
download | linux-de036dcaca65cf94bf7ff09c571c077f02bc92b4.tar.gz |
cifs: Fix uninitialized memory reads for oparms.mode
Use a struct assignment with implicit member initialization
Signed-off-by: Volker Lendecke <vl@samba.org>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r-- | fs/cifs/dir.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index ad4208bf1e3211..1bf61778f44c6f 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -304,15 +304,16 @@ static int cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned if (!tcon->unix_ext && (mode & S_IWUGO) == 0) create_options |= CREATE_OPTION_READONLY; - oparms.tcon = tcon; - oparms.cifs_sb = cifs_sb; - oparms.desired_access = desired_access; - oparms.create_options = cifs_create_options(cifs_sb, create_options); - oparms.disposition = disposition; - oparms.path = full_path; - oparms.fid = fid; - oparms.reconnect = false; - oparms.mode = mode; + oparms = (struct cifs_open_parms) { + .tcon = tcon, + .cifs_sb = cifs_sb, + .desired_access = desired_access, + .create_options = cifs_create_options(cifs_sb, create_options), + .disposition = disposition, + .path = full_path, + .fid = fid, + .mode = mode, + }; rc = server->ops->open(xid, &oparms, oplock, buf); if (rc) { cifs_dbg(FYI, "cifs_create returned 0x%x\n", rc); |