Search code examples
operating-systempagingmmu

What is the reason for zero-out pages before allocate?


O/S has free pool of pages. So different process can release pages into free pool. Before it takes a page from pool O/S zero-out page. Because their may be confidential data on pages. But why it zero-out? Is it necessary? It can't see even if their is confidential data. because address spaces of different process is unique.

What is the reason for zero-out pages before allocate?


Solution

  • Processes can see confidential data if the OS lets them.

    If process A gets a page of physical memory, and writes confidential data to that page, and then frees it, and then process B gets the same physical page, process B can see the data on that page!

    The only reason why process B normally can't see the data is BECAUSE the operating system zeroes it out!