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]
Message-ID: <86802c440806300231x47ea191fmc5087057a50c59bd@mail.gmail.com>
Date:	Mon, 30 Jun 2008 02:31:50 -0700
From:	"Yinghai Lu" <yhlu.kernel@...il.com>
To:	"Huang, Ying" <ying.huang@...el.com>
Cc:	"H. Peter Anvin" <hpa@...or.com>, andi@...stfloor.org,
	mingo@...hat.com, tglx@...utronix.de, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] x86 boot: add E820_RESVD_KERN

On Mon, Jun 30, 2008 at 2:15 AM, Yinghai Lu <yhlu.kernel@...il.com> wrote:
> On Mon, Jun 30, 2008 at 12:51 AM, Huang, Ying <ying.huang@...el.com> wrote:
>> On Mon, 2008-06-30 at 00:34 -0700, Yinghai Lu wrote:
>>> On Mon, Jun 30, 2008 at 12:03 AM, Huang, Ying <ying.huang@...el.com> wrote:
>>> > On Fri, 2008-06-27 at 15:05 -0700, Yinghai Lu wrote:
>>> >> On Thu, Jun 26, 2008 at 7:48 PM, Huang, Ying <ying.huang@...el.com> wrote:
>>> >> > On Thu, 2008-06-26 at 19:22 -0700, Yinghai Lu wrote:
>>> >> >> On Thu, Jun 26, 2008 at 2:47 AM, Yinghai Lu <yhlu.kernel@...il.com> wrote:
>>> >> >> > On Thu, Jun 26, 2008 at 12:48 AM, Huang, Ying <ying.huang@...el.com> wrote:
>>> >> >> >> On Thu, 2008-06-26 at 00:25 -0700, Yinghai Lu wrote:
>>> >> >> >> [...]
>>> >> >> >>> >                if (pfn >= limit_pfn)
>>> >> >> >>> > @@ -977,7 +978,7 @@ u64 __init early_reserve_e820(u64 startt
>>> >> >> >>> >                return 0;
>>> >> >> >>> >
>>> >> >> >>> >        addr = round_down(start + size - sizet, align);
>>> >> >> >>> > -       e820_update_range(addr, sizet, E820_RAM, E820_RESERVED);
>>> >> >> >>> > +       e820_update_range(addr, sizet, E820_RAM, E820_RESVD_KERN);
>>> >> >> >>>
>>> >> >> >>> this line is not needed.
>>> >> >> >>
>>> >> >> >> Why? Memory reserved by early_rserved_e820 should not be saved during
>>> >> >> >> hibernation? shoudl not be saved by kdump?
>>> >> >> >>
>>> >> >
>>> >> > Can you tell me why this line is not needed?
>>> >> >
>>> >> > [...]
>>> >> >> some like the attach patch...
>>> >> >>
>>> >> >> you still can merge parse_setup_data parse_e820_ext
>>> >> >> also entries in parse_e820_ext is not initialized..., __copy_e820_map
>>> >> >> will do nothing.
>>> >> >
>>> >> > OK. Because some E820 entries are available after parse_setup_data(),
>>> >> > it is better to call reserve_setup_data() after calling
>>> >> > parse_setup_data() if update_e820_range() is used instead of
>>> >> > reserve_early().
>>> >>
>>> >> please modify it and test on your platforms then submit to Ingo..
>>> >
>>> > It seems that there is an issue:
>>> >
>>> > - If parse_setup_data() is called before reserve_setup_data(), and there
>>> > is a conflict between memory area used by setup_data and other memory
>>> > area, it is possible that the contents of setup_data is changed. So that
>>> > system may panic before reporting memory area conflict. And it seems
>>> > that memory area conflict is not checked by e820_update_range().
>>>
>>> what is "other memory area"? returned from find_e820_area? no one use that yet.
>>
>> I mean memory area reserved with reserved_early() or e820_update_range()
>> before reserve_setup_data() is called.
>
> before parse_setup_data, reserve_early is called for
> 1. kernel text/data/bss + initial pgt
> 2. ramdisk
> 3. ebda
> e820_update_range is not called.
> at this time early_res have RAM reserved by kernel.
>
> then setup_memory_map is called, so e820 have some ranges...directly
> from e820 table
>
> next need to call parse_setup_data
> it will add some entries in e820
>
> then reserve_setup_data is called, it will use e820_update_range to
> reserve setup_data itself directly in e820
>
> ...
>
>>
>> And because there is no conflict check in e820_update_range(), what to
>> deal with potential conflict between setup_data and other memory area
>> regardless which one is reserved earlier?
>
> find_e820_area will make sure it only find ram from e820 and it is not
> conflict with early_res
>
>
>>
>>
>> Another issue related:
>>
>> Because some memmap entries are available via extended E820 memmap
>> (SETUP_E820_EXT), it is not strictly safe to use e820_update_range()
>> between setup_memory_map() and parse_setup_data(). It may be better to
>> parse extended E820 memmap right after setup_memory_map().
>
> will look at the code again..

Ying,

please check attach the v2 patch...
remove one left over reserve_setup_data for 32 bit

YH

View attachment "reserve_setup_data_v2.patch" of type "text/x-patch" (4777 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ