mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-03 09:41:54 +09:00
vfs: fix return value from do_last()
commit 7f6c7e62fc upstream.
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: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
60d3a45057
commit
9a2317b6ce
@@ -2109,7 +2109,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
|
||||
/* sayonara */
|
||||
error = complete_walk(nd);
|
||||
if (error)
|
||||
return ERR_PTR(-ECHILD);
|
||||
return ERR_PTR(error);
|
||||
|
||||
error = -ENOTDIR;
|
||||
if (nd->flags & LOOKUP_DIRECTORY) {
|
||||
|
||||
Reference in New Issue
Block a user