Skip to content

Commit 9c57749

Browse files
committed
Merge branch 'work.dotdot1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs pathwalk sanitizing from Al Viro: "Massive pathwalk rewrite and cleanups. Several iterations have been posted; hopefully this thing is getting readable and understandable now. Pretty much all parts of pathname resolutions are affected... The branch is identical to what has sat in -next, except for commit message in "lift all calls of step_into() out of follow_dotdot/ follow_dotdot_rcu", crediting Qian Cai for reporting the bug; only commit message changed there." * 'work.dotdot1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (69 commits) lookup_open(): don't bother with fallbacks to lookup+create atomic_open(): no need to pass struct open_flags anymore open_last_lookups(): move complete_walk() into do_open() open_last_lookups(): lift O_EXCL|O_CREAT handling into do_open() open_last_lookups(): don't abuse complete_walk() when all we want is unlazy open_last_lookups(): consolidate fsnotify_create() calls take post-lookup part of do_last() out of loop link_path_walk(): sample parent's i_uid and i_mode for the last component __nd_alloc_stack(): make it return bool reserve_stack(): switch to __nd_alloc_stack() pick_link(): take reserving space on stack into a new helper pick_link(): more straightforward handling of allocation failures fold path_to_nameidata() into its only remaining caller pick_link(): pass it struct path already with normal refcounting rules fs/namei.c: kill follow_mount() non-RCU analogue of the previous commit helper for mount rootwards traversal follow_dotdot(): be lazy about changing nd->path follow_dotdot_rcu(): be lazy about changing nd->path follow_dotdot{,_rcu}(): massage loops ...
2 parents d987ca1 + 99a4a90 commit 9c57749

File tree

7 files changed

+687
-919
lines changed

7 files changed

+687
-919
lines changed

Documentation/filesystems/path-lookup.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,8 @@ that is the "next" component in the pathname.
404404
``int last_type``
405405
~~~~~~~~~~~~~~~~~
406406

407-
This is one of ``LAST_NORM``, ``LAST_ROOT``, ``LAST_DOT``, ``LAST_DOTDOT``, or
408-
``LAST_BIND``. The ``last`` field is only valid if the type is
409-
``LAST_NORM``. ``LAST_BIND`` is used when following a symlink and no
410-
components of the symlink have been processed yet. Others should be
411-
fairly self-explanatory.
407+
This is one of ``LAST_NORM``, ``LAST_ROOT``, ``LAST_DOT`` or ``LAST_DOTDOT``.
408+
The ``last`` field is only valid if the type is ``LAST_NORM``.
412409

413410
``struct path root``
414411
~~~~~~~~~~~~~~~~~~~~

fs/autofs/dev-ioctl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static int find_autofs_mount(const char *pathname,
186186
struct path path;
187187
int err;
188188

189-
err = kern_path_mountpoint(AT_FDCWD, pathname, &path, 0);
189+
err = kern_path(pathname, LOOKUP_MOUNTPOINT, &path);
190190
if (err)
191191
return err;
192192
err = -ENOENT;
@@ -519,8 +519,8 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp,
519519

520520
if (!fp || param->ioctlfd == -1) {
521521
if (autofs_type_any(type))
522-
err = kern_path_mountpoint(AT_FDCWD,
523-
name, &path, LOOKUP_FOLLOW);
522+
err = kern_path(name, LOOKUP_FOLLOW | LOOKUP_MOUNTPOINT,
523+
&path);
524524
else
525525
err = find_autofs_mount(name, &path,
526526
test_by_type, &type);

fs/internal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ extern int finish_clean_context(struct fs_context *fc);
6060
*/
6161
extern int filename_lookup(int dfd, struct filename *name, unsigned flags,
6262
struct path *path, struct path *root);
63-
extern int user_path_mountpoint_at(int, const char __user *, unsigned int, struct path *);
6463
extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
6564
const char *, unsigned int, struct path *);
6665
long do_mknodat(int dfd, const char __user *filename, umode_t mode,

0 commit comments

Comments
 (0)