Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp250551lqr; Wed, 5 Jun 2024 05:13:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWIoFQdPxqPvkFPZ2xLmERjKUYgSQgBVejkh+8fOEfpY9m7lbw2aML8vEgAj2CnpDsO8m6nQATx33xgTw6W9leh2LMwdncQM3uKeFyWTg== X-Google-Smtp-Source: AGHT+IHxSI/b+X0azUQUN9h3AMO2AMg2WDx3WODpvgvs87EZtN+6FKobnESr/smGVY3R+PORfrhk X-Received: by 2002:a17:906:5604:b0:a66:dca6:43f6 with SMTP id a640c23a62f3a-a699fa9c5a4mr142021566b.27.1717589614172; Wed, 05 Jun 2024 05:13:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717589614; cv=pass; d=google.com; s=arc-20160816; b=KngKeIUWqGdomT8bdHt6gx2upO0+aJ47aes/aHcHHAUDIIjiTjYeymdQmUxZl+ad/s PWPTYAmd8/ce369+/44yDcKkctCS27Y4KubWyBIBnS2EvoVI55aSe1SGfYEQzT6smWmC MJlUBRwSDVbWXdarBIrmLxWtbjulYqaX40JMb7IrXsstnwuE1uVY1F0P4Mgz8Po9xNay T+3/otyEngb9hqKY7PtUilc6wOAO/jVHsH0ja3VLG0h+jszZzcNRB+Rkq3RKw+uBPzx7 ZP6dSHyZhSBixXpUphf3LUMLP2TC0l9nbivxadNmCDMruc/mTMnhPTdrZPtwkxbbl2QG JRdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=xRGUAOUUTWByjjdz7uStNK7zU5qu8v19QCrxcaXEyRU=; fh=lMXcThwCaJRvrapYPATbtij2gIoUTSV+SOgMKVpw4As=; b=yZ9cC93Q5Eh6b9JpnWYCGbz3Yl9BKjy+7bRhEGq0JMme/GEj33zSeRyROdnPqAmU5O HeMEV2TkGEzJ1k3uz5cCQD4O6WLAmVpF9EnH7op9ScpqETFv0hdwlWEOkTRl7nhhN9bT c6TRt/xaKkqiuy/wP/Ee8i6wwpvZ3uXh6JQLOFGA7ebueYR7D08FwxzHEZVGzAy19mFK fHgKhN6VaM6GdORHO0dPWSCzWb3twp+6ZKBZ38O+owRse5ZAoDowTDdLpaPbhWJSdhmD 15AFWsfPlkLJykoqVS83HQgugL7UjpVHs1hev4HFwpcOKKD6BletBacGDI+8NlVZMkRN K39w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kcHBSNID; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202392-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202392-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a68bf868583si461460066b.108.2024.06.05.05.13.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 05:13:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202392-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kcHBSNID; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202392-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202392-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DCCA21F21CA5 for ; Wed, 5 Jun 2024 12:13:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD42B1974FD; Wed, 5 Jun 2024 11:54:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kcHBSNID" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB57E1974E6; Wed, 5 Jun 2024 11:54:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588457; cv=none; b=ktgFv148a1ejUQaJWQO26/GbAAOvLNZlQeGoV+XVcivjObEfa+zgpchHFg5JDP5S++wytotVdRSsauSF7e1w8OTx942XWt8UQUKe+a01+rJoL56tNlO6/esA5RiEifa6Yeo9AZdNACV5t/Na6om6Upjvei5SKmsqfdgNc2je5GE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588457; c=relaxed/simple; bh=a/4zziXLEH7ScUQ841dFu6fDUaravSz8cdlQEliR3Pc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ORXAYF0THcIo9oIjvqWcfGCHgnIeag74/edYUtQJ6YGZWa3Wel0YesP1aClUpzUlIsILmgD4xE+3PnYD+4ziYxPKWKpSTrNWr0A9kTvVp5Qx1U5wGoJowhmkvJPm12OzZkBFBH7lsio5hxksgjR4sjAksst4bmc64FiAMZKAqks= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kcHBSNID; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92E04C3277B; Wed, 5 Jun 2024 11:54:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717588457; bh=a/4zziXLEH7ScUQ841dFu6fDUaravSz8cdlQEliR3Pc=; h=From:To:Cc:Subject:Date:From; b=kcHBSNIDSCLOarWPvFPw/55kP515WYoAGr5zEI+03pGnZZaNWjbBmRTaAckx5QMN7 zf2DAI+4hVfLk/bUU9wNVgEjp+J5vYG1pJNror/xXgxyHPfMhR7SVTg2R+O4wPQU60 xPj2u3dG7YeaLPo+MsUxSX9E3EgzkeH3Ide+eJrj2b7Ku/ZSn9gxQ8tEG/CPMjCiQM z8mg4qqX8tcA2QrLBnfV7L2c7SoC/2xF2GubW1CY1YADo9GJrkQ5TxjLdaXf0VN/1I GzQDnQ+EzLV225TKUAGQOUcI5rnAp8ki72pZlixNBWE3v+F/tSfANtJkYFZFsWihkW XlKfihSkSYilg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yunlei He , Chao Yu , Jaegeuk Kim , Sasha Levin , linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH AUTOSEL 5.15 1/9] f2fs: remove clear SB_INLINECRYPT flag in default_options Date: Wed, 5 Jun 2024 07:53:59 -0400 Message-ID: <20240605115415.2964165-1-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.15.160 Content-Transfer-Encoding: 8bit From: Yunlei He [ Upstream commit ac5eecf481c29942eb9a862e758c0c8b68090c33 ] 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 Signed-off-by: Yunlei He Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/super.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index df1e5496352c2..706d7adda3b22 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2068,8 +2068,6 @@ static void default_options(struct f2fs_sb_info *sbi) F2FS_OPTION(sbi).compress_mode = COMPR_MODE_FS; F2FS_OPTION(sbi).bggc_mode = BGGC_MODE_ON; - sbi->sb->s_flags &= ~SB_INLINECRYPT; - set_opt(sbi, INLINE_XATTR); set_opt(sbi, INLINE_DATA); set_opt(sbi, INLINE_DENTRY); -- 2.43.0