mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: Chen Zhongjin <chenzhongjin@huawei.com>, <ntfs3@lists.linux.dev>,
	<linux-kernel@vger.kernel.org>
Cc: <kari.argillander@gmail.com>
Subject: Re: [PATCH] fs/ntfs3: Fix leaked mount_options if fill_super failed
Date: Mon, 26 Dec 2022 19:41:26 +0400	[thread overview]
Message-ID: <49383f48-0796-3f84-d21b-1a92b92f64e3@paragon-software.com> (raw)
In-Reply-To: <20221122092518.231347-1-chenzhongjin@huawei.com>

On 22.11.2022 13:25, Chen Zhongjin wrote:
> '9b75450d6c58 ("fs/ntfs3: Fix memory leak if fill_super failed")'
> Previous patch fixed leaked sbi when fill_super failed but forgot to put
> mount_options and left it leaked as kmemleak reported:
>
> unreferenced object 0xffff888107c353c0 (size 32):
>    backtrace:
>      [<00000000cf2c8c32>] kmalloc_trace+0x27/0x110
>      [<000000000184a864>] ntfs_init_fs_context+0x4c/0x540 [ntfs3]
>      [<000000008ded85aa>] alloc_fs_context+0x50e/0x940
>      [<00000000c225e601>] path_mount+0x747/0x1930
>      [<000000007bf15a5f>] do_mount+0xf3/0x110
>      ...
> unreferenced object 0xffff888101fdc2d0 (size 8):
>    backtrace:
>      [<00000000d0cba437>] __kmalloc_node_track_caller+0x4c/0x1c0
>      [<00000000923513f8>] kmemdup_nul+0x37/0xb0
>      [<000000007a9b98ed>] vfs_parse_fs_string+0xc5/0x150
>      [<00000000afbd0594>] generic_parse_monolithic+0x140/0x1c0
>      [<00000000e97e814e>] path_mount+0xf09/0x1930
>      [<000000007bf15a5f>] do_mount+0xf3/0x110
>      ...
>
> Fixes: 610f8f5a7baf ("fs/ntfs3: Use new api for mounting")
> Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
> ---
>   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 work, this bug has already been fixed:

https://lore.kernel.org/ntfs3/20220823103205.1380235-1-syoshida@redhat.com/


      reply	other threads:[~2022-12-26 15:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22  9:25 Chen Zhongjin
2022-12-26 15:41 ` Konstantin Komarov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49383f48-0796-3f84-d21b-1a92b92f64e3@paragon-software.com \
    --to=almaz.alexandrovich@paragon-software.com \
    --cc=chenzhongjin@huawei.com \
    --cc=kari.argillander@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntfs3@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®