Re: sb->s_fs_info freeing fixes

Christoph Hellwig
2023-08-31T12:36:24Z

On Thu, Aug 31, 2023 at 12:29:11PM +0200, Christian Brauner wrote:
> "Since ramfs/devpts uses get_tree_nodev() it doesn't rely on
> sb->s_fs_info. So there's no use after free risk as with other
> filesystems.
>
> But there's no need to deviate from the standard cleanup logic and cause
> reviewers to verify whether that is safe or not."
>
> and similar for the other two:
>
> "Since hypfs/selinuxfs uses get_tree_single() it doesn't rely on
> sb->s_fs_info. So there's no use after free risk as with other
> filesystems.
>
> But there's no need to deviate from the standard cleanup logic and cause
> reviewers to verify whether that is safe or not."
>
> If that is good enough for people then I can grab it.

Fine with me. And yes, I'd rather not have private data freed before
SB_ACTIVE is cleared even if it is fine right now. It's just a bug
waiting to happen.