Page MenuHomeFreeBSD

lib/libc/string: add memset_explicit() for compliance with C23
ClosedPublic

Authored by fuz on Oct 25 2024, 5:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 26, 6:16 PM
Unknown Object (File)
Fri, Jan 24, 5:33 PM
Unknown Object (File)
Thu, Jan 16, 6:57 AM
Unknown Object (File)
Thu, Jan 16, 6:54 AM
Unknown Object (File)
Thu, Jan 16, 6:41 AM
Unknown Object (File)
Thu, Jan 16, 4:49 AM
Unknown Object (File)
Tue, Jan 14, 8:15 AM
Unknown Object (File)
Tue, Jan 14, 8:14 AM
Subscribers

Details

Summary

Patterned after explicit_bzero sans the hook.
SSP hardening is provided, too.
The function is documented in memset(3).

Test Plan

passes newly added unit tests

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

fuz requested review of this revision.Oct 25 2024, 5:48 PM
  • lib/libc/string/memset_explicit.c: add weak hook to confuse LTO inlining

As requested by @emaste.

fortify bits look good, thanks

include/string.h
74

I believe

This revision is now accepted and ready to land.Nov 14 2024, 4:30 PM