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)
Mon, Jul 28, 2:23 PM
Unknown Object (File)
Mon, Jul 28, 12:56 PM
Unknown Object (File)
Mon, Jul 28, 10:27 AM
Unknown Object (File)
Mon, Jul 28, 7:02 AM
Unknown Object (File)
Mon, Jul 28, 5:57 AM
Unknown Object (File)
Sat, Jul 19, 5:52 AM
Unknown Object (File)
Sun, Jul 13, 11:19 PM
Unknown Object (File)
Thu, Jul 10, 5:15 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