1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/fs
Linus Torvalds d3d90cc289 Provide stable parent and name to ->d_revalidate() instances
Most of the filesystem methods where we care about dentry name
 and parent have their stability guaranteed by the callers;
 ->d_revalidate() is the major exception.
 
 It's easy enough for callers to supply stable values for
 expected name and expected parent of the dentry being
 validated.  That kills quite a bit of boilerplate in
 ->d_revalidate() instances, along with a bunch of races
 where they used to access ->d_name without sufficient
 precautions.
 
 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQqUNBr3gm4hGXdBJlZ7Krx/gZQ6wUCZ5gkoQAKCRBZ7Krx/gZQ
 6w9FAP4nyxNNWMjE1TwuWR/DNDMYYuw/qn/miZ88B5BUM8hzqgD/W2SjRvcbSaIm
 xSIYpbtKgtqNU34P1PU+dBvL8Utz2AE=
 =TWY8
 -----END PGP SIGNATURE-----

Merge tag 'pull-revalidate' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull vfs d_revalidate updates from Al Viro:
 "Provide stable parent and name to ->d_revalidate() instances

  Most of the filesystem methods where we care about dentry name and
  parent have their stability guaranteed by the callers;
  ->d_revalidate() is the major exception.

  It's easy enough for callers to supply stable values for expected name
  and expected parent of the dentry being validated. That kills quite a
  bit of boilerplate in ->d_revalidate() instances, along with a bunch
  of races where they used to access ->d_name without sufficient
  precautions"

* tag 'pull-revalidate' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  9p: fix ->rename_sem exclusion
  orangefs_d_revalidate(): use stable parent inode and name passed by caller
  ocfs2_dentry_revalidate(): use stable parent inode and name passed by caller
  nfs: fix ->d_revalidate() UAF on ->d_name accesses
  nfs{,4}_lookup_validate(): use stable parent inode passed by caller
  gfs2_drevalidate(): use stable parent inode and name passed by caller
  fuse_dentry_revalidate(): use stable parent inode and name passed by caller
  vfat_revalidate{,_ci}(): use stable parent inode passed by caller
  exfat_d_revalidate(): use stable parent inode passed by caller
  fscrypt_d_revalidate(): use stable parent inode passed by caller
  ceph_d_revalidate(): propagate stable name down into request encoding
  ceph_d_revalidate(): use stable parent inode passed by caller
  afs_d_revalidate(): use stable name and parent inode passed by caller
  Pass parent directory inode and expected name to ->d_revalidate()
  generic_ci_d_compare(): use shortname_storage
  ext4 fast_commit: make use of name_snapshot primitives
  dissolve external_name.u into separate members
  make take_dentry_name_snapshot() lockless
  dcache: back inline names with a struct-wrapped array of unsigned long
  make sure that DNAME_INLINE_LEN is a multiple of word size
2025-01-30 09:13:35 -08:00
..
9p Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
adfs Merge patch series "adfs, affs, befs, hfs, hfsplus: convert to new mount api" 2024-10-08 14:41:53 +02:00
affs Merge patch series "adfs, affs, befs, hfs, hfsplus: convert to new mount api" 2024-10-08 14:41:53 +02:00
afs Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
autofs autofs: fix thinko in validate_dev_ioctl() 2024-10-28 13:16:56 +01:00
bcachefs bcachefs fixes for 6.14-rc1 2025-01-30 08:42:50 -08:00
befs befs: convert befs to use the new mount api 2024-09-18 11:44:43 +02:00
bfs fs: Convert aops->write_begin to take a folio 2024-08-07 11:33:21 +02:00
btrfs The various patchsets are summarized below. Plus of course many 2025-01-26 18:36:23 -08:00
cachefiles treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
ceph Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
coda Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
configfs configfs: improve item creation performance 2024-11-14 07:45:20 +01:00
cramfs vfs-6.11.module.description 2024-07-15 11:14:59 -07:00
crypto fscrypt_d_revalidate(): use stable parent inode passed by caller 2025-01-27 19:25:23 -05:00
debugfs saner replacement for debugfs_rename() 2025-01-15 13:14:37 +01:00
devpts treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
dlm dlm: return -ENOENT if no comm was found 2024-12-19 13:11:24 -06:00
ecryptfs Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
efivarfs efivarfs: add variable resync after hibernation 2025-01-22 13:28:17 +01:00
efs efs: fix the efs new mount api implementation 2024-10-15 15:58:36 +02:00
erofs The various patchsets are summarized below. Plus of course many 2025-01-26 18:36:23 -08:00
exfat Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
exportfs fs: prepare for "explicit connectable" file handles 2024-11-15 11:34:57 +01:00
ext2 vfs-6.12.file 2024-09-16 09:14:02 +02:00
ext4 Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
f2fs f2fs-for-6.14-rc1 2025-01-27 20:58:58 -08:00
fat vfat_revalidate{,_ci}(): use stable parent inode passed by caller 2025-01-27 19:25:24 -05:00
freevxfs freevxfs: Replace one-element array with flexible array member 2024-11-06 10:42:06 +01:00
fuse Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
gfs2 Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
hfs Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
hfsplus vfs-6.13.misc 2024-11-18 09:35:30 -08:00
hostfs hostfs: Fix the NULL vs IS_ERR() bug for __filemap_get_folio() 2024-11-15 20:55:32 +01:00
hpfs hpfs: convert hpfs to use the new mount api 2024-10-08 14:41:53 +02:00
hugetlbfs mm/hugetlb: rename avoid_reserve to cow_from_owner 2025-01-25 20:22:30 -08:00
iomap The various patchsets are summarized below. Plus of course many 2025-01-26 18:36:23 -08:00
isofs isofs: Partially convert zisofs_read_folio to use a folio 2024-12-05 13:52:37 +01:00
jbd2 CRC updates for 6.14 2025-01-22 19:55:08 -08:00
jffs2 jffs2: Fix rtime decompressor 2024-12-05 12:31:40 +01:00
jfs Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
kernfs Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
lockd treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
minix buffer: Convert __block_write_begin() to take a folio 2024-08-07 11:33:36 +02:00
netfs vfs-6.14-rc1.netfs 2025-01-20 09:29:11 -08:00
nfs Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
nfs_common nfs: fix incorrect error handling in LOCALIO 2025-01-21 11:34:43 -05:00
nfsd NFS Client Updates for Linux 6.14 2025-01-28 14:23:46 -08:00
nilfs2 nilfs2: do not update mtime of renamed directory that is not moved 2025-01-24 22:47:26 -08:00
nls move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
notify treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
ntfs3 fs/ntfs3: Unify inode corruption marking with _ntfs_bad_inode() 2024-12-30 11:37:40 +03:00
ocfs2 Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
omfs fs: Convert aops->write_begin to take a folio 2024-08-07 11:33:21 +02:00
openpromfs openpromfs: add missing MODULE_DESCRIPTION() macro 2024-06-20 09:46:01 +02:00
orangefs Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
overlayfs Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
proc Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
pstore pstore updates for v6.14-rc1 2025-01-20 13:37:14 -08:00
qnx4 qnx4: add MODULE_DESCRIPTION() 2024-05-28 11:52:53 +02:00
qnx6 fs/qnx6: Fix building with GCC 15 2024-12-03 10:40:36 +01:00
quota treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
ramfs mm: switch mm->get_unmapped_area() to a flag 2024-04-25 20:56:25 -07:00
romfs romfs: fix romfs_read_folio() 2024-08-21 22:32:58 +02:00
smb Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
squashfs squashfs: convert squashfs_fill_page() to take a folio 2025-01-24 22:47:22 -08:00
sysfs sysfs: constify bin_attribute argument of sysfs_bin_attr_simple_read() 2025-01-09 10:43:58 +01:00
sysv buffer: Convert __block_write_begin() to take a folio 2024-08-07 11:33:36 +02:00
tests execve: Move KUnit tests to tests/ subdirectory 2024-07-22 18:25:47 -07:00
tracefs Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
ubifs This pull request contains updates for JFFS2, UBI and UBIFS: 2024-11-30 10:32:47 -08:00
udf udf: Verify inode link counts before performing rename 2024-11-26 22:54:24 +01:00
ufs ufs: ufs_sb_private_info: remove unused s_{2,3}apb fields 2024-11-12 19:02:12 -05:00
unicode Revert "unicode: Don't special case ignorable code points" 2024-12-11 14:11:23 -08:00
vboxsf Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
verity treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
xfs treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
zonefs zonefs fixes for 6.12-rc2 2024-10-02 12:02:15 -07:00
aio.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
anon_inodes.c fs: Create anon_inode_getfile_fmode() 2024-04-26 10:33:05 +02:00
attr.c fs: handle delegated timestamps in setattr_copy_mgtime 2024-10-10 10:20:51 +02:00
backing-file.c tree-wide: s/revert_creds_light()/revert_creds()/g 2024-12-02 11:25:09 +01:00
bad_inode.c
binfmt_elf.c fs: don't block write during exec on pre-content watched files 2024-12-11 17:45:18 +01:00
binfmt_elf_fdpic.c fs: don't block write during exec on pre-content watched files 2024-12-11 17:45:18 +01:00
binfmt_flat.c binfmt_flat: Fix integer overflow bug on 32 bit systems 2025-01-10 08:49:05 -08:00
binfmt_misc.c execve updates for v6.14-rc1 2025-01-20 13:27:58 -08:00
binfmt_script.c fs: binfmt: add missing MODULE_DESCRIPTION() macros 2024-05-28 12:06:51 +02:00
bpf_fs_kfuncs.c bpf: Add kfunc bpf_get_dentry_xattr() to read xattr from dentry 2024-08-07 11:26:54 -07:00
buffer.c - The series "zram: optimal post-processing target selection" from 2024-11-23 09:58:07 -08:00
char_dev.c fs: Reorganize kerneldoc parameter names 2024-10-22 11:16:57 +02:00
compat_binfmt_elf.c binfmt_elf: Wire up AT_HWCAP3 at AT_HWCAP4 2024-10-17 18:38:49 +01:00
coredump.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
d_path.c
dax.c fsdax: dax_unshare_iter needs to copy entire blocks 2024-10-07 13:51:47 +02:00
dcache.c Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
direct-io.c fs/direct-io: Remove linux/prefetch.h include 2024-08-19 13:45:02 +02:00
drop_caches.c sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
eventfd.c fdget(), trivial conversions 2024-11-03 01:28:06 -05:00
eventpoll.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
exec.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
fcntl.c fs: get rid of __FMODE_NONOTIFY kludge 2024-12-09 11:34:29 +01:00
fhandle.c exportfs: add permission method 2024-12-17 09:16:11 +01:00
file.c vfs-6.14-rc1.misc 2025-01-20 09:40:49 -08:00
file_table.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
filesystems.c
fs-writeback.c Merge patch series "two little writeback cleanups v2" 2024-11-13 14:08:34 +01:00
fs_context.c fs: fc_log replace magic number 7 with ARRAY_SIZE() 2024-12-22 11:29:52 +01:00
fs_parser.c bcachefs: add support for true/false & yes/no in bool-type options 2024-12-21 01:36:17 -05:00
fs_pin.c
fs_struct.c
fs_types.c
fsopen.c fdget(), more trivial conversions 2024-11-03 01:28:06 -05:00
init.c
inode.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
internal.h sanitize struct filename and lookup flags handling in statx 2024-11-18 14:54:10 -08:00
ioctl.c fdget(), trivial conversions 2024-11-03 01:28:06 -05:00
Kconfig reiserfs: The last commit 2024-10-21 16:29:38 +02:00
Kconfig.binfmt exec: Add KUnit test for bprm_stack_limits() 2024-06-19 13:13:55 -07:00
kernel_read_file.c fdget(), trivial conversions 2024-11-03 01:28:06 -05:00
libfs.c Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
locks.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
Makefile reiserfs: The last commit 2024-10-21 16:29:38 +02:00
mbcache.c
mnt_idmapping.c fuse update for 6.12 2024-09-24 15:29:42 -07:00
mount.h fs: cache first and last mount 2025-01-09 16:58:54 +01:00
mpage.c fs/writeback: convert wbc_account_cgroup_owner to take a folio 2024-10-28 13:26:54 +01:00
namei.c Provide stable parent and name to ->d_revalidate() instances 2025-01-30 09:13:35 -08:00
namespace.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
nsfs.c fs: lockless mntns lookup for nsfs 2025-01-09 16:58:52 +01:00
open.c The various patchsets are summarized below. Plus of course many 2025-01-26 18:36:23 -08:00
pidfs.c pidfs: allow bind-mounts 2024-12-22 11:03:10 +01:00
pipe.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
pnode.c fs: Fix grammar and spelling in propagate_umount() 2024-12-22 11:29:52 +01:00
pnode.h
posix_acl.c acl: Annotate struct posix_acl with __counted_by() 2024-10-22 11:16:59 +02:00
proc_namespace.c fs: rename show_mnt_opts -> show_vfsmnt_opts 2024-06-28 14:36:43 +02:00
read_write.c the bulk of struct fd memory safety stuff 2024-11-18 12:24:06 -08:00
readdir.c introduce "fd_pos" class, convert fdget_pos() users to it. 2024-11-03 01:28:06 -05:00
remap_range.c convert vfs_dedupe_file_range(). 2024-11-03 01:28:07 -05:00
select.c select: Fix unbalanced user_access_end() 2025-01-13 16:24:16 +01:00
seq_file.c fs: Reorganize kerneldoc parameter names 2024-10-22 11:16:57 +02:00
signalfd.c fdget(), trivial conversions 2024-11-03 01:28:06 -05:00
splice.c mm: alloc_pages_bulk: rename API 2025-01-25 20:22:31 -08:00
stack.c
stat.c fs: add STATX_DIO_READ_ALIGN 2025-01-09 16:23:17 +01:00
statfs.c fdget_raw() users: switch to CLASS(fd_raw) 2024-11-03 01:28:06 -05:00
super.c lib/list_debug.c: add object information in case of invalid object 2025-01-25 20:22:23 -08:00
sync.c fdget(), trivial conversions 2024-11-03 01:28:06 -05:00
sysctls.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
timerfd.c A rather large update for timekeeping and timers: 2024-11-19 16:35:06 -08:00
userfaultfd.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
utimes.c fdget(), more trivial conversions 2024-11-03 01:28:06 -05:00
xattr.c xattr: remove redundant check on variable err 2024-11-06 13:00:01 -05:00