Skip to contentSkip to conversation

pile 5: simplifying ->d_name audits, easy part

GIT PULL Merged Al Viro 2 participants 2 messages Oct 2, 2025 – Oct 3, 2025 VFS

lore
Share & tools
lore

Al Viro

author maintainer
#0 lore raw

The last vfs-related pull request for tonight; there's an ->f_path counterpart of that one, but I'd rather leave it for tomorrow - it's trickier and it would be easier to deal with once work.mount gets merged.

A trivial conflict in fs/afs/internal.h...

The following changes since commit b320789d6883cc00ac78ce83bccbfe7ed58afcf0:

Linux 6.17-rc4 (2025-08-31 15:33:07 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git tags/pull-qstr

for you to fetch changes up to 180a9cc3fd6a020746fbd7f97b9b62295a325fd2:

make it easier to catch those who try to modify ->d_name (2025-09-15 21:08:33 -0400)

----------------------------------------------------------------

	Simplifying ->d_name audits, easy part.

Turn dentry->d_name into an anon union of const struct qsrt (d_name itself) and a writable alias (__d_name). With constification of some struct qstr * arguments of functions that get &dentry->d_name passed to them, that ends up with all modifications provably done only in fs/dcache.c (and a fairly small part of it).

Any new places doing modifications will be easy to find - grep for __d_name will suffice.

----------------------------------------------------------------
Al Viro (6):
security_dentry_init_security(): constify qstr argument exfat_find(): constify qstr argument afs_edit_dir_{add,remove}(): constify qstr argument
afs_dir_search: constify qstr argument generic_ci_validate_strict_name(): constify name argument make it easier to catch those who try to modify ->d_name

 fs/afs/dir_edit.c             |  4 ++--
 fs/afs/dir_search.c           |  2 +-
 fs/afs/internal.h             |  6 +++---
 fs/dcache.c                   | 26 +++++++++++++-------------
 fs/exfat/namei.c              |  2 +-
 include/linux/dcache.h        |  5 ++++-
 include/linux/fs.h            |  6 ++++--
 include/linux/lsm_hook_defs.h |  2 +-
 include/linux/security.h      |  4 ++--
 security/security.c           |  2 +-
 security/selinux/hooks.c      |  2 +-
 security/smack/smack_lsm.c    |  2 +-
 12 files changed, 34 insertions(+), 29 deletions(-)