f2fs: remove clear SB_INLINECRYPT flag in default_options
PATCH 1/1 f2fs: remove clear SB_INLINECRYPT flag in default_options
In f2fs_remount, SB_INLINECRYPT flag will be clear and re-set. If create new file or open file during this gap, these files will not use inlinecrypt. Worse case, it may lead to data corruption if wrappedkey_v0 is enable.
Thread A: Thread B:
-f2fs_remount -f2fs_file_open or f2fs_new_inode
-default_options
<- clear SB_INLINECRYPT flag
-fscrypt_select_encryption_impl
-parse_options
<- set SB_INLINECRYPT again
--- fs/f2fs/super.c | 2 -- 1 file changed, 2 deletions(-)
fs/f2fs/super.c +0 -2
@@ -2132,8 +2132,6 @@ static void default_options(struct f2fs_sb_info *sbi, bool remount)F2FS_OPTION (sbi).memory_mode =MEMORY_MODE_NORMAL ;F2FS_OPTION (sbi).errors =MOUNT_ERRORS_CONTINUE ; - sbi->sb->s_flags &= ~SB_INLINECRYPT ; -set_opt (sbi,INLINE_XATTR );set_opt (sbi,INLINE_DATA );set_opt (sbi,INLINE_DENTRY );
Signature · 8 lines
2.40.1 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 11 lines · Yunlei He
In
f2fs_remount,SB_INLINECRYPTflag will be clear and re-set. If create new file or open file during this gap, these files will not use inlinecrypt. Worse case, it may lead to data corruption ifwrappedkey_v0is enable.Thread A: Thread B:
-f2fs_remount -f2fs_file_open or
f2fs_new_inode
-default_options
<- clearSB_INLINECRYPTflag
Quoted 6 lines
-fscrypt_select_encryption_impl
-parse_options
<- setSB_INLINECRYPTagainSigned-off-by Yunlei He <[email protected]>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:
Hello:
This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:
Quoted 8 lines · On Tue, 26 Mar 2024 14:10:43 +0800 you wrote:
In
f2fs_remount,SB_INLINECRYPTflag will be clear and re-set. If create new file or open file during this gap, these files will not use inlinecrypt. Worse case, it may lead to data corruption ifwrappedkey_v0is enable.Thread A: Thread B:
[...]
Here is the summary with links:
- [f2fs-dev] f2fs: remove clear SB_INLINECRYPT flag in default_options
https://git.kernel.org/jaegeuk/f2fs/c/ac5eecf481c2
You are awesome, thank you!
Signature · 10 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel