Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp239855lqr; Wed, 5 Jun 2024 04:57:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUVRZNvMEFzLd4fB9VtT0Y5TJO+hjNOWy/J5Gv3xZWZkduO+PBIxwcLIN7TwDHcJ4sJVUR3o/WDittzk5ucagEkdIPKEWhm7Krfb0ID0A== X-Google-Smtp-Source: AGHT+IGkpta7DzugofqLcbaawlLERKa0Q0mnPW6JVQ3qmuN0x7QN6N26dcROfFId86CEVz3LJHmQ X-Received: by 2002:a05:6359:5a4:b0:199:34c3:2328 with SMTP id e5c5f4694b2df-19c6ca13d05mr159676255d.30.1717588638086; Wed, 05 Jun 2024 04:57:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717588638; cv=pass; d=google.com; s=arc-20160816; b=GsaESmLKw8Qd1xtKTE24p4DIYvdMes4uK/8yCBOyR4vTaL0mYB/4+m5DBHGkSrtnYX tdpvAU3JEYINMEABvZnY0bC247ojxo5E7st4WEpmbdEoCGJ0/tntXOeOXRfWYgchsmiF tduDRJG5Gj8SOy0ztbNzozeyRPDQNAP3mHftkIfEtqIs0WAQf02NBkQvrvWVSihS0FLQ VhsRVMvuDkKfbKtFvmhqWLkAtkv+JZnChvDXOJUAXcX/C9LUzjj4fTR6/16fcU4/wNez GT6AnFBfCHz1ST4Lfy5+91Zr1MCejcevpXdFIdzWZZ6v0klm+pgi/3fzuFQyfuvS0wS2 0eEA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=OMeCHY93rQK2Eb+35tSieGKzGI2V0YPm8zUhNYxsM4Y=; fh=lMXcThwCaJRvrapYPATbtij2gIoUTSV+SOgMKVpw4As=; b=tFbKzpTQlOxpXY4ohWVZrMIy9Yd6fY4/Ye6BNY1NLExPMWnVUqoPqgU1FAino3z+IC zAl7AtiCzRHVUMK9b47LfqtfoOuMh4Dht21KhUYh03rFOXE0Se4r0B231Jbbk2/9essL j0ZaIoNWejgiKSZGg+/qBrsVb0kzgFKBWzbRrTt3WALWJskwt3iX5NCpkxCd1v3Shy9z /vOMnQcwuhlGPFFv84aa1bvY6BAhYR6tEPVeRtitRhopg2fYwuMehAG7w9C5X0e6QrqM YrkoljQqFHAyqWcXM8xRA25Rtd4CNwiEb/XQf1CKdrGQus3+CMmrzmgAI4yl8NxnAM5P 6k4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e9cbWHgp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202299-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202299-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. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c355155a79si3506714a12.182.2024.06.05.04.57.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 04:57:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202299-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e9cbWHgp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202299-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202299-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 B273228B5C6 for ; Wed, 5 Jun 2024 11:50:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EDA59194136; Wed, 5 Jun 2024 11:49:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="e9cbWHgp" 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 1DC0D19309C; Wed, 5 Jun 2024 11:49:31 +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=1717588172; cv=none; b=leBGGHxBKZXqgI5nhmY/TAGV2NS1LelvmHgt3v2zVM20fzSKyUKHnTXnN4mV3ST3lzRDpNmtg0YIFyw7veqhILlA5xxupbvGm6wcilseT0cwzoQL1q6Z9MAmj6RtUVHizD7xjX+isgrJo68Avsyq+MHQXoPiffzDFu0plwPqQpo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588172; c=relaxed/simple; bh=eV6sMHKwD9VA0h9HbtB16fn0ZR00vEFh0Zl0/uBJR/w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZISjISTEblYVjM8GR9/jlhyKZblPlLzrDCk/HxmtH++GRi/wYuYT6fSZVPWu42GXBSzkgxrWmbgKBMcgak+ocQZEZiDTGoqMrQUSjvxxphifCh/fRl/d7FnIriu1amfW7HpnIJNdyDAhEBjDRSNEpzP3EPRy+CKcLWJQWQOSnCs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=e9cbWHgp; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE39CC32781; Wed, 5 Jun 2024 11:49:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717588171; bh=eV6sMHKwD9VA0h9HbtB16fn0ZR00vEFh0Zl0/uBJR/w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e9cbWHgpGnMDApaTwYBlpzh6/WyXGAkXpoXH7oDMhQmJJ6r6lSLDzJTmiDdI2UMFb /NW81+7BaKCcd8I+LCgHHDO+Dt6HNFSJ5fTpVI2yuobZg9EJ4599zkV41tJ0HkiDgd jH3CygmjBKdKJ+2d2CWPM1m6/cumL0b2H9lX5UKSwLPFLA1A6Jsdz8eLRwHTO0byHV B5Ws9ivvcVu2a4CKRcwtGpnEaGKQNl4WURUbwQQVfSlkJTyCvSURIVhAN2KD8tOQAu K17vFVFsyF+e++tIxJnWfFfIS1fC2zuPAN6pPNq4sBB/Ox/hh3azIfRSi3NlB9HPYS Grtuk7VtMVIYA== 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.9 03/28] f2fs: remove clear SB_INLINECRYPT flag in default_options Date: Wed, 5 Jun 2024 07:48:32 -0400 Message-ID: <20240605114927.2961639-3-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240605114927.2961639-1-sashal@kernel.org> References: <20240605114927.2961639-1-sashal@kernel.org> 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.9.3 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 a4bc26dfdb1af..e4c795a711f0f 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -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); -- 2.43.0