Re: [PATCH v2 18/50] convert pstore

Kees Cook
2025-11-04T01:43:45Z

On Tue, Oct 28, 2025 at 12:45:37AM +0000, Al Viro wrote:
> object creation by d_alloc_name()+d_add() in pstore_mkfile(), removal -
> via normal VFS codepaths (with ->unlink() using simple_unlink()) or
> in pstore_put_backend_records() via locked_recursive_removal()
>
> Replace d_add() with d_make_persistent()+dput() - that's what really
> happens there. The reference that goes into record->dentry is valid
> only until the unlink (and explicitly cleared by pstore_unlink()).
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Thanks for the refactoring!

Reviewed-by: Kees Cook <kees@kernel.org>

--
Kees Cook