All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Chengguang Xu <cgxu519@icloud.com>
Cc: Eric Sandeen <sandeen@sandeen.net>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: fix potential memory leak in mount option parsing
Date: Sun, 25 Feb 2018 10:09:16 -0800	[thread overview]
Message-ID: <20180225180916.GB19312@magnolia> (raw)
In-Reply-To: <326CF29E-FC88-493B-B16E-7EA318169E9A@icloud.com>

On Sun, Feb 25, 2018 at 12:11:23PM +0800, Chengguang Xu wrote:
> > 
> > 在 2018年2月25日,上午1:58,Eric Sandeen <sandeen@sandeen.net> 写道:
> > 
> > On 2/24/18 4:33 AM, Chengguang Xu wrote:
> >> When specifying string type mount option (e.g., logdev)
> >> several times in a mount, current option parsing may
> >> cause memory leak. Hence, call kfree for previous one
> >> in this case.
> >> 
> >> Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
> > 
> > IMHO multiple specifications of logdev or rtdev should not
> > be allowed; only one may be chosen, and specifying twice
> > should probably be considered and administrative error.
> > 
> > I'd rather see something that fails and cleans up properly
> > if either option is respecified.
> 
> Hi Eric,
> 
> Thanks for quick reply. I think your suggestion makes sense,
> but considering of the consistency with other options, 
> we should check multiple specifications for all options. 
> 
> So I think this patch is the cheapest way to fix the issue.
> What do you think?

I think the all the mount options should be cleaned up to allow one
specification only.

--D

> 
> 
> Thanks,
> Chengguang.--
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2018-02-25 18:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-24 10:33 [PATCH] xfs: fix potential memory leak in mount option parsing Chengguang Xu
2018-02-24 17:58 ` Eric Sandeen
2018-02-25  4:11   ` Chengguang Xu
2018-02-25 18:09     ` Darrick J. Wong [this message]
2018-02-25 18:11       ` Eric Sandeen
2018-02-25 21:05         ` Dave Chinner
2018-02-25 21:15           ` Eric Sandeen
2018-02-26  1:49         ` Chengguang Xu
2018-02-26  2:47 ` Eric Sandeen

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=20180225180916.GB19312@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=cgxu519@icloud.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.