aboutsummaryrefslogtreecommitdiffstats
path: root/fs/smb/client/namespace.c
diff options
context:
space:
mode:
authorRuben Devos <devosruben6@gmail.com>2025-06-01 19:18:55 +0200
committerSteve French <stfrench@microsoft.com>2025-06-01 15:12:11 -0500
commitf1e7a277a1736e12cc4bd6d93b8a5c439b8ca20c (patch)
tree73fe278a302879e35348d2cb19896fe620fdeac6 /fs/smb/client/namespace.c
parentsmb: client: Remove an unused function and variable (diff)
downloadlinux-rng-f1e7a277a1736e12cc4bd6d93b8a5c439b8ca20c.tar.xz
linux-rng-f1e7a277a1736e12cc4bd6d93b8a5c439b8ca20c.zip
smb: client: add NULL check in automount_fullpath
page is checked for null in __build_path_from_dentry_optional_prefix when tcon->origin_fullpath is not set. However, the check is missing when it is set. Add a check to prevent a potential NULL pointer dereference. Signed-off-by: Ruben Devos <devosruben6@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client/namespace.c')
-rw-r--r--fs/smb/client/namespace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/smb/client/namespace.c b/fs/smb/client/namespace.c
index e3f9213131c4..a6655807c086 100644
--- a/fs/smb/client/namespace.c
+++ b/fs/smb/client/namespace.c
@@ -146,6 +146,9 @@ static char *automount_fullpath(struct dentry *dentry, void *page)
}
spin_unlock(&tcon->tc_lock);
+ if (unlikely(!page))
+ return ERR_PTR(-ENOMEM);
+
s = dentry_path_raw(dentry, page, PATH_MAX);
if (IS_ERR(s))
return s;