lkml.org 
[lkml]   [2012]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [BUG]memblock: fix overflow of array index
Hello,

On Thu, Apr 26, 2012 at 08:50:58AM +0800, Peter Teoh wrote:
> Thanks for the reply. Just an educational question: is it possible
> to set one-byte per memblock? And what is the minimum memblock
> size?

1 byte.

> Even if 2G memblock is a huge number, it still seemed like a bug to me
> that there is no check on the maximum number (which is 2G) of this
> variable (assuming signed int). Software can always purposely push
> that number up and the system can panic?

Yeah, if somebody messes the BIOS / firmware to oblivion. I don't
really care at that point tho. memblock is a boot time memory
allocator and it assumes BIOS / firmware isn't completely crazy. It
uses contiguous tables to describe all the blocks, walks them
one-by-one for allocation and even compacts them.

Well before memblock fails from any of the above, the machine would be
failing miserably in firmware / BIOS.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2012-04-26 17:05    [W:0.091 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site