[PATCH] securityfs: use kstrdup_const() to manage symlink targets
Paul Moore
paul at paul-moore.com
Tue Mar 17 21:13:34 UTC 2026
On Mar 17, 2026 Dmitry Antipov <dmantipov at yandex.ru> wrote:
>
> Since 'target' argument of 'securityfs_create_symlink()' is (for
> now at least) a compile-time constant, it may be reasonable to
> use 'kstrdup_const()' / 'kree_const()' to manage 'i_link' member
> of the corresponding inode in attempt to reuse .rodata instance
> rather than making a copy.
>
> Signed-off-by: Dmitry Antipov <dmantipov at yandex.ru>
> ---
> security/inode.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
Seems reasonable, we can easily back this out if we ever need to support
non-const link target strings. Merged into lsm/dev, thanks.
--
paul-moore.com
More information about the Linux-security-module-archive
mailing list