From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54E70C432C0 for ; Wed, 20 Nov 2019 10:23:57 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0958F2243E for ; Wed, 20 Nov 2019 10:23:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mykernel.net header.i=cgxu519@mykernel.net header.b="Ul2YIIFZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0958F2243E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mykernel.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47HzLf6GwczDqsH for ; Wed, 20 Nov 2019 21:23:54 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=mykernel.net (client-ip=163.53.93.251; helo=sender3-pp-o92.zoho.com.cn; envelope-from=cgxu519@mykernel.net; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=mykernel.net Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=mykernel.net header.i=cgxu519@mykernel.net header.b="Ul2YIIFZ"; dkim-atps=neutral Received: from sender3-pp-o92.zoho.com.cn (sender2-pp-o92.zoho.com.cn [163.53.93.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47HzLL39RPzDqlL for ; Wed, 20 Nov 2019 21:23:37 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1574244492; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=Date:From:Reply-To:To:Cc:Message-ID:In-Reply-To:References:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding; l=1333; bh=bI+cc8z3jGP2wVdb3YVmvSegQAtFB1j54+rsC4ghiRs=; b=Ul2YIIFZaPzzDDW47Hp3RK5xvXlDOLXlTNJ3EHSQwk3WZg7obFLBJGWP9aiA5Z+L QuxBwP+Pr4TlQrB4uxMta5dLsUtbOIjnLS8xLqw4YLk8Bq7nxAYwJwMtAe9k9EwO8DX WMAXYHXk8Tz7RP/9etZSIu8X6+kHr0ZgyGhDV98Y= Received: from mail.baihui.com by mx.zoho.com.cn with SMTP id 1574244491265376.2364367640208; Wed, 20 Nov 2019 18:08:11 +0800 (CST) Date: Wed, 20 Nov 2019 18:08:11 +0800 From: Chengguang Xu To: "Gao Xiang" Message-ID: <16e88489ffe.10e665830795.7449424624832388952@mykernel.net> In-Reply-To: <20191119125328.GA86789@architecture4> References: <20191119113744.11635-1-cgxu519@mykernel.net> <20191119125328.GA86789@architecture4> Subject: Re: [PATCH] erofs: add error handling for erofs_fill_super() MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Priority: Medium User-Agent: ZohoCN Mail X-Mailer: ZohoCN Mail X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: cgxu519@mykernel.net Cc: miaoxie , xiang , linux-erofs Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" ---- =E5=9C=A8 =E6=98=9F=E6=9C=9F=E4=BA=8C, 2019-11-19 20:51:13 Gao Xiang = =E6=92=B0=E5=86=99 ---- > Hi Chengguang, >=20 > On Tue, Nov 19, 2019 at 07:37:44PM +0800, Chengguang Xu wrote: > > There are some potential resource leaks in error case > > of erofs_fill_super(), so add proper error handling > > for it. > >=20 > > Signed-off-by: Chengguang Xu > > --- > > fs/erofs/super.c | 31 +++++++++++++++++++++++-------- > > 1 file changed, 23 insertions(+), 8 deletions(-) > >=20 > > diff --git a/fs/erofs/super.c b/fs/erofs/super.c > > index 0e369494f2f2..06e721bd1c8c 100644 > > --- a/fs/erofs/super.c > > +++ b/fs/erofs/super.c > > @@ -369,7 +369,7 @@ static int erofs_fill_super(struct super_block *sb= , void *data, int silent) > > sb->s_fs_info =3D sbi; > > err =3D erofs_read_superblock(sb); > > if (err) > > - return err; > > + goto free; >=20 > Could you give some hints what is the potential leak exactly? > Actually, it was modified on purpose recently, see the following threads= : > https://lore.kernel.org/r/20190720224955.GD17978@ZenIV.linux.org.uk > and > https://lore.kernel.org/r/20190721040547.GF17978@ZenIV.linux.org.uk Sorry, it seems I misread some part of code, please just drop the patch. Thanks