Date: Sun, 18 Jun 2006 19:25:12 +1000 From: Nick Withers <nick@nickwithers.com> To: "Nick Borisov" <neiro21@gmail.com> Cc: freebsd-security@freebsd.org Subject: Re: memory pages nulling when releasing Message-ID: <20060618192512.dffbd7f3.nick@nickwithers.com> In-Reply-To: <3bcb4e3f0606180127m3c4fdb13n2b42deb881b7bdc6@mail.gmail.com> References: <3bcb4e3f0606180056o63424cc0g5c121443e45fa333@mail.gmail.com> <3bcb4e3f0606180127m3c4fdb13n2b42deb881b7bdc6@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 18 Jun 2006 12:27:22 +0400 "Nick Borisov" <neiro21@gmail.com> wrote: > Hello everyone! > > Could you tell me if FreeBSD supports memory page nulling when > releasing it to prevent unauthorized access to data left in the page > after it's allocated again. I'm certainly not as expert in this area, but I thought I'd offer the following suggestions anyway (I'm assuming you're coding in C, here): - You might want to look at _malloc_options / MALLOC_OPTIONS (for example, '_malloc_options = "J";'), though this might be an expensive way to achieve the goal. See man 2 free for more information - You could zero a memory range explicitly before free()ing it, using bzero(3) or memset(3), for instance, or even just by assignment in some cases. This has the notable advantage that you can hand-pick which data you're zeroing based on individual merit > If it does, what sys calls etc provide that? > IMHO this is an important issue when operating data with different > sensivity levels. > > Thanks in advance. > > Nick Hope that helps! -- Nick Withers email: nick@nickwithers.com Web: http://www.nickwithers.com Mobile: +61 414 397 446
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060618192512.dffbd7f3.nick>