f2fs: fix double free of unicode map
Subsystems (2)
PATCH 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.
--- 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 · 8 lines
2.27.0.83.g0313f36 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 16 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.Signed-off-by Hyeongseok Kim <[email protected]>--- fs/f2fs/super.c | 1 + 1 file changed, 1 insertion(+)fs/f2fs/super.c +0
-0
fs/f2fs/super.c static int f2fs_fill_super(struct super_block *sb, void *data, int silent) · line 3924
Quoted 7 lines
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
This is:
Right?
- Eric
Quoted 26 lines · Eric Biggers
Quoted 16 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.Signed-off-by Hyeongseok Kim <[email protected]>--- fs/f2fs/super.c | 1 + 1 file changed, 1 insertion(+)fs/f2fs/super.c +0
-0fs/f2fs/super.c static int f2fs_fill_super(struct super_block *sb, void *data, int silent) · line 3924
Quoted 7 lines
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_QUOTAThis is:
Quoted 6 lines
Fixes eca4873ee1b6 ("f2fs: Use generic casefolding support")Right?
- Eric
Right. Should I add "Fixes" tag and send v2?