lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250523-vfs-cleanups-f29f2bd1fce7@brauner>
Date: Fri, 23 May 2025 14:36:59 +0200
From: Christian Brauner <brauner@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Christian Brauner <brauner@...nel.org>,
	linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [GIT PULL for v6.16] vfs lookup_{noperm,one}() cleanup

Hey Linus,

/* Summary */

This contains cleanups for the lookup_one*() family of helpers.

We expose a set of functions with names containing "lookup_one_len" and
others without the "_len".  This difference has nothing to do with
"len". It's rater a historical accident that can be confusing.

The functions without "_len" take a "mnt_idmap" pointer. This is found
in the "vfsmount" and that is an important question when choosing which
to use: do you have a vfsmount, or are you "inside" the filesystem. A
related question is "is permission checking relevant here?".

nfsd and cachefiles *do* have a vfsmount but *don't* use the non-_len
functions. They pass nop_mnt_idmap and refuse to work on filesystems
which have any other idmap.

This work changes nfsd and cachefile to use the lookup_one family of
functions and to explictily pass &nop_mnt_idmap which is consistent with
all other vfs interfaces used where &nop_mnt_idmap is explicitly passed.

The remaining uses of the "_one" functions do not require permission
checks so these are renamed to be "_noperm" and the permission checking
is removed.

This series also changes these lookup function to take a qstr instead of
separate name and len. In many cases this simplifies the call.

/* Testing */

gcc (Debian 14.2.0-19) 14.2.0
Debian clang version 19.1.7 (3)

No build failures or warnings were observed.

/* Conflicts */

Merge conflicts with mainline
=============================

No known conflicts.

Merge conflicts with other trees
================================

No known conflicts.

The following changes since commit 0af2f6be1b4281385b618cb86ad946eded089ac8:

  Linux 6.15-rc1 (2025-04-06 13:11:33 -0700)

are available in the Git repository at:

  git@...olite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-6.16-rc1.async.dir

for you to fetch changes up to 4e5c53e03806359e68dde5e951e50cd1f4908405:

  Merge patch series "VFS: improve interface for lookup_one functions" (2025-04-08 11:24:42 +0200)

Please consider pulling these changes from the signed vfs-6.16-rc1.async.dir tag.

Thanks!
Christian

----------------------------------------------------------------
vfs-6.16-rc1.async.dir

----------------------------------------------------------------
Christian Brauner (1):
      Merge patch series "VFS: improve interface for lookup_one functions"

NeilBrown (6):
      VFS: improve interface for lookup_one functions
      nfsd: Use lookup_one() rather than lookup_one_len()
      cachefiles: Use lookup_one() rather than lookup_one_len()
      VFS: rename lookup_one_len family to lookup_noperm and remove permission check
      Use try_lookup_noperm() instead of d_hash_and_lookup() outside of VFS
      VFS: change lookup_one_common and lookup_noperm_common to take a qstr

 Documentation/filesystems/porting.rst |  40 +++++++++
 arch/s390/hypfs/inode.c               |   2 +-
 drivers/android/binderfs.c            |   4 +-
 drivers/infiniband/hw/qib/qib_fs.c    |   4 +-
 fs/afs/dir.c                          |   2 +-
 fs/afs/dir_silly.c                    |   6 +-
 fs/autofs/dev-ioctl.c                 |   3 +-
 fs/binfmt_misc.c                      |   2 +-
 fs/btrfs/ioctl.c                      |   9 +-
 fs/cachefiles/internal.h              |   1 -
 fs/cachefiles/key.c                   |   1 -
 fs/cachefiles/namei.c                 |  14 +--
 fs/dcache.c                           |   1 -
 fs/debugfs/inode.c                    |   6 +-
 fs/ecryptfs/inode.c                   |  16 ++--
 fs/efivarfs/super.c                   |  15 ++--
 fs/exportfs/expfs.c                   |   5 +-
 fs/internal.h                         |   1 +
 fs/kernfs/mount.c                     |   2 +-
 fs/namei.c                            | 156 +++++++++++++++++-----------------
 fs/nfs/unlink.c                       |  11 ++-
 fs/nfsd/nfs3proc.c                    |   4 +-
 fs/nfsd/nfs3xdr.c                     |   4 +-
 fs/nfsd/nfs4proc.c                    |   4 +-
 fs/nfsd/nfs4recover.c                 |  13 +--
 fs/nfsd/nfs4xdr.c                     |   4 +-
 fs/nfsd/nfsproc.c                     |   5 +-
 fs/nfsd/vfs.c                         |  17 ++--
 fs/overlayfs/export.c                 |   6 +-
 fs/overlayfs/namei.c                  |  14 +--
 fs/overlayfs/overlayfs.h              |   2 +-
 fs/overlayfs/readdir.c                |   9 +-
 fs/proc/base.c                        |   2 +-
 fs/quota/dquot.c                      |   2 +-
 fs/smb/client/cached_dir.c            |   5 +-
 fs/smb/client/cifsfs.c                |   3 +-
 fs/smb/client/readdir.c               |   3 +-
 fs/smb/server/smb2pdu.c               |   7 +-
 fs/tracefs/inode.c                    |   2 +-
 fs/xfs/scrub/orphanage.c              |   7 +-
 include/linux/dcache.h                |   4 +-
 include/linux/namei.h                 |  17 ++--
 ipc/mqueue.c                          |   5 +-
 kernel/bpf/inode.c                    |   2 +-
 net/sunrpc/rpc_pipe.c                 |  12 +--
 security/apparmor/apparmorfs.c        |   4 +-
 security/inode.c                      |   2 +-
 security/selinux/selinuxfs.c          |   4 +-
 48 files changed, 254 insertions(+), 210 deletions(-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ