Page MenuHomeFreeBSD

lib/libc/aarch64/string: add timingsafe_memcmp() assembly implementation
Needs ReviewPublic

Authored by fuz on Mon, Sep 23, 9:57 AM.
Tags
None
Referenced Files
F97324141: D46758.diff
Sat, Sep 28, 4:22 PM
F97318650: D46758.diff
Sat, Sep 28, 3:33 PM
Unknown Object (File)
Wed, Sep 25, 7:55 PM
Unknown Object (File)
Wed, Sep 25, 5:42 AM

Details

Reviewers
cperciva
andrew
Group Reviewers
security
Summary

A port of the amd64 implementation (see D41696) with some slight changes due to
differences in instructions provided by aarch64.

No ASIMD for the same reason as the amd64 code: it's just not particularly
suitable for this application.

Event: EuroBSDcon 2024

Please review to ensure that this function fulfills the required constant time
properties. @andrew and @cpercival have agreed to do a joint review of the code
during EuroBSDcon 2024.

We have considered adding a wrapper that would set the DIT (data-independent
timing) bit before the code and reset it to its prior state after, but after
discussion with @imp and others have decided to leave this setting to a future
portable function (i.e. the caller is responsible for enabling DIT mode if
desired).

For benchmarks see D46757.

Test Plan

passes our test suite; test suite does not test constant time
properties.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 59565
Build 56452: arc lint + arc unit