mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 03:54:02 +00:00
do_last(): ELOOP failure exit should be done after leaving RCU mode
... or we risk seeing a bogus value of d_is_symlink() there. Cc: stable@vger.kernel.org # v4.2+ Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
a7f775428b
commit
5129fa482b
1 changed files with 4 additions and 5 deletions
|
@ -3211,11 +3211,6 @@ finish_lookup:
|
||||||
if (unlikely(error))
|
if (unlikely(error))
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
if (unlikely(d_is_symlink(path.dentry)) && !(open_flag & O_PATH)) {
|
|
||||||
path_to_nameidata(&path, nd);
|
|
||||||
return -ELOOP;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((nd->flags & LOOKUP_RCU) || nd->path.mnt != path.mnt) {
|
if ((nd->flags & LOOKUP_RCU) || nd->path.mnt != path.mnt) {
|
||||||
path_to_nameidata(&path, nd);
|
path_to_nameidata(&path, nd);
|
||||||
} else {
|
} else {
|
||||||
|
@ -3234,6 +3229,10 @@ finish_open:
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
audit_inode(nd->name, nd->path.dentry, 0);
|
audit_inode(nd->name, nd->path.dentry, 0);
|
||||||
|
if (unlikely(d_is_symlink(nd->path.dentry)) && !(open_flag & O_PATH)) {
|
||||||
|
error = -ELOOP;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
error = -EISDIR;
|
error = -EISDIR;
|
||||||
if ((open_flag & O_CREAT) && d_is_dir(nd->path.dentry))
|
if ((open_flag & O_CREAT) && d_is_dir(nd->path.dentry))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
Loading…
Add table
Reference in a new issue