lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <91aeb350-89c6-44bb-8a2e-a629ee650c8b@web.de>
Date: Wed, 8 Oct 2025 22:24:50 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
 Bharath SM <bharathsm@...rosoft.com>, Paulo Alcantara <pc@...guebit.org>,
 Ronnie Sahlberg <ronniesahlberg@...il.com>,
 Shyam Prasad N <sprasad@...rosoft.com>, Steve French <sfrench@...ba.org>,
 Tom Talpey <tom@...pey.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org
Subject: [PATCH] smb: client: Use common code in smb3_notify()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 8 Oct 2025 22:16:59 +0200

Use an additional label so that a bit of common code can be better reused
at the end of this function implementation.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 fs/smb/client/smb2ops.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c
index 7c3e96260fd4..3a0fb4a4de86 100644
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -2369,15 +2369,12 @@ smb3_notify(const unsigned int xid, struct file *pfile,
 	}
 
 	if (return_changes) {
-		if (copy_from_user(&notify, ioc_buf, sizeof(struct smb3_notify_info))) {
-			rc = -EFAULT;
-			goto notify_exit;
-		}
+		if (copy_from_user(&notify, ioc_buf, sizeof(struct smb3_notify_info)))
+			goto e_fault;
 	} else {
-		if (copy_from_user(&notify, ioc_buf, sizeof(struct smb3_notify))) {
-			rc = -EFAULT;
-			goto notify_exit;
-		}
+		if (copy_from_user(&notify, ioc_buf, sizeof(struct smb3_notify)))
+			goto e_fault;
+
 		notify.data_len = 0;
 	}
 
@@ -2417,6 +2414,10 @@ smb3_notify(const unsigned int xid, struct file *pfile,
 	free_dentry_path(page);
 	kfree(utf16_path);
 	return rc;
+
+e_fault:
+	rc = -EFAULT;
+	goto notify_exit;
 }
 
 static int
-- 
2.51.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ