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] [day] [month] [year] [list]
Date:	Thu, 7 Jan 2016 19:14:20 +0800
From:	Xunlei Pang <xlpang@...hat.com>
To:	Petr Tesarik <ptesarik@...e.cz>
Cc:	Minfei Huang <mhuang@...hat.com>, kexec@...ts.infradead.org,
	linux-kernel@...r.kernel.org, ebiederm@...ssion.com,
	akpm@...ux-foundation.org, Dave Young <dyoung@...hat.com>,
	Vivek Goyal <vgoyal@...hat.com>
Subject: Re: [PATCH v2 2/2] kexec: Provide
 arch_kexec_protect(unprotect)_crashkres()

On 01/07/2016 at 05:20 PM, Petr Tesarik wrote:
> On Thu, 7 Jan 2016 13:08:21 +0800
> Xunlei Pang <xlpang@...hat.com> wrote:
>
>> On 01/07/2016 at 10:36 AM, Minfei Huang wrote:
>>> On 01/07/16 at 10:14am, Xunlei Pang wrote:
>>>>>> +static int
>>>>>> +kexec_mark_range(unsigned long start, unsigned long end, bool protect)
>>>>>> +{
>>>>>> +	struct page *page;
>>>>>> +	unsigned int nr_pages;
>>>>>> +
>>>>>> +	/* For physical range: [start, end] */
>>>>>> +	if (!start || !end || start > end)
>>>>>> +		return 0;
>>>>> Hi, Xunlei.
>>>>>
>>>>>         if (start > end)
>>>>>                 return 0;
>>>> If both start and end are zero, we want to return directly, so the two
>>>> more check doesn't hurt.
>>> How about if the start is equal to 0, and end is larger than 0? It is
>>> better to make code more robust, although it never happen in currect
>>> kexec code.
>> Hmm, this will be better:
>>
>> 	if (!end || start > end)
>> 		return 0;
>>
>> it handles the common case not using crash_low_res(start and end are 0).
> Hm, if both start and end are 0, then what about using this condition:
>
>  	if (start >= end)
>  		return 0;
>
> I think it's good enough, because if start is equal to end, then
> there's nothing to protect anyway.

In theory, start==end(not 0) still means we have 1B to protect :-)
But in practice there are no such cases, so I think this is ok.

Regards,
Xunlei

>
> Regards,
> Petr Tesarik
>
> _______________________________________________
> kexec mailing list
> kexec@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ