[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180910061839.GA90334@gmail.com>
Date: Mon, 10 Sep 2018 08:18:39 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Baoquan He <bhe@...hat.com>
Cc: tglx@...utronix.de, hpa@...or.com, thgarnie@...gle.com,
kirill.shutemov@...ux.intel.com, x86@...nel.org,
linux-kernel@...r.kernel.org,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [PATCH v2 1/3] x86/mm/KASLR: Fix the wrong calculation of kalsr
region initial size
* Baoquan He <bhe@...hat.com> wrote:
> In memory KASLR, __PHYSICAL_MASK_SHIFT is taken to calculate the
> initial size of the direct mapping region. This is right in the
> old code where __PHYSICAL_MASK_SHIFT was equal to MAX_PHYSMEM_BITS,
> 46bit, and only 4-level mode was supported.
>
> Later, in commit:
> b83ce5ee91471d ("x86/mm/64: Make __PHYSICAL_MASK_SHIFT always 52"),
> __PHYSICAL_MASK_SHIFT was changed to be 52 always, no matter it's
> 5-level or 4-level. This is wrong for 4-level paging. Then when
> adapt phyiscal memory region size based on available memory, it
> will overflow if the amount of system RAM and the padding is bigger
> than 64TB.
>
> In fact, here MAX_PHYSMEM_BITS should be used instead. Fix it by
> replacing __PHYSICAL_MASK_SHIFT with MAX_PHYSMEM_BITS.
>
> Fixes: b83ce5ee9147 ("x86/mm/64: Make __PHYSICAL_MASK_SHIFT always 52")
> Signed-off-by: Baoquan He <bhe@...hat.com>
> Acked-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
> Reviewed-by: Thomas Garnier <thgarnie@...gle.com>
So this changelog has a handful of problems:
- there's a typo in the title
- what does 'memory KASLR' mean? All KASLR deals with memory.
- there's a typo in the second paragraph
- Please punctuate more precisely: '64TB' is written as '64 TB' and '46bit' is written as
'46 bits'
- '52 always' is accurate but '52 bits always' would be more useful: write out units where
appropriate to reduce ambiguity and parsing complexity of changelogs. Also, in this
particular sentence it should be 'always 52 bits'.
- s/when adapt
/when we adapt
- s/This is right in the old code
/This is correct in the old code
Thanks,
Ingo
Powered by blists - more mailing lists