Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp256277lqr; Wed, 5 Jun 2024 05:23:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXlqZnJrcEApzSwIwVvoGpoN4gdTVLdOH8hAMEU3Xpxx+SfWpAFARIzaKbtghhMwcO8tWWbMMmzNVd9jAiPlsMft2Pw8GCaS5jcSpSPKA== X-Google-Smtp-Source: AGHT+IE7I7ODTZMNsf+Ebi9vRq9kQBJwIyQD3Hlb5orjDXuX07fAd2qYgZFHcro2plI4wQa0jcLb X-Received: by 2002:a17:902:c401:b0:1f4:6948:1d49 with SMTP id d9443c01a7336-1f6a5a163a3mr30615315ad.33.1717590206419; Wed, 05 Jun 2024 05:23:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717590206; cv=pass; d=google.com; s=arc-20160816; b=FWrGpeCeNZBpmsP421XG283EM0SGYbPk8Zw2Kw8CwL5T915NyA+9vTN9p0Z0t0D4+K aPWeUFZF5qbNqTJW1n5/000L3ci7CUn90gYudWvqcnoXClMXUD2mtMHpK4E4O6qY/KIz GSfIkDH9l7ln8Ig+3TpyNg8LyULjoLAhRc+KI1+mCVr8yB7wDryMp7caBXIYLnuzdSlV Q06hehjsXZtEalMIzHbuC+WbzCub1YA+kKZqN6XCc5/Lqm5tkNBqJvsLgL4WuQkGuTqy bAlsCyaIGer+HPH2+TxZ2zmCd8egMMXqrsQcIk+be0my5p47wP1T5mkm2fDLwOuJWn37 Ex+w== 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=GLqOGFI+f3uhDleWUoE0gqlMq96bZaIVXISN57oK7ek=; fh=lMXcThwCaJRvrapYPATbtij2gIoUTSV+SOgMKVpw4As=; b=UH4bpTD2IbKKmGb54PGQ3fR7dpL0Yoo2UQB5ZX4bAjzKBRdPdwbX3fTESJhP4BM0rj NMrDKkxr43QKWQe3xFVmiB2S9dQJPxoQfUg4DkTWZNnjo7Jb5EASIDSOQsWz/bCkZI5w KHq+eBMWLsZO5quyGsNwCbVF9VMmVsDzSfenCNBrx0nS/Jesn5g2/78tgj9oLwXIK4Dp Z/02F00+enZFmQG9SQpF2ZxE2I+anRSJInxjGwIcIUboasuxndmwP0/HskyOmWu8dxFT lLyla7xmrI8H9FZMgtSt9/2LQIXqA7NtfXNOum6zV+MiJMVY82W5xztTC5+vgm20bdSE tvnQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Iqntjj3t; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202379-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202379-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f63233d164si2323065ad.107.2024.06.05.05.23.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 05:23:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202379-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Iqntjj3t; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202379-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202379-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5FC7A28BF7D for ; Wed, 5 Jun 2024 12:10:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1FB26194138; Wed, 5 Jun 2024 11:53:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Iqntjj3t" 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 43299192B6A; Wed, 5 Jun 2024 11:53:35 +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=1717588416; cv=none; b=OJTq5qEPyI0rihLRZQoQluFf4qdbFPxHy7XsNMhZ4xKexRRdASZskKBr+2E1ve2vUYrHhitNLem/9lYGo+GCyiwJQVzhTAx5zSKM2LsngZlv3TY9F10cFFb3bfaDnxWET3GpZBkH/Ij9tL/MjEY73Cq4FKATZ24Q3dDR9GzJc9M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588416; c=relaxed/simple; bh=M4hUo4Sz5eXhFIXqPo6FLTorE27s5v5OULPRV+E2nas=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=OA2HYqS+twFsX8zFgGTA7OM5TUa410fWthRQybR4GvtcwKsHELbO3RVyvV0HUfLofkDQqzEIjBALPNPNQezJwczDpa8XUmYVoBpJQDynGYgLYXuDuwBnJw/94AZs3Zri3lPFWDml902FqZbX20LWBkT7YM/vizcuQxM9YwDObO8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Iqntjj3t; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07E4DC3277B; Wed, 5 Jun 2024 11:53:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717588415; bh=M4hUo4Sz5eXhFIXqPo6FLTorE27s5v5OULPRV+E2nas=; h=From:To:Cc:Subject:Date:From; b=Iqntjj3tXzsb5UX6gQEZst4eldgvzHKzusRrS03IgvxkiTyX3Yg1qIuixf64iHTth BAa7cbyziLitNYJnnge6wrgNR4SJWTZBDLZXOmQB1unNBASGi1wxakKOJ8cfZWFBY/ z9kT/919ikCP7l2T/qkXcvMFYTrBD2jrJ53qPqm9zJy6YVqGnJ6JXnj5Muecf8xvEE IaD+yGXdsogn+u813Pi7qi31MDd910VXKIIwsiZwuZOIeaDPHKhf3YHANBcKBNC02c wgIc3Xjrn1CRXubKGDY2M90284k/BLQkBwpyVu6RfYv9NpeloK/wIfQZvd15uGHcWX 4Z5cDv3vM+BFA== 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 6.1 01/12] f2fs: remove clear SB_INLINECRYPT flag in default_options Date: Wed, 5 Jun 2024 07:53:06 -0400 Message-ID: <20240605115334.2963803-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 6.1.92 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 c529ce5d986cc..f496622921843 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2092,8 +2092,6 @@ static void default_options(struct f2fs_sb_info *sbi) F2FS_OPTION(sbi).bggc_mode = BGGC_MODE_ON; F2FS_OPTION(sbi).memory_mode = MEMORY_MODE_NORMAL; - sbi->sb->s_flags &= ~SB_INLINECRYPT; - set_opt(sbi, INLINE_XATTR); set_opt(sbi, INLINE_DATA); set_opt(sbi, INLINE_DENTRY); -- 2.43.0