Not logged in
Log in now
Create an account
Subscribe to LWN
Pencil, Pencil, and Pencil
Dividing the Linux desktop
LWN.net Weekly Edition for June 13, 2013
A report from pgCon 2013
Little things that matter in language design
On the face of it that sounds pretty sensible (from a security perspective).
Why doesn't Linux do it?
Zeroing freed memory
Posted Nov 13, 2008 0:48 UTC (Thu) by nix (subscriber, #2304)
Posted Nov 13, 2008 22:45 UTC (Thu) by bdauvergne (subscriber, #6989)
Posted Nov 13, 2008 9:19 UTC (Thu) by dlang (✭ supporter ✭, #313)
since it may sometimes not need to be zeroed (besides the kernel uses noted in post above, if the page is going to be used to hold the executable code to be run, just load the appropriate code in the page, there's no benifit to zeroing it out first) and other times it can be zeroed when the system is idle, linux does the more efficant thing and zeros the page with as little impact tot he rest of the system as possible.
Linux can do it
Posted Nov 13, 2008 15:07 UTC (Thu) by wtogami (subscriber, #32325)
Posted Nov 13, 2008 19:52 UTC (Thu) by nix (subscriber, #2304)
Posted Nov 14, 2008 15:10 UTC (Fri) by PaXTeam (subscriber, #24616)
PaX has had such a feature for some time, but its performance impact isn't negligible. i have only numbers for an early naive implementation (pages were zeroed twice effectively), the kernel time of kernel compilation went up by some 40%, IIRC, so even assuming the current implementation it's probably not better than 20%. now this is kernel time only, if your workload is mostly userland then you will care a lot less, otherwise you'll have to find out where on the user/kernel scale you fall and decide accordingly if it's worth it.
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds