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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E72C2C433F5 for ; Fri, 30 Sep 2022 15:51:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230174AbiI3Pv5 (ORCPT ); Fri, 30 Sep 2022 11:51:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231320AbiI3Pvu (ORCPT ); Fri, 30 Sep 2022 11:51:50 -0400 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AF0C10462F for ; Fri, 30 Sep 2022 08:51:26 -0700 (PDT) Received: from relayfre-01.paragon-software.com (unknown [172.30.72.12]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id C66A21D0C; Fri, 30 Sep 2022 15:49:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1664552949; bh=co0dMmEoGmARvBRIH+x8b0r6owgzijM7+V2oU2F9A5g=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=N7T0AdNtfVWvxuSkyTrLWo6pcs5QIg6ztWIiUuQRx/u26EWZhGX37dJz74425UYLk mEp1PliufVaThcXsiS2PyHTuToXdtR1aD0hHT/NAgZRjlr9M6NfZOqxalRl95q+weX iCojCSensY1OrQEUxGneTPrjCABIuQMMKug2uQXU= Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayfre-01.paragon-software.com (Postfix) with ESMTPS id D64D51E81; Fri, 30 Sep 2022 15:51:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1664553084; bh=co0dMmEoGmARvBRIH+x8b0r6owgzijM7+V2oU2F9A5g=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=jPbWnV0dg8J1idpqbeZtO2Kh0Ok1qw7Ql+TXjS2smAXYd862H4qzydX1ady6/4b25 7jmf5//4xpA3Y9MSMCoTU8HYHtX7yV5F2RRh8dZLttx+LO95UXtZBpFv15Zwc9bSs5 f4wJ+KmKCWtMAM21LZoqlLOWD6UjvNxgo3xG1aoI= Received: from [172.30.8.65] (172.30.8.65) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Fri, 30 Sep 2022 18:51:24 +0300 Message-ID: Date: Fri, 30 Sep 2022 18:51:23 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] fs/ntfs3: Fix memory leak on ntfs_fill_super() error path Content-Language: en-US To: Shigeru Yoshida CC: , , References: <20220823103205.1380235-1-syoshida@redhat.com> From: Konstantin Komarov In-Reply-To: <20220823103205.1380235-1-syoshida@redhat.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [172.30.8.65] X-ClientProxiedBy: vobn-exch-01.paragon-software.com (172.30.72.13) To vdlg-exch-02.paragon-software.com (172.30.1.105) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/23/22 13:32, Shigeru Yoshida wrote: > syzbot reported kmemleak as below: > > BUG: memory leak > unreferenced object 0xffff8880122f1540 (size 32): > comm "a.out", pid 6664, jiffies 4294939771 (age 25.500s) > hex dump (first 32 bytes): > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > 00 00 00 00 00 00 00 00 ed ff ed ff 00 00 00 00 ................ > backtrace: > [] ntfs_init_fs_context+0x22/0x1c0 > [] alloc_fs_context+0x217/0x430 > [] path_mount+0x704/0x1080 > [] __x64_sys_mount+0x18c/0x1d0 > [] do_syscall_64+0x34/0xb0 > [] entry_SYSCALL_64_after_hwframe+0x63/0xcd > > This patch fixes this issue by freeing mount options on error path of > ntfs_fill_super(). > > Reported-by: syzbot+9d67170b20e8f94351c8@syzkaller.appspotmail.com > Signed-off-by: Shigeru Yoshida > --- > 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, struct fs_context *fc) > * Free resources here. > * ntfs_fs_free will be called with fc->s_fs_info = NULL > */ > + put_mount_options(sbi->options); > put_ntfs(sbi); > sb->s_fs_info = NULL; > Thanks for patch, applied!