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)
Thu, Oct 23, 10:24 PM
Unknown Object (File)
Thu, Oct 23, 3:25 AM
Unknown Object (File)
Fri, Oct 10, 10:54 AM
Unknown Object (File)
Fri, Oct 3, 12:43 AM
Unknown Object (File)
Tue, Sep 30, 9:29 AM
Unknown Object (File)
Sep 17 2025, 2:31 PM
Unknown Object (File)
Sep 15 2025, 11:19 AM
Unknown Object (File)
Sep 13 2025, 5:27 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