f2fs: fix double free of unicode map
Subsystems (2)
PATCH v2 1/1 f2fs: fix double free of unicode map
In case of retrying fill_super with skip_recovery, s_encoding for casefold would not be loaded again even though it's already been freed because it's not NULL.
Set NULL after free to prevent double freeing when unmount.
Fixes eca4873ee1b6 ("f2fs: Use generic casefolding support")
Signed-off-by Hyeongseok Kim <[email protected]>
--- fs/f2fs/super.c | 1 + 1 file changed, 1 insertion(+)
fs/f2fs/super.c +1 -0
@@ -3918,6 +3918,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)#ifdef CONFIG_UNICODE utf8_unload (sb->s_encoding); + sb->s_encoding =NULL ;#endif free_options: #ifdef CONFIG_QUOTA
Signature · 1 line
2.27.0.83.g0313f36
Quoted 7 lines · Hyeongseok Kim
In case of retrying
fill_superwithskip_recovery,s_encodingfor casefold would not be loaded again even though it's already been freed because it's not NULL.
Set NULL after free to prevent double freeing when unmount.Fixes eca4873ee1b6 ("f2fs: Use generic casefolding support")Signed-off-by Hyeongseok Kim <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,