From: Greg KH <gregkh@linuxfoundation.org>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Masami Ichikawa <masami256@gmail.com>,
linux-kernel@vger.kernel.org, stable <stable@vger.kernel.org>
Subject: Re: [PATCH] Fix memory leak in sysfs_sd_setsecdata().
Date: Thu, 8 Mar 2012 13:14:06 -0800 [thread overview]
Message-ID: <20120308211406.GA24445@kroah.com> (raw)
In-Reply-To: <m11up2zu03.fsf@fess.ebiederm.org>
On Thu, Mar 08, 2012 at 01:02:20PM -0800, Eric W. Biederman wrote:
> Masami Ichikawa <masami256@gmail.com> writes:
>
> > This patch fixies follwing two memory leak patterns that reported by kmemleak.
> > sysfs_sd_setsecdata() is called during sys_lsetxattr() operation.
> > It checks sd->s_iattr is NULL or not. Then if it is NULL, it calls
> > sysfs_init_inode_attrs() to allocate memory.
> > That code is this.
>
> I don't know how you count two memory leaks. But there is definitely a
> leak here sd->s_iattr is allocated and then never assigned. It looks
> like I introduced that leak when I re-factored the code to protect
> the code with sysfs_mutex at the end of 2009.
>
> I am surprise the securlity label crowd has not been screaming about
> selinux protection not working on sysfs for the last two years.
>
> I have reviewed the code and the fix looks obvious and correct.
>
> Greg can you pick this up?
I applied it a while ago to my tree already :)
thanks,
greg k-h
next prev parent reply other threads:[~2012-03-08 21:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-20 22:43 [PATCH] Fix memory leak in sysfs_sd_setsecdata() Masami Ichikawa
[not found] ` <m11up2zu03.fsf@fess.ebiederm.org>
2012-03-08 21:14 ` Greg KH [this message]
2012-03-08 21:43 ` Eric W. Biederman
2012-03-08 22:33 ` Masami Ichikawa
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=20120308211406.GA24445@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami256@gmail.com \
--cc=stable@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).