Commit ca62fc8c6b18 for kernel

commit ca62fc8c6b1841039aee6de1ef03c9863751ec04
Merge: 36aad21d50d1 1d27da7de3f7
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sat Oct 31 11:35:53 2026 -0700

    Merge tag 'ovl-fixes-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs

    Pull overlayfs fixes from Amir Goldstein:

     - Fixes for bugs found by Chris Mason's AI review, several of them
       reachable by unprivileged users: an info leak, use-after-free and
       NULL deref bugs, an RCU walk stall with remote layers and data loss
       with nfs_export

     - Fix copy up of files with an empty security.capability xattr, which
       any user could set to block copy up

     - Fix a regression from v6.16 with the override_creds mount option

     - Two casefold fixes

    * tag 'ovl-fixes-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs:
      ovl: check the casefold flag of directories only
      ovl: reserve space for the casefolded name terminator
      ovl: fix mount setup failing when override_creds drops CAP_SYS_ADMIN
      selftests/ovl: fix detached layer mountinfo expectations
      ovl: set the revalidate flags after d_instantiate()
      ovl: always encode the origin fh when index is enabled
      ovl: read the nlink xattr of every indexed non-dir
      ovl: skip copy up of empty security.capability
      ovl: fix a torn path in ovl_get_redirect()
      ovl: do not copy up a dentry that was removed
      ovl: hold a reference on the parent in readdir
      ovl: use the pinned upper dir in ovl_fix_origin()
      ovl: do not take a name snapshot in RCU walk
      vfs: add try_take_dentry_name_snapshot()
      ovl: take a snapshot of the name for copy up
      ovl: check that the parents of volatile/dirty are dirs
      ovl: add assertions in dir cache code
      ovl: set OVL_WHITEOUTS before publishing the upper dir
      ovl: fortify ovl_copy_xattr() against underlying layer modifications
      ovl: do not copy up an xattr value that was never read

diff --cc fs/overlayfs/overlayfs.h
index 92da556598da,91cdd7e15696..901335026a20
--- a/fs/overlayfs/overlayfs.h
+++ b/fs/overlayfs/overlayfs.h
@@@ -804,9 -808,9 +810,9 @@@ static inline bool ovl_dir_is_real(stru
  int ovl_set_nlink_upper(struct dentry *dentry);
  int ovl_set_nlink_lower(struct dentry *dentry);
  unsigned int ovl_get_nlink(struct ovl_fs *ofs, struct dentry *lowerdentry,
- 			   struct dentry *upperdentry,
+ 			   struct dentry *upperdentry, bool indexed,
  			   unsigned int fallback);
 -int ovl_permission(struct mnt_idmap *idmap, struct inode *inode,
 +int ovl_permission(const struct mnt_idmap *idmap, struct inode *inode,
  		   int mask);

  #ifdef CONFIG_FS_POSIX_ACL