[PATCH 6/6] make it easier to catch those who try to modify ->d_name

Christian Brauner brauner at kernel.org
Mon Sep 15 12:46:46 UTC 2025


On Thu, Sep 11, 2025 at 06:05:34AM +0100, Al Viro wrote:
> Turn d_name into an anon union of const struct qstr d_name with
> struct qstr __d_name.  Very few places need to modify it (all
> in fs/dcache.c); those are switched to use of ->__d_name.
> 
> Note that ->d_name can actually change under you unless you have
> the right locking environment; this const just prohibits accidentally
> doing stores without being easily spotted.
> 
> Signed-off-by: Al Viro <viro at zeniv.linux.org.uk>
> ---

Reviewed-by: Christian Brauner <brauner at kernel.org>



More information about the Linux-security-module-archive mailing list