zero-ing is not enough

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Tue Sep 9 11:59:32 PDT 2014


On 9/9/2014 7:42 AM, David Nadlinger wrote:
> On Tuesday, 9 September 2014 at 07:09:52 UTC, bearophile wrote:
>> John Colvin:
>>
>>> http://www.daemonology.net/blog/2014-09-06-zeroing-buffers-is-insufficient.html
>>>
>>> D could incorporate something like this, no?
>>
>> See:
>> https://d.puremagic.com/issues/show_bug.cgi?id=10661
>>
>> Walter seems OK with adding something like that to the D intrinsics.
>
> Nope, the article is about something different. Quote: "With a bit of care and a
> cooperative compiler, we can zero a buffer — but that's not what we need."

1. The compiler has -gx, which will "stomp" the stack upon function return.

2. A "volatileMemset" should be added to druntime, per 10661

3. A function, say, "clearRegisters" should be added to druntime that zeros out 
all scratch registers.

I know the ycombinator article says that is insufficient, but these are still 
things that people are going to ask for and we should provide.



More information about the Digitalmars-d mailing list