public inbox for linux-security-module@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHES] simple part of ->d_name stuff
@ 2025-09-11  5:01 Al Viro
  2025-09-11  5:05 ` [PATCH 1/6] security_dentry_init_security(): constify qstr argument Al Viro
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Al Viro @ 2025-09-11  5:01 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: Linus Torvalds, Christian Brauner, Jan Kara, NeilBrown,
	linux-security-module, David Howells, Namjae Jeon

	Rules for ->d_name access are rather unpleasant and so's
verifying that they are followed.  There is a relatively simple part,
though - nobody outside of fs/dcache.c has any business modifying
that thing.

	So let's make sure that all functions we are passing
&dentry->d_name are taking const struct qstr * and replace
->d_name with an anon union of struct qstr *__d_name and
const struct qstr *d_name.

	It is *not* enough to guarantee that another thread will
not call __d_move() right under you - checking the requirements
for that is the hard part.  It does make it easy to verify that
nothing else accidentally starts changing it.

	This stuff lives in
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git #work.qstr
Branch is -rc4-based, individual patches in followups.

	Please, review.  If nobody objects, I'll put that in #for-next.

Shortlog:
      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

Diffstat:
 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(-)

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2025-09-15 12:46 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-11  5:01 [PATCHES] simple part of ->d_name stuff Al Viro
2025-09-11  5:05 ` [PATCH 1/6] security_dentry_init_security(): constify qstr argument Al Viro
2025-09-11  5:05   ` [PATCH 2/6] exfat_find(): " Al Viro
2025-09-11  6:02     ` Namjae Jeon
2025-09-15 12:45     ` Christian Brauner
2025-09-11  5:05   ` [PATCH 3/6] afs_edit_dir_{add,remove}(): " Al Viro
2025-09-15 12:45     ` Christian Brauner
2025-09-11  5:05   ` [PATCH 4/6] afs_dir_search: " Al Viro
2025-09-15 12:46     ` Christian Brauner
2025-09-11  5:05   ` [PATCH 5/6] generic_ci_validate_strict_name(): constify name argument Al Viro
2025-09-15 12:46     ` Christian Brauner
2025-09-11  5:05   ` [PATCH 6/6] make it easier to catch those who try to modify ->d_name Al Viro
2025-09-15 12:46     ` Christian Brauner
2025-09-11 14:30   ` [PATCH 1/6] security_dentry_init_security(): constify qstr argument Casey Schaufler
2025-09-11 20:54   ` Paul Moore
2025-09-15 12:45   ` Christian Brauner
2025-09-11  5:59 ` [PATCHES] simple part of ->d_name stuff David Howells
2025-09-11 16:56 ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox