Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ruben Devos and committed by
Steve French
f1e7a277 55423e9c

+3
+3
fs/smb/client/namespace.c
··· 146 146 } 147 147 spin_unlock(&tcon->tc_lock); 148 148 149 + if (unlikely(!page)) 150 + return ERR_PTR(-ENOMEM); 151 + 149 152 s = dentry_path_raw(dentry, page, PATH_MAX); 150 153 if (IS_ERR(s)) 151 154 return s;