Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7808297rwn; Wed, 14 Sep 2022 05:00:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR7axZUbrcqU9EBGwSVe+MbTatoGesBhyzXVYGyvpyl27ojtOggiI7VN1du34KNC0Vad/AJW X-Received: by 2002:a17:907:5ce:b0:730:bae0:deb with SMTP id wg14-20020a17090705ce00b00730bae00debmr25963399ejb.181.1663156816845; Wed, 14 Sep 2022 05:00:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663156816; cv=pass; d=google.com; s=arc-20160816; b=sjrSH0tXu1CqSUGzOnGtgfoZlVJ+shqKgxQ7MLMI4xyXfy+GyoIBIMQaQJ3FPxe1cu 2XhdL7xlkZ5Lbf36F/fZjoPF1AWrfjPCuOp8hyh7Ty2SeKo7lQA79/g4XcYcUi7GQ/i1 X47wU+jgL3M4GFaIqjGWj8/kzTvTmbLG4pkOasX8RqW9227lcIh7vbfCplHLNfS7hg7n 59L1uBkEhYhEuQJ2ZCUtCVhaCFoQ71FGvW6DSebL5IactGJUKtVKhz4L2wQLrQQ+lMPJ 28XOsg8m7MmB8Nx3P7n5T8+NpRD5HR/e70XA7ARI6j9pR6jFuZEx+S04QGPQyupRStlm +7Ww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date :subject:message-id:cc:to:from:dkim-signature; bh=+llC5L3toh5m6/IGcaq3njngvo8xvm7Ec+Uc9KcqTeM=; b=VIkM8vxo88aO143eiisUPa4tOgvbdxXmMypO0ptR3ao3ttKK003M4LIkOPK9mO0dSZ EcqStk4cTHnldpw5ehkyaHkb45UOj8RaSsaCy+oMsZUei8a+iUUidrTydylHvKssWj5e /R7Iwriay53v5706trW1J67gippJ6LSW0ljtXXtxSSHPTZ+UJy6JGUXLy5Ox5hcg+c7A huCn+BP0f2cvKsGHihfvg2EdwNQHLyehNYfeynw2WMA1JTOsi0hXGJSoAy2WsSdr6+eY LGC4zpRRT73x/8bbmXz6KA+9WeDPUscRG6LYRFFCiAdXhKnjG1exk/EtH1xgbLKp3Zhr +9oA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=bRobQpH2; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf28-20020a1709077f1c00b0077f4362c957si6395109ejc.702.2022.09.14.04.59.50; Wed, 14 Sep 2022 05:00:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siddh.me header.s=zmail header.b=bRobQpH2; arc=pass (i=1 spf=pass spfdomain=siddh.me dkim=pass dkdomain=siddh.me dmarc=pass fromdomain=siddh.me>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siddh.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229676AbiINLRX (ORCPT + 99 others); Wed, 14 Sep 2022 07:17:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbiINLRT (ORCPT ); Wed, 14 Sep 2022 07:17:19 -0400 Received: from sender-of-o50.zoho.in (sender-of-o50.zoho.in [103.117.158.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EBC14D24D; Wed, 14 Sep 2022 04:17:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663154217; cv=none; d=zohomail.in; s=zohoarc; b=BJwEfHEXjRmXkFkHW+Om2xekj3PQzcIMUuwislfMvWQu9fzA4tgFJWYEmJMVbDniPhluuUjCcScGBZrJ89VHk1mhYtxa36Y2OcYuNgp/9f2LHgNtYGLXxQAS3/BFSINlssSO3SZto7acP1XcN/RkFX6i26yuDFUeSOK5SGqMGDw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1663154217; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=+llC5L3toh5m6/IGcaq3njngvo8xvm7Ec+Uc9KcqTeM=; b=XOopyJWXFsVIZu9yxu905UBMM2nvyHpnl4CDtGH/h0lJV3VZQ5gLxwtkNdE0jjLUg/JT8VZBakNXYSJAE2zG90N0GFxy2TJmX8ZPmHygMYwWH9itWyv2qC53RxnQVXZksbX+NSfcSCEaPIjCI2RxOdJyknCnu4GYiPj86Tsjl74= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=siddh.me; spf=pass smtp.mailfrom=code@siddh.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1663154217; s=zmail; d=siddh.me; i=code@siddh.me; h=From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:Date:Date:MIME-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Reply-To; bh=+llC5L3toh5m6/IGcaq3njngvo8xvm7Ec+Uc9KcqTeM=; b=bRobQpH2xTOa2z5qKvwtR1SAvxlVlVypTbSu8XuKnhGq+8S8hA64iIm2+7nCF+4j eNRBQLVEMlivAIu7j/UXzR3NNbJJrWl+NlFVoagjt3ewUfNi5jCh18sgW3aQPJYN+o6 V6Ux/LjmYINQMhMRNFN1I5xrHaLlJ4ybU4gqXkrA= Received: from localhost.localdomain (43.241.144.117 [43.241.144.117]) by mx.zoho.in with SMTPS id 1663154216126366.814546035366; Wed, 14 Sep 2022 16:46:56 +0530 (IST) From: Siddh Raman Pant To: Konstantin Komarov Cc: ntfs3 , linux-kernel , syzbot+9d67170b20e8f94351c8@syzkaller.appspotmail.com, stable@vger.kernel.org Message-ID: <20220914111643.14411-1-code@siddh.me> Subject: [PATCH] ntfs3: Fix memory leak in ntfs_fill_super() Date: Wed, 14 Sep 2022 16:46:43 +0530 X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Content-Type: text/plain; charset=utf8 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mount options ptr wasn't freed before putting the superblock in ntfs_fill_super(), which resulted in a memory leak. Bug report: https://syzkaller.appspot.com/bug?id=3D332ba47915d0e39e94b42a62= 2f195f0804ecb67f Fixes: 9b75450d6c58 ("fs/ntfs3: Fix memory leak if fill_super failed") Reported-and-tested-by: syzbot+9d67170b20e8f94351c8@syzkaller.appspotmail.c= om Cc: stable@vger.kernel.org # 5.15 Signed-off-by: Siddh Raman Pant --- fs/ntfs3/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index 47012c9bf505..c0e45f170701 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -1281,6 +1281,7 @@ static int ntfs_fill_super(struct super_block *sb, st= ruct fs_context *fc) =09 * Free resources here. =09 * ntfs_fs_free will be called with fc->s_fs_info =3D NULL =09 */ +=09put_mount_options(sbi->options); =09put_ntfs(sbi); =09sb->s_fs_info =3D NULL; =20 --=20 2.35.1