Fwd: [PATCH][SMB3 client] minor coverity fix for unitialized MBZ ACL fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---------- Forwarded message ---------
From: Steve French <smfrench@xxxxxxxxx>
Date: Fri, Oct 14, 2022 at 7:25 PM
Subject: Re: [PATCH][SMB3 client] minor coverity fix for unitialized
MBZ ACL fields
To: CIFS <linux-cifs@xxxxxxxxxxxxxxx>
Cc: Paulo Alcantara <pc@xxxxxx>


And one more similar one (although probably more minor)

    cifs: lease key is uninitialized in smb1 paths

    It is cleaner to set lease key to zero in the places where leases are not
    supported (smb1 can not return lease keys so the field was uninitialized).

    Addresses-Coverity: 1513994 ("Uninitialized scalar variable")

See attached.


On Fri, Oct 14, 2022 at 6:57 PM Steve French <smfrench@xxxxxxxxx> wrote:
>
> smb3: must initialize two ACL struct fields to zero
>
> Coverity spotted that we were not initalizing Stbz1 and Stbz2 to
> zero in create_sd_buf.
>
> Addresses-Coverity: 1513848 ("Uninitialized scalar variable")
>
> See attached
>
> --
> Thanks,
>
> Steve



-- 
Thanks,

Steve


-- 
Thanks,

Steve
From 56f91de8f17a8d65a87638e9c6ae4c5163cd65a9 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Fri, 14 Oct 2022 19:18:32 -0500
Subject: [PATCH] cifs: lease key is uninitialized in smb1 paths

It is cleaner to set lease key to zero in the places where leases are not
supported (smb1 can not return lease keys so the field was uninitialized).

Addresses-Coverity: 1513994 ("Uninitialized scalar variable")
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index cbd46ac59cd2..a5c73c2af3a2 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -413,7 +413,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
 	struct tcon_link *tlink;
 	struct cifs_tcon *tcon;
 	struct TCP_Server_Info *server;
-	struct cifs_fid fid;
+	struct cifs_fid fid = {};
 	struct cifs_pending_open open;
 	__u32 oplock;
 	struct cifsFileInfo *file_info;
-- 
2.34.1


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux