From: Markus Elfring <Markus.Elfring@web.de>
To: Namjae Jeon <namjae.jeon@samsung.com>, linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
stable@vger.kernel.org, syzkaller@googlegroups.com,
Al Viro <viro@zeniv.linux.org.uk>,
Sungjong Seo <sj1557.seo@samsung.com>,
Xiaolong Huang <butterflyhuangxx@gmail.com>
Subject: Re: [PATCH v2] exfat: fix memory leak in exfat_parse_param()
Date: Wed, 3 Jun 2020 08:30:48 +0200 [thread overview]
Message-ID: <d0ba7af9-acd4-b5f5-8e34-9ef4af83f458@web.de> (raw)
> Additionally, there's no point copying param->string in
> exfat_parse_param() - just steal it, leaving NULL in param->string.
> That's independent from the leak or fix thereof - it's simply
> avoiding an extra copy.
I find it clearer to provide such a source code adjustment
by a separate update step.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=d6f9469a03d832dcd17041ed67774ffb5f3e73b3#n138
Please move it into another patch.
…
> +++ b/fs/exfat/super.c
…
> @@ -686,7 +685,12 @@ static int exfat_get_tree(struct fs_context *fc)
>
> static void exfat_free(struct fs_context *fc)
> {
> - kfree(fc->s_fs_info);
> + struct exfat_sb_info *sbi = fc->s_fs_info;
> +
> + if (sbi) {
> + exfat_free_iocharset(sbi);
> + kfree(sbi);
> + }
> }
…
Can it be helpful to annotate the added check according to branch prediction?
Are valid pointers likely at this place?
Regards,
Markus
next reply other threads:[~2020-06-03 6:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-03 6:30 Markus Elfring [this message]
[not found] <CGME20200603021436epcas1p28e26eaba7140c222c9ed09b86a489b58@epcas1p2.samsung.com>
2020-06-03 2:09 ` Namjae Jeon
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=d0ba7af9-acd4-b5f5-8e34-9ef4af83f458@web.de \
--to=markus.elfring@web.de \
--cc=butterflyhuangxx@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=namjae.jeon@samsung.com \
--cc=sj1557.seo@samsung.com \
--cc=stable@vger.kernel.org \
--cc=syzkaller@googlegroups.com \
--cc=viro@zeniv.linux.org.uk \
/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®