This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug malloc/24775] Please add a secure way to clear and free memory


https://sourceware.org/bugzilla/show_bug.cgi?id=24775

--- Comment #2 from Topi Miettinen <toiwoton at gmail dot com> ---
(In reply to Florian Weimer from comment #1)
> We already explicit_bzero followed by free.  Why is this not enough?

The background is this PR for systemd: 
https://github.com/systemd/systemd/pull/12959

We're using gcc cleanup extension a lot but and it would be nice to use that
for clearing memory before free()ing. It's of course possible to use
explicit_bzero and free, but combining them to one function would be nicer.
Besides systemd, I suppose other programs could use the function if it was
provided by glibc.

> 
> cfree is already taken, it was used by some old libcs as an alias for free.

How about clear_and_free() or erase_and_free() then?

-Topi

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]