[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Physical page zeroing on allocation

On 04/04/2013 06:39, Viacheslav Fedorov wrote:
> Samuel Thibault <sthibault@debian.org <mailto:sthibault@debian.org>> writes:
>>>when allocating an anonymous physical page on a Page Fault,
>>> why does kernel have to fill it with zeroes?
>>> I understand it has something to do with security.
>>See man mmap. Anonymous memory is explicitly documented as being set to
> Ok,thanks. So libraries and things are potentially expecting the memory to be 0,
> hence my troubles.

mmap(2) is documented to return 0-initialized pages for MAP_ANONYMOUS, so what
are you fussing about?

> By removing __GFP_ZERO flag from alloc_page_vma function.

i.e. breaking documented behaviour. This is just like modifying the compiler to
be non-conformant to standards, and complaining that standards-compliant
programs fail as a result.

Kind regards,
Loong Jin

Attachment: signature.asc
Description: OpenPGP digital signature

Reply to: