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
F106153585: D47286.id.diff
Thu, Dec 26, 6:52 AM
Unknown Object (File)
Wed, Dec 11, 8:00 PM
Unknown Object (File)
Nov 22 2024, 8:53 AM
Unknown Object (File)
Nov 22 2024, 5:40 AM
Unknown Object (File)
Nov 17 2024, 7:39 AM
Unknown Object (File)
Nov 17 2024, 5:42 AM
Unknown Object (File)
Nov 16 2024, 5:17 AM
Unknown Object (File)
Nov 15 2024, 3:06 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