提交 7f6c7e62 编写于 作者: M Miklos Szeredi 提交者: Al Viro

vfs: fix return value from do_last()

complete_walk() returns either ECHILD or ESTALE.  do_last() turns this into
ECHILD unconditionally.  If not in RCU mode, this error will reach userspace
which is complete nonsense.
Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
CC: stable@vger.kernel.org
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 097b180c
...@@ -2162,7 +2162,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path, ...@@ -2162,7 +2162,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
/* sayonara */ /* sayonara */
error = complete_walk(nd); error = complete_walk(nd);
if (error) if (error)
return ERR_PTR(-ECHILD); return ERR_PTR(error);
error = -ENOTDIR; error = -ENOTDIR;
if (nd->flags & LOOKUP_DIRECTORY) { if (nd->flags & LOOKUP_DIRECTORY) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册