Skip to content

Commit 0511fdb

Browse files
author
Al Viro
committed
cifs_get_link(): bail out in unsafe case
->d_revalidate() bails out there, anyway. It's not enough to prevent getting into ->get_link() in RCU mode, but that could happen only in a very contrieved setup. Not worth trying to do anything fancy here unless ->d_revalidate() stops kicking out of RCU mode at least in some cases. Reviewed-by: Christian Brauner <brauner@kernel.org> Acked-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 053fc4f commit 0511fdb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/smb/client/cifsfs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,9 @@ const char *cifs_get_link(struct dentry *dentry, struct inode *inode,
11721172
{
11731173
char *target_path;
11741174

1175+
if (!dentry)
1176+
return ERR_PTR(-ECHILD);
1177+
11751178
target_path = kmalloc(PATH_MAX, GFP_KERNEL);
11761179
if (!target_path)
11771180
return ERR_PTR(-ENOMEM);

0 commit comments

Comments
 (0)