linux-stable/fs
NeilBrown fa6fe07d15
VFS: rename lookup_one_len family to lookup_noperm and remove permission check
The lookup_one_len family of functions is (now) only used internally by
a filesystem on itself either
- in a context where permission checking is irrelevant such as by a
  virtual filesystem populating itself, or xfs accessing its ORPHANAGE
  or dquota accessing the quota file; or
- in a context where a permission check (MAY_EXEC on the parent) has just
  been performed such as a network filesystem finding in "silly-rename"
  file in the same directory.  This is also the context after the
  _parentat() functions where currently lookup_one_qstr_excl() is used.

So the permission check is pointless.

The name "one_len" is unhelpful in understanding the purpose of these
functions and should be changed.  Most of the callers pass the len as
"strlen()" so using a qstr and QSTR() can simplify the code.

This patch renames these functions (include lookup_positive_unlocked()
which is part of the family despite the name) to have a name based on
"lookup_noperm".  They are changed to receive a 'struct qstr' instead
of separate name and len.  In a few cases the use of QSTR() results in a
new call to strlen().

try_lookup_noperm() takes a pointer to a qstr instead of the whole
qstr.  This is consistent with d_hash_and_lookup() (which is nearly
identical) and useful for lookup_noperm_unlocked().

The new lookup_noperm_common() doesn't take a qstr yet.  That will be
tidied up in a subsequent patch.

Signed-off-by: NeilBrown <neil@brown.name>
Link: https://lore.kernel.org/r/20250319031545.2999807-5-neil@brown.name
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-04-08 11:24:36 +02:00
..
9p 9p update for 6.15-rc1 2025-04-03 15:35:46 -07:00
adfs
affs vfs-6.15-rc1.async.dir 2025-03-24 10:47:14 -07:00
afs VFS: rename lookup_one_len family to lookup_noperm and remove permission check 2025-04-08 11:24:36 +02:00
autofs VFS: rename lookup_one_len family to lookup_noperm and remove permission check 2025-04-08 11:24:36 +02:00
bcachefs treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
befs
bfs
btrfs VFS: improve interface for lookup_one functions 2025-04-07 09:25:32 +02:00
cachefiles cachefiles: Use lookup_one() rather than lookup_one_len() 2025-04-07 09:25:32 +02:00
ceph vfs-6.15-rc1.ceph 2025-03-24 12:17:13 -07:00
coda
configfs
cramfs
crypto for-6.15/block-20250322 2025-03-26 18:08:55 -07:00
debugfs VFS: rename lookup_one_len family to lookup_noperm and remove permission check 2025-04-08 11:24:36 +02:00
devpts
dlm dlm: make tcp still work in multi-link env 2025-03-18 10:49:22 -05:00
ecryptfs VFS: rename lookup_one_len family to lookup_noperm and remove permission check 2025-04-08 11:24:36 +02:00
efivarfs EFI updates for v6.15 2025-03-29 11:36:19 -07:00
efs
erofs erofs: enable 48-bit layout support 2025-03-17 14:02:16 +08:00
exfat exfat: call bh_read in get_block only when necessary 2025-03-29 22:03:11 +09:00
exportfs VFS: improve interface for lookup_one functions 2025-04-07 09:25:32 +02:00
ext2 \n 2025-03-31 17:53:44 -07:00
ext4 treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
f2fs f2fs-for-6.15-rc1 2025-03-27 12:55:54 -07:00
fat
freevxfs
fuse fuse update for 6.15 2025-04-02 16:36:59 -07:00
gfs2 gfs2 changes 2025-03-27 12:09:25 -07:00
hfs
hfsplus
hostfs Updates for UML for this cycle, notably: 2025-04-02 12:25:03 -07:00
hpfs
hugetlbfs - The 6 patch series "Enable strict percpu address space checks" from 2025-04-01 09:29:18 -07:00
iomap - The 6 patch series "Enable strict percpu address space checks" from 2025-04-01 09:29:18 -07:00
isofs
jbd2 treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
jffs2 treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
jfs Various bug fixes and cleanups for JFS 2025-03-27 13:17:39 -07:00
kernfs VFS: rename lookup_one_len family to lookup_noperm and remove permission check 2025-04-08 11:24:36 +02:00
lockd sysctl: Fixes nsm_local_state bounds 2025-03-10 09:11:13 -04:00
minix
netfs netfs: Fix netfs_unbuffered_read() to return ssize_t rather than int 2025-03-19 10:04:23 +01:00
nfs VFS: rename lookup_one_len family to lookup_noperm and remove permission check 2025-04-08 11:24:36 +02:00
nfs_common fs: nfs: acl: Avoid -Wflex-array-member-not-at-end warning 2025-03-10 09:11:04 -04:00
nfsd nfsd: Use lookup_one() rather than lookup_one_len() 2025-04-07 09:25:32 +02:00
nilfs2 treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
nls
notify vfs-6.15-rc1.mount 2025-03-24 09:34:10 -07:00
ntfs3 Changes for 6.15-rc1 2025-04-02 16:30:02 -07:00
ocfs2 treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
omfs
openpromfs
orangefs orangefs: one fixup 2025-03-27 13:14:39 -07:00
overlayfs VFS: rename lookup_one_len family to lookup_noperm and remove permission check 2025-04-08 11:24:36 +02:00
proc - The 7 patch series "powerpc/crash: use generic crashkernel 2025-04-01 10:06:52 -07:00
pstore treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
qnx4
qnx6
quota VFS: rename lookup_one_len family to lookup_noperm and remove permission check 2025-04-08 11:24:36 +02:00
ramfs
romfs
smb VFS: rename lookup_one_len family to lookup_noperm and remove permission check 2025-04-08 11:24:36 +02:00
squashfs squashfs: fix invalid pointer dereference in squashfs_cache_delete 2025-03-16 17:40:24 -07:00
sysfs
tests
tracefs VFS: rename lookup_one_len family to lookup_noperm and remove permission check 2025-04-08 11:24:36 +02:00
ubifs This update includes the following changes: 2025-03-29 10:01:55 -07:00
udf - The 6 patch series "Enable strict percpu address space checks" from 2025-04-01 09:29:18 -07:00
ufs
unicode
vboxsf vfs-6.15-rc1.async.dir 2025-03-24 10:47:14 -07:00
verity
xfs VFS: rename lookup_one_len family to lookup_noperm and remove permission check 2025-04-08 11:24:36 +02:00
zonefs
aio.c
anon_inodes.c
attr.c
backing-file.c
bad_inode.c
binfmt_elf_fdpic.c binfmt_elf_fdpic: fix variable set but not used warning 2025-03-07 20:07:33 -08:00
binfmt_elf.c
binfmt_flat.c
binfmt_misc.c VFS: rename lookup_one_len family to lookup_noperm and remove permission check 2025-04-08 11:24:36 +02:00
binfmt_script.c
bpf_fs_kfuncs.c
buffer.c - The 6 patch series "Enable strict percpu address space checks" from 2025-04-01 09:29:18 -07:00
char_dev.c
compat_binfmt_elf.c
coredump.c Summary 2025-03-26 21:02:05 -07:00
d_path.c
dax.c - The 6 patch series "Enable strict percpu address space checks" from 2025-04-01 09:29:18 -07:00
dcache.c Summary 2025-03-26 21:02:05 -07:00
direct-io.c
drop_caches.c
eventfd.c
eventpoll.c Networking changes for 6.15. 2025-03-26 21:48:21 -07:00
exec.c rseq: Eliminate useless task_work on execve 2025-04-03 13:10:47 +02:00
fcntl.c
fhandle.c
file_table.c vfs-6.15-rc1.file 2025-03-24 13:19:17 -07:00
file.c vfs-6.15-rc1.file 2025-03-24 13:19:17 -07:00
filesystems.c
fs_context.c
fs_parser.c
fs_pin.c
fs_struct.c
fs_types.c
fs-writeback.c
fsopen.c
init.c VFS: Change vfs_mkdir() to return the dentry. 2025-03-05 11:52:50 +01:00
inode.c fs: call inode_sb_list_add() outside of inode hash lock 2025-03-20 13:06:51 +01:00
internal.h vfs-6.15-rc1.file 2025-03-24 13:19:17 -07:00
ioctl.c
Kconfig - The 6 patch series "Enable strict percpu address space checks" from 2025-04-01 09:29:18 -07:00
Kconfig.binfmt
kernel_read_file.c
libfs.c vfs-6.15-rc1.pidfs 2025-03-24 10:16:37 -07:00
locks.c
Makefile
mbcache.c
mnt_idmapping.c
mount.h vfs-6.15-rc1.mount.namespace 2025-03-24 11:41:41 -07:00
mpage.c
namei.c VFS: rename lookup_one_len family to lookup_noperm and remove permission check 2025-04-08 11:24:36 +02:00
namespace.c fs: actually hold the namespace semaphore 2025-04-03 15:45:35 -07:00
nsfs.c vfs-6.15-rc1.nsfs 2025-03-24 11:38:12 -07:00
open.c vfs-6.15-rc1.file 2025-03-24 13:19:17 -07:00
pidfs.c vfs-6.15-rc1.pidfs 2025-03-24 10:16:37 -07:00
pipe.c Merge patch series "pipe: Trivial cleanups" 2025-03-10 08:55:13 +01:00
pnode.c vfs-6.15-rc1.mount.namespace 2025-03-24 11:41:41 -07:00
pnode.h mount: handle mount propagation for detached mount trees 2025-03-04 09:29:54 +01:00
posix_acl.c
proc_namespace.c
read_write.c
readdir.c
remap_range.c
select.c
seq_file.c
signalfd.c
splice.c fs/splice: Use pipe_buf() helper to retrieve pipe buffer 2025-03-10 08:55:05 +01:00
stack.c
stat.c
statfs.c
super.c vfs-6.15-rc1.misc 2025-03-24 09:13:50 -07:00
sync.c
sysctls.c
timerfd.c A treewide hrtimer timer cleanup 2025-03-25 10:54:15 -07:00
userfaultfd.c mm/userfaultfd: fix release hang over concurrent GUP 2025-04-01 15:14:42 -07:00
utimes.c
xattr.c