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: <9394c1f6-24ef-4557-b9b8-4e3a96659ed3@web.de>
Date: Sat, 4 Oct 2025 19:09:35 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: linux-cifs@...r.kernel.org, Namjae Jeon <linkinjeon@...nel.org>,
 Sergey Senozhatsky <senozhatsky@...omium.org>,
 Steve French <smfrench@...il.com>, Tom Talpey <tom@...pey.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org,
 Neil Brown <neil@...wn.name>, Stefan Metzmacher <metze@...ba.org>
Subject: [PATCH] ksmbd: Avoid duplicate variable assignment in
 ksmbd_vfs_path_lookup()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sat, 4 Oct 2025 18:56:18 +0200

Move a variable assignment into an else branch so that the variable
will not be reassigned in case an empty string was detected in
this function implementation.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 fs/smb/server/vfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c
index 891ed2dc2b73..bef6761760a4 100644
--- a/fs/smb/server/vfs.c
+++ b/fs/smb/server/vfs.c
@@ -73,7 +73,7 @@ static int ksmbd_vfs_path_lookup(struct ksmbd_share_config *share_conf,
 {
 	struct qstr last;
 	struct filename *filename __free(putname) = NULL;
-	const struct path *root_share_path = &share_conf->vfs_path;
+	const struct path *root_share_path;
 	int err, type;
 	struct dentry *d;
 
@@ -82,6 +82,7 @@ static int ksmbd_vfs_path_lookup(struct ksmbd_share_config *share_conf,
 		root_share_path = NULL;
 	} else {
 		flags |= LOOKUP_BENEATH;
+		root_share_path = &share_conf->vfs_path;
 	}
 
 	filename = getname_kernel(pathname);
-- 
2.51.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ