zig
zig copied to clipboard
std.c: openbsd adding secure allocator calls, differs from usual call…
…s as memory contents not included in core dumps
cc @mikdusan 🙂
hi @devnexen, thank you for this contribution as well as all your previous ones.
I'm a bit concerned with the pattern of your contributions. They come in many small bits, without any citations for how the information was obtained, and are on the ABI boundary which is extremely important to get right. It's also unclear how much testing you are doing. I need you to find a more auditable, trustworthy way to contribute these OS bits, if that is something you wish to continue doing.
To be more concrete:
- explain the strategy used to obtain the extern bits
- explain how the commits were tested
- provide reasoning why the bits are a needed addition to the zig std lib
I would also like you to do this for all your previous commits in master branch. If you cannot supply this information, I'm afraid I will have to blanket revert all your commits.
fair and valid points, I ll start to look at those within the next days. cheers.
- malloc_conceal/calloc_conceal are to be used exactly like malloc/calloc only in case of a coredump's generation, the contents of the memory are not dumped in.
- Mostly openbsd packages use those like libressl while openssl uses a more portable way to achieve the same goal.
- Tested with the following `const std = @import("std"); const c = std.c;
pub fn main() !void { const sz = 1024; var ptr = c.malloc_conceal(sz); c.freezero(ptr, sz); ptr = c.calloc_conceal(1, sz); c.free(ptr); }`