All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: New Defects reported by Coverity Scan for linux-next weekly scan
       [not found] <60c8c255db7df_c93642aabada739a0965bf@prd-scan-dashboard-0.mail>
@ 2021-06-17  0:22 ` Darrick J. Wong
  0 siblings, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2021-06-17  0:22 UTC (permalink / raw)
  To: Allison Henderson; +Cc: xfs

Hey Allison,

Would you mind taking a look at this static checker report from the
build robot and fixing whatever it's complaining about, please? :)

--D

> ** CID 1505244:  Uninitialized variables  (UNINIT)
> /fs/xfs/libxfs/xfs_attr.c: 1481 in xfs_attr_remove_iter()
> 
> 
> ________________________________________________________________________________________________________
> *** CID 1505244:  Uninitialized variables  (UNINIT)
> /fs/xfs/libxfs/xfs_attr.c: 1481 in xfs_attr_remove_iter()
> 1475     		 * If the result is small enough, push it all into the inode.
> 1476     		 * This is our final state so it's safe to return a dirty
> 1477     		 * transaction.
> 1478     		 */
> 1479     		if (xfs_attr_is_leaf(dp))
> 1480     			error = xfs_attr_node_shrink(args, state);
> >>>     CID 1505244:  Uninitialized variables  (UNINIT)
> >>>     Using uninitialized value "error".
> 1481     		ASSERT(error != -EAGAIN);
> 1482     		break;
> 1483     	default:
> 1484     		ASSERT(0);
> 1485     		error = -EINVAL;
> 1486     		goto out;
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: New Defects reported by Coverity Scan for linux-next weekly scan
       [not found] ` <CAH2r5mtR7kRcCw=iUo+PGg8G=r-1EkdnP=in_DneEWG+HxYAsg@mail.gmail.com>
@ 2022-05-26  5:00   ` Steve French
  0 siblings, 0 replies; 3+ messages in thread
From: Steve French @ 2022-05-26  5:00 UTC (permalink / raw)
  To: ronnie sahlberg, CIFS

[-- Attachment #1: Type: text/plain, Size: 2965 bytes --]

Patch to fix this warning attached.


On Wed, May 25, 2022 at 8:20 AM Steve French <smfrench@gmail.com> wrote:
>
>
> ---------- Forwarded message ---------
> From: <scan-admin@coverity.com>
> Date: Wed, May 25, 2022, 07:40
> Subject: New Defects reported by Coverity Scan for linux-next weekly scan
> To: <smfrench@gmail.com>
>
>
> Hi,
>
> Please find the latest report on new defect(s) introduced to linux-next weekly scan, under component 'FS-CIFS',  found with Coverity Scan.
>
> 1 new defect(s) introduced to linux-next weekly scan, under component 'FS-CIFS',  found with Coverity Scan.
> 8 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
>
> New defect(s) Reported-by: Coverity Scan
> Showing 1 of 1 defect(s)
>
>
> ** CID 1518030:  Null pointer dereferences  (REVERSE_INULL)
> /fs/cifs/readdir.c: 1108 in cifs_readdir()
>
>
> ________________________________________________________________________________________________________
> *** CID 1518030:  Null pointer dereferences  (REVERSE_INULL)
> /fs/cifs/readdir.c: 1108 in cifs_readdir()
> 1102            mutex_unlock(&cfid->dirents.de_mutex);
> 1103
> 1104            /* Drop the cache while calling initiate_cifs_search and
> 1105             * find_cifs_entry in case there will be reconnects during
> 1106             * query_directory.
> 1107             */
> >>>     CID 1518030:  Null pointer dereferences  (REVERSE_INULL)
> >>>     Null-checking "cfid" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
> 1108            if (cfid) {
> 1109                    close_cached_dir(cfid);
> 1110                    cfid = NULL;
> 1111            }
> 1112
> 1113      cache_not_found:
>
>
> ________________________________________________________________________________________________________
> To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypWUaxuG23arlAOMqBtlZty8jbpwvvNgxXk-2FmAsxmR9vW5nmNrMx1IpP6MDN1J2o1ZPwtxoZUPo2TKCoVE0eHSfAENI_Y7VRim-2Fxl9fmAdBRyG05vGZHoQCljkdhUYA-2FoqqLzdRcgL8NozXbXPTeip3E1wASk61xAAnRXanfXB8LqcT-2FwRhZs3l5M6RJV5-2B2zB6Y0j8JQfWKe27e73bfQ89ydmxnVAo-2FNvbBaX8QEbpzR4h82JcBlVZ25OTy33cLsYDIu1bdssbL-2FRwadbu9lLJN4dI1rPIaINt6Tz-2FUs9gVfquk6Q-3D-3D
>
>   To manage Coverity Scan email notifications for "smfrench@gmail.com", click https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yped04pjJnmXOsUBtKYNIXxgDITOxfLjGd57Ifg09SfMSZeD9rHMtRaJqZq0ctXqp7fRP-2BE8DxRp97FczN2h9FJkLzTHr7qddqCt-2F0SoddBt8k3Bc5cgjF9mAUP8Y7F8MA-3DZijn_Y7VRim-2Fxl9fmAdBRyG05vGZHoQCljkdhUYA-2FoqqLzdRcgL8NozXbXPTeip3E1wASSXlY5Xi8QRgougxC7RmAR-2BgidemDBxQLu-2F-2FOpS2Zh8OHdzNbXM7fgjsc7G7CXW79mTq7LOgCUGW9AsSS2aHeMTf2wbRpkyvZyfZqM9bb3M7WbRjhjgXOfau8yW2ZBZRWbJ33EaXk-2FdabyWYlOoI-2B0Q-3D-3D
>


-- 
Thanks,

Steve

[-- Attachment #2: 0001-smb3-remove-unneeded-null-check-in-cifs_readdir.patch --]
[-- Type: text/x-patch, Size: 1405 bytes --]

From ff172e41dffbd7c319df593e8c87ec816623c96e Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Wed, 25 May 2022 23:56:07 -0500
Subject: [PATCH] smb3: remove unneeded null check in cifs_readdir

Coverity pointed out an unneeded check.

Addresses-Coverity: 1518030 ("Null pointer dereferences")
Cc: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/readdir.c | 6 ++----
 fs/cifs/smb2ops.c | 1 +
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index ccf34481d801..384cabdf47ca 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -1105,10 +1105,8 @@ int cifs_readdir(struct file *file, struct dir_context *ctx)
 	 * find_cifs_entry in case there will be reconnects during
 	 * query_directory.
 	 */
-	if (cfid) {
-		close_cached_dir(cfid);
-		cfid = NULL;
-	}
+	close_cached_dir(cfid);
+	cfid = NULL;
 
  cache_not_found:
 	/*
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 057d3f32cf8f..bc90f0bc1475 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -770,6 +770,7 @@ smb2_cached_lease_break(struct work_struct *work)
 /*
  * Open the and cache a directory handle.
  * Only supported for the root handle.
+ * If error then *cfid is not initialized.
  */
 int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
 		const char *path,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: New Defects reported by Coverity Scan for linux-next weekly scan
       [not found] <606f39c2c377f_1aed562adb26462f5449492@prd-scan-dashboard-0.mail>
@ 2021-04-09 14:04 ` Muhammad Usama Anjum
  0 siblings, 0 replies; 3+ messages in thread
From: Muhammad Usama Anjum @ 2021-04-09 14:04 UTC (permalink / raw)
  To: scan-admin, colin.king, kernel-janitors, linux-kernel; +Cc: musamaanjum

On Thu, 2021-04-08 at 17:13 +0000, scan-admin@coverity.com wrote:
> ** CID 1503714:    (DEADCODE)
> /drivers/staging/rtl8723bs/os_dep/ioctl_linux.c: 367 in wpa_set_auth_algs()
> /drivers/staging/rtl8723bs/os_dep/ioctl_linux.c: 357 in wpa_set_auth_algs()
> 
> 
> ________________________________________________________________________________________________________
> *** CID 1503714:    (DEADCODE)
> /drivers/staging/rtl8723bs/os_dep/ioctl_linux.c: 367 in wpa_set_auth_algs()
> 361     		padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
> 362     
> 363     		padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeShared;
> 364     		padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Shared;
> 365     	} else if (value & WLAN_AUTH_OPEN) {
> 366     		/* padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled; */
> > > >     CID 1503714:    (DEADCODE)
> > > >     Execution cannot reach this statement: "if (padapter->securitypriv....".
> 367     		if (padapter->securitypriv.ndisauthtype < Ndis802_11AuthModeWPAPSK) {
> 368     			padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
> 369     			padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Open;
> 370     		}
> 371     	} else {
> 372     		ret = -EINVAL;
> /drivers/staging/rtl8723bs/os_dep/ioctl_linux.c: 357 in wpa_set_auth_algs()
> 351     static int wpa_set_auth_algs(struct net_device *dev, u32 value)
> 352     {
> 353     	struct adapter *padapter = rtw_netdev_priv(dev);
> 354     	int ret = 0;
> 355     
> 356     	if ((value & WLAN_AUTH_SHARED_KEY) && (value & WLAN_AUTH_OPEN)) {

The value of WLAN_AUTH_OPEN macro is 0 and it is being treated as if
is a bit number. Two conditions in this function never execute. It
seems like a crucial bug. Anyone looking into it?

> > > >     CID 1503714:    (DEADCODE)
> > > >     Execution cannot reach this statement: "padapter->securitypriv.ndis...".
> 357     		padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
> 358     		padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeAutoSwitch;
> 359     		padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Auto;
> 360     	} else if (value & WLAN_AUTH_SHARED_KEY)	{
> 361     		padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
> 362     
> 
> ** CID 1487894:  Null pointer dereferences  (FORWARD_NULL)
> /net/ipv6/route.c: 5209 in ip6_route_multipath_add()



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-26  5:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <60c8c255db7df_c93642aabada739a0965bf@prd-scan-dashboard-0.mail>
2021-06-17  0:22 ` New Defects reported by Coverity Scan for linux-next weekly scan Darrick J. Wong
     [not found] <628e23acb5243_17eb1f2acf4460f9a8777f8@prd-scan-dashboard-0.mail>
     [not found] ` <CAH2r5mtR7kRcCw=iUo+PGg8G=r-1EkdnP=in_DneEWG+HxYAsg@mail.gmail.com>
2022-05-26  5:00   ` Steve French
     [not found] <606f39c2c377f_1aed562adb26462f5449492@prd-scan-dashboard-0.mail>
2021-04-09 14:04 ` Muhammad Usama Anjum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.