lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 22 Nov 2013 17:23:49 +0100
From:	Roberto Sassu <roberto.sassu@...ito.it>
To:	Heiko Carstens <heiko.carstens@...ibm.com>
CC:	Mimi Zohar <zohar@...ux.vnet.ibm.com>,
	Martin Schwidefsky <schwidefsky@...ibm.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [BUG] 3ce1217d6cd5 ima patch causes s390 to crash on boot

On 11/22/2013 03:13 PM, Heiko Carstens wrote:
> On Fri, Nov 22, 2013 at 02:28:33PM +0100, Roberto Sassu wrote:
>> On 11/22/2013 12:48 PM, Heiko Carstens wrote:
>>> Hi Roberto,
>>>
>>> your patch 3ce1217d6cd5 "ima: define template fields library and new helpers"
>>> causes s390 to crash on boot:
>>>
>>
>> Hi Heiko
>>
>> thanks for the information. I think this issue is related to the error
>> detected by the kbuild test robot. Please, try to apply the attached
>> patch to see if it solves the problem.
>
> No, the patch doesn't fix the problem.

Ok, sorry for the delay. I was involved in another task.

The previous patch is not correct, as I allocate an
array of pointers, not structures. You can discard it.

Another problem that I found is that strsep()
modifies the source buffer by replacing the separator
character with '\0'. In particular, this function
modifies static data initialized at the beginning
of the ima_template.c file. Maybe, this is causing
the kernel panic. I already sent a patch to fix this
problem (attached to the email) even if it is not
supposed to land on the 3.13 kernel. Let me know
if this fixes the issue. Otherwise, I will check
the code more in depth.

Thanks

Roberto


>
>> From: Fengguang Wu <fengguang.wu@...el.com>
>> Subject: [PATCH] ima: fix coccinelle warnings
>> TO: Mimi Zohar <zohar@...ux.vnet.ibm.com>
>> CC: Roberto Sassu <roberto.sassu@...ito.it>
>> CC: linux-kernel@...r.kernel.org
>>
>> security/integrity/ima/ima_template.c:62:41-47: ERROR: application of sizeof to pointer
>>
>>   sizeof when applied to a pointer typed expression gives the size of
>>   the pointer
>>
>> Generated by: coccinelle/misc/noderef.cocci
>>
>> CC: Roberto Sassu <roberto.sassu@...ito.it>
>> CC: Mimi Zohar <zohar@...ux.vnet.ibm.com>
>> Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
>> ---
>>
>>   cocci-output-13142-271b5e-ima_template.c |    2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> --- a/security/integrity/ima/ima_template.c
>> +++ b/security/integrity/ima/ima_template.c
>> @@ -59,7 +59,7 @@ static int template_desc_init_fields(cha
>>   	if (template_num_fields > IMA_TEMPLATE_NUM_FIELDS_MAX)
>>   		return -EINVAL;
>>
>> -	*fields = kzalloc(template_num_fields * sizeof(*fields), GFP_KERNEL);
>> +	*fields = kzalloc(template_num_fields * sizeof(**fields), GFP_KERNEL);
>>   	if (*fields == NULL) {
>>   		result = -ENOMEM;
>>   		goto out;
>


View attachment "0002-ima-make-a-copy-of-template_fmt-in-template_desc_ini.patch" of type "text/x-diff" (1769 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ