Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9084749pxu; Mon, 28 Dec 2020 06:15:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJzwHinvrDnFQV9VseOjlAiYgQUAzKpyJgth93h3t/g92EyfV5We2flklMo2HS/Pi0INZTev X-Received: by 2002:a17:906:810:: with SMTP id e16mr36758060ejd.34.1609164953257; Mon, 28 Dec 2020 06:15:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609164953; cv=none; d=google.com; s=arc-20160816; b=o6bHaKTW2ZOlDFXqjzIRVJMspYh9w8u0khxa8CZUi2V9iHw6GxS/gy0ZGjVJHGOpc/ FaqCLzbN+BNbwEIlv50hrqLV4aqJ81+jjU7kYbPU/TPvoiT/Rh7uXLRfi1mqGAoz6QFg EKJjdiQ5tTP2RRDluDLJzRsBDVG4cZrx6tT0DFVOnXIaeuVxyUXwsaDHtQR/Jw4g48ss vGK7Sh7yF3Fl0VQN28rn+S4Durf4xsV/H3iSyVRwoDqAkIoUfzaoRIrp1mHM3HDll3PR niOD/rylbZu12E79uP93OXhNlAJEZ1GvcaokI/ZDXs6nxljls4U/UEcClt+gPoZvNEAI nJiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oLtJPdGFrsTPluuc4q9mLW86fiPpNO59meaLlf1bO9s=; b=FNdpb3xFi90KZEyetlYOn3Vla9BEX+CU417fNvUcJrrrC8LGgiV9d2AwYbFR2eJPDa FXdwOEYUSvWVCvUDvidFdomd5tDhqDPbi/9etvzBtCQmTt8wyw89EVc0JHJLthQU3FkI as3Rlj/FXmksUCgKrxO6dVWx1hOtFmdVY35sNaetU3g/O+TNE0RniwCOIQG03KCtQVDD q7/zoXyrTBWToIJxNW/ESQQK94nwy+tQz1GpVeJ9/jT9Jt09bIfRGL3E8o3ywnSzCZve JKDYO4le3Dv6fqJJEjgXsRozRhiVxh8ARdA9NcdBlUr2kOIVG3Fh7iWuLC+r1EFCqczX aitw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eV7BkMnv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c6si5472774ejb.666.2020.12.28.06.15.29; Mon, 28 Dec 2020 06:15:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eV7BkMnv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2440120AbgL1ONP (ORCPT + 99 others); Mon, 28 Dec 2020 09:13:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:47804 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440042AbgL1ONG (ORCPT ); Mon, 28 Dec 2020 09:13:06 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8B2B3206E5; Mon, 28 Dec 2020 14:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164746; bh=kMBpl3mriyFVPMZ7QTYRs14rMU1WvrC9xKG598VRvrA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eV7BkMnvtP8d4SfP9IZ08qcw8CKnIJHh8l7TvWX3kcnhObEMCpKNZRw3YM7/MJ1Hm Qk6HebTVTfRkpIrpnMT/7FPJQsOmXw0FWlmC9ibYHRSaNeu+AqNWNfJMI7woCLpVBq X+qsSwlqI0YFjdKuWOX7ya84j995CzdnWAOtItFM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hyeongseok Kim , Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH 5.10 276/717] f2fs: fix double free of unicode map Date: Mon, 28 Dec 2020 13:44:34 +0100 Message-Id: <20201228125034.239891216@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hyeongseok Kim [ Upstream commit 89ff6005039a878afac87889fee748fa3f957c3a ] In case of retrying fill_super with skip_recovery, s_encoding for casefold would not be loaded again even though it's already been freed because it's not NULL. Set NULL after free to prevent double freeing when unmount. Fixes: eca4873ee1b6 ("f2fs: Use generic casefolding support") Signed-off-by: Hyeongseok Kim Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 00eff2f518079..fef22e476c526 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -3918,6 +3918,7 @@ free_bio_info: #ifdef CONFIG_UNICODE utf8_unload(sb->s_encoding); + sb->s_encoding = NULL; #endif free_options: #ifdef CONFIG_QUOTA -- 2.27.0