Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp249239lqr; Wed, 5 Jun 2024 05:11:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVMhmnX4EHY+X6XhAh7D1aEwO00UynGYnzB/93Kh978qC61NrZaY1ZNPfQx8AekGj9oSwX5+3UyxtB3qBgsJsHsVpSNgNj60vZbzKwOzg== X-Google-Smtp-Source: AGHT+IGK1zsK4S34s0xd00yvsQda8bNS01v0/MZe+wCOQ9VJWRYaz17pTz/WH8hagFYzP7mPJENP X-Received: by 2002:a17:90a:7105:b0:2c2:4129:a2d3 with SMTP id 98e67ed59e1d1-2c27db5b4a6mr2661217a91.36.1717589488686; Wed, 05 Jun 2024 05:11:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717589488; cv=pass; d=google.com; s=arc-20160816; b=hC5ny0Y1NjZT1xL+XNNvDagGIupphqGjhojFuVdU0PXeusMd52gHh2LDLz/WjCibZM BYCKZE9lEbVunPciURPokg7x3PNT2mg2ZLJq3P5prmMb/ivUGN0ICpf+VbquN1undBQt Hg3xKU+DS4wqO3CGgr4MmJPyaeDOwMw6mY4YFuU0gs/zqQUvR6EBsCD+9USfB7xmf/6c oo4j6cICUsz7BIUMUKeN5F/JF+isMTUNe2PWCpp2Xghuf71wmm81x0T+c6S9/LS24CM1 iME9CF6wEM10hLYE/dH9P4+FJ953nt0DnZL+SwEVRjFCOhM/DPO4D0WdP1AKp78Feis+ 9Mfg== 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=2JbpQW4iE0gWeBOcwyiL+PaXjik+UzoCi/hU4EhdI/s=; fh=lMXcThwCaJRvrapYPATbtij2gIoUTSV+SOgMKVpw4As=; b=oV04U2AgT7e13aBSA0SQ6ZBpvR9Yc4ufgcJtHVHO53RGsHix/zNiGRtAIUPLJv/R3t reVMFbpoWdnvqFiFks1oFjJx/udjAZWxzoj6INwR0J/RqTXFxyYqdUTl53HYvwDVlAlc qE3MsKtEhIKNqmShzYs4RcQ4nBY6NLkxI9iXN0xlhBA9igV8wjf7leji+NSUFFqHcAEZ qQxiLM84dIPPKCzavdEJ5J+2p7OwU7mTzRq/IJ1457uoFPTnJcW7+2BhQ7u2GGklCAEP jcG+2CmOna1/AsPengvQgGeRZi4H4L3MJmkcaYg5nxA5UF6ulAlPXQJ+bH4PqqaL8rf7 hb9A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oKQilBLX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202333-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202333-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c2806336b0si1145831a91.11.2024.06.05.05.11.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 05:11:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202333-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oKQilBLX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-202333-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202333-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 89F06B2371D for ; Wed, 5 Jun 2024 11:58:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B0C37194A76; Wed, 5 Jun 2024 11:51:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oKQilBLX" 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 D6F16194A64; Wed, 5 Jun 2024 11:51:04 +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=1717588264; cv=none; b=TAhg/ptyyoItH/5rjaDWJe4SX0RAJtY4fHWgoZLuNzcHq/8z05B5w5/W1seYKGfKZfrI0jSa0FYAZBEw/dfYFRdoFCUKc9Da0QkQe4GLBBRnzN/D/6uWAHL/fUQwvyrNL4tRGGDYWdGUCW6hIdbzC4zSoYPudzddBe2wuEYLP1E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717588264; c=relaxed/simple; bh=hb/sR4c2mafWsXSHwE7mGDPp0HyJ844pMJnKXtg6Lqk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fV1u0Dl2cLU+zubJKrGuhjBJjZbkis9vNFo5PYnuFmyrAog+/3r4n1PQ1qUrdrVwNowYq1r2F2x0dtz+zf3Fzws0SAXXKmTrDlzq1Ghsc/ulHb7kS/vZOTMWQU4pEmIpBNL5HDkJ5klQAth1Lhx+TpBUTPj1gIIGXCIon2lTJm0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oKQilBLX; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFD74C32786; Wed, 5 Jun 2024 11:51:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717588264; bh=hb/sR4c2mafWsXSHwE7mGDPp0HyJ844pMJnKXtg6Lqk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oKQilBLXTvdqMuPiQdNlxclkD+CfxO739OFljMTbP8I3aKvBUugMVOFzGhlxmGd/V RpCCxhGPS5ZUI29dFy0siwNjsy/4H/Rk75YkB7a9G2NIgj1UEgtIT22BQ8E2bMH2jb LPNxLfPRu7xQE7HihQwm4BkTn4yOON/NxxtR2TxJyAUG0ZJmuThsW4W+QlXSBGolNt ET1U3JAgPuN3VBCdTJuhpPJFm5P2jcP+7M0BuNu3q5i8fmbrxOaBMgvcyS2WNgyEHe aqQsgyjAhwcf9tSgkxgtuYld7vDMa7ItKeZmkAP0cAw1V5VgjGVJykur7oPg/w+/4f Ot4C28lVXAChA== 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.8 02/24] f2fs: remove clear SB_INLINECRYPT flag in default_options Date: Wed, 5 Jun 2024 07:50:12 -0400 Message-ID: <20240605115101.2962372-2-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240605115101.2962372-1-sashal@kernel.org> References: <20240605115101.2962372-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.8.12 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 4ba613ed3a179..67bedd5b69cc1 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2193,8 +2193,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