Re:This shouldn't have happened: A vulnerability postmortem
by muricula on Wednesday December 01, 2021 @06:10PM
(#29410348)
Zeroing out freed memory in no way prevents UAFs. Consider what happens if the memory which was freed was recycled for a new allocation?
Maybe an example will help make it clearer? This is in pseudo-C++.
attacker->foreground_color = SIZE_T_MAX;
// The background_color overlaps with the array's size, so when we change the background color we also change the array's start.
// The attacker chooses the background color. They choose a color value which is 0.
attacker->background_color = 0;
[ Parent
| on HN ]
Re:This shouldn't have happened: A vulnerability postmortem
by astrange on Thursday December 02, 2021 @12:31AM
(#29412865)
> Zeroing out freed memory in no way prevents UAFs.
Maybe they meant it zeroes out all the references on free? This is possible if you have a precise GC, although not sure if it's useful.