From: ebiederm@xmission.com (Eric W. Biederman)
To: Greg KH <gregkh@linuxfoundation.org>
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, 08 Mar 2012 13:43:09 -0800 [thread overview]
Message-ID: <m1aa3qwyz6.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <20120308211406.GA24445@kroah.com> (Greg KH's message of "Thu, 8 Mar 2012 13:14:06 -0800")
Greg KH <gregkh@linuxfoundation.org> writes:
> 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 :)
Odd I didn't see it linux-next when I looked an hour or so ago.
As long as it is there and it makes it to stable.
Eric
next prev parent reply other threads:[~2012-03-08 21:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-20 22:43 Masami Ichikawa
[not found] ` <m11up2zu03.fsf@fess.ebiederm.org>
2012-03-08 21:14 ` Greg KH
2012-03-08 21:43 ` Eric W. Biederman [this message]
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=m1aa3qwyz6.fsf@fess.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=gregkh@linuxfoundation.org \
--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
all inboxes | Powered by JetHome®