From: Roberto Sassu <roberto.sassu@polito.it>
To: Sebastian Ott <sebott@linux.vnet.ibm.com>
Cc: James Morris <jmorris@namei.org>,
Mimi Zohar <zohar@linux.vnet.ibm.com>,
linux-security-module <linux-security-module@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL] ima: bug fixes for Linus
Date: Wed, 27 Nov 2013 13:46:43 +0100 [thread overview]
Message-ID: <5295E9B3.202@polito.it> (raw)
In-Reply-To: <alpine.LFD.2.10.1311271301430.1885@c4eb>
On 11/27/2013 01:11 PM, Sebastian Ott wrote:
> Hello,
>
> On Mon, 25 Nov 2013, Roberto Sassu wrote:
>
>> On 11/25/2013 07:46 PM, Roberto Sassu wrote:
>>> On 11/25/2013 04:40 PM, James Morris wrote:
>>>> On Mon, 25 Nov 2013, Mimi Zohar wrote:
>>>>
>>>>> Hi James,
>>>>>
>>>>> These are the "essential fixes for regressions".
>>>>>
>>>>> The following changes since commit
>>>>> 4c1cc40a2d49500d84038ff751bc6cd183e729b5:
>>>>>
>>>>> Revert "KEYS: verify a certificate is signed by a 'trusted' key"
>>>>> (2013-11-23 16:38:17 -0800)
>>>>>
>>>>> are available in the git repository at:
>>>>>
>>>>>
>>>>> git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity
>>>>> for-linus
>>>>>
>>>>> for you to fetch changes up to 72ca1bd303a5126d0ce377cff699282b6b38bd86:
>>>>>
>>>>> ima: make a copy of template_fmt in template_desc_init_fields()
>>>>> (2013-11-25 07:32:46 -0500)
>>>>>
>>>>> thanks,
>>>>>
>>>>> Mimi
>>>>>
>>>>> ----------------------------------------------------------------
>>>>> Roberto Sassu (3):
>>>>
>>>>> ima: make a copy of template_fmt in template_desc_init_fields()
>
> commit dbc335d2dc3c437649eb6b39f4e9aee2a13eb0af
> "ima: make a copy of template_fmt in template_desc_init_fields()"
>
> claimed to fix a kstrdup memleak..looks like it didn't:
>
> unreferenced object 0x56c82370 (size 8):
> comm "swapper/0", pid 1, jiffies 4294937476 (age 916.520s)
> hex dump (first 8 bytes):
> 64 00 6e 00 6b 6b 6b a5 d.n.kkk.
> backtrace:
> [<000000000027c7ac>] __kmalloc_track_caller+0x2e0/0x450
> [<0000000000240738>] kstrdup+0x4c/0xd0
> [<00000000003c93c4>] ima_init_template+0x9c/0x1f4
> [<0000000000a11a54>] ima_init+0x74/0x98
> [<0000000000a11ba8>] init_ima+0x30/0x4c
> [<00000000001001e2>] do_one_initcall+0xce/0x160
> [<00000000009ebb70>] kernel_init_freeable+0x22c/0x2dc
> [<000000000061b704>] kernel_init+0x24/0x134
> [<0000000000633322>] kernel_thread_starter+0x6/0xc
> [<000000000063331c>] kernel_thread_starter+0x0/0xc
> unreferenced object 0x56ccc158 (size 16):
> comm "swapper/0", pid 1, jiffies 4294937476 (age 916.520s)
> hex dump (first 16 bytes):
> 64 2d 6e 67 00 6e 2d 6e 67 00 73 69 67 00 6b a5 d-ng.n-ng.sig.k.
> backtrace:
> [<000000000027c7ac>] __kmalloc_track_caller+0x2e0/0x450
> [<0000000000240738>] kstrdup+0x4c/0xd0
> [<00000000003c93c4>] ima_init_template+0x9c/0x1f4
> [<0000000000a11a54>] ima_init+0x74/0x98
> [<0000000000a11ba8>] init_ima+0x30/0x4c
> [<00000000001001e2>] do_one_initcall+0xce/0x160
> [<00000000009ebb70>] kernel_init_freeable+0x22c/0x2dc
> [<000000000061b704>] kernel_init+0x24/0x134
> [<0000000000633322>] kernel_thread_starter+0x6/0xc
> [<000000000063331c>] kernel_thread_starter+0x0/0xc
>
>
> strsep will modify your template_fmt_copy pointer.
>
Hi Sebastian
thanks for the report. I'm very sorry.
I should have prepared the patch more carefully.
I'll provide a fix shortly.
Thanks
Roberto Sassu
> Regards,
> Sebastian
>
>>>>
>>>>
>>>>> template_desc_init_fields(char *template_fmt,
>>>>
>>>> That should probably be const char.
>>>>
>>>> Also, the call to kstrdup() results in a memory leak.
>>>>
>>>
>>> Hi James
>>>
>>> thanks for the comments. I'm implementing them and I will post
>>> a new version of the patch 'ima: make a copy of template_fmt in
>>> template_desc_init_fields()' shortly.
>>>
>>
>> Hi everyone
>>
>> attached to this email, there is the new version of the above patch.
>>
>> Regards
>>
>> Roberto Sassu
>>
>>
>>> Roberto Sassu
>>>
>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>
next prev parent reply other threads:[~2013-11-27 12:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 18:40 [GIT PULL] ima: bug fixes for Linus Mimi Zohar
2013-11-24 15:21 ` Mimi Zohar
2013-11-24 22:44 ` James Morris
2013-11-25 0:14 ` Mimi Zohar
2013-11-25 2:14 ` James Morris
2013-11-25 12:03 ` Mimi Zohar
2013-11-25 13:51 ` Mimi Zohar
2013-11-25 15:40 ` James Morris
2013-11-25 18:46 ` Roberto Sassu
2013-11-25 18:55 ` Roberto Sassu
2013-11-27 12:11 ` Sebastian Ott
2013-11-27 12:46 ` Roberto Sassu [this message]
2013-11-27 13:40 ` [PATCH] ima: store address of template_fmt_copy in a pointer before calling strsep Roberto Sassu
2013-11-27 14:55 ` Mimi Zohar
2013-11-27 15:01 ` Sebastian Ott
2013-11-25 20:33 ` [GIT PULL v3] ima: bug fixes for Linus Mimi Zohar
2013-11-25 20:54 ` Shuah Khan
2013-11-25 21:32 ` Mimi Zohar
2013-11-25 19:18 ` [PATCH] ima: make a copy of template_fmt in template_desc_init_fields() Roberto Sassu
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=5295E9B3.202@polito.it \
--to=roberto.sassu@polito.it \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=sebott@linux.vnet.ibm.com \
--cc=zohar@linux.vnet.ibm.com \
/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.