If a process runs right after another process quit (for example) the second process may get allocated some of the first process real pages. Is it possible that the second process may be able to read some of the first process’s data? (Question for Windows and/or Linux OSs)
If a process runs right after another process quit (for example) the second process
Share
Most OSes with a security model (NT-based Windows, most Unixes, Mac OS…) will scrub pages of memory (usually by overwriting with zeros) for precisely this reason. Of course, within a single process you can reuse memory pages without scrubbing.
You can see this in linux in do_anonymous_page (line 3143 of mm/memory.c in v3.6.6). When a write request comes for a page that has been mapped but not allocated, the kernel calls
alloc_zeroed_user_highpage_movableto allocate a zeroed page.