Skip to content

Commit ebccbea

Browse files
Miklos Szeredigregkh
authored andcommitted
vfs: fix return value from do_last()
commit 7f6c7e6 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>
1 parent 9899616 commit ebccbea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/namei.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2139,7 +2139,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
21392139
/* sayonara */
21402140
error = complete_walk(nd);
21412141
if (error)
2142-
return ERR_PTR(-ECHILD);
2142+
return ERR_PTR(error);
21432143

21442144
error = -ENOTDIR;
21452145
if (nd->flags & LOOKUP_DIRECTORY) {

0 commit comments

Comments
 (0)