From: Ruben Devos Date: Sun, 1 Jun 2025 17:18:55 +0000 (+0200) Subject: smb: client: add NULL check in automount_fullpath X-Git-Tag: v6.16-rc1~55^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f1e7a277a1736e12cc4bd6d93b8a5c439b8ca20c;p=thirdparty%2Flinux.git 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 Cc: stable@vger.kernel.org Signed-off-by: Steve French --- diff --git a/fs/smb/client/namespace.c b/fs/smb/client/namespace.c index e3f9213131c46..a6655807c0865 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;