[PATCHES] simple part of ->d_name stuff
David Howells
dhowells at redhat.com
Thu Sep 11 05:59:44 UTC 2025
Al Viro <viro at zeniv.linux.org.uk> wrote:
> 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.
Reviewed-by: David Howells <dhowells at redhat.com>
More information about the Linux-security-module-archive
mailing list