Page MenuHomeFreeBSD

arm64: Fix SVE context alignment in signal frame
AbandonedPublic

Authored by wac_gmail.com on Sun, Jan 25, 9:16 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 30, 9:00 PM
Unknown Object (File)
Mon, Jan 26, 8:21 PM
Unknown Object (File)
Mon, Jan 26, 2:15 AM
Unknown Object (File)
Sun, Jan 25, 8:49 PM
Unknown Object (File)
Sun, Jan 25, 6:51 PM
Unknown Object (File)
Sun, Jan 25, 5:53 PM
Unknown Object (File)
Sun, Jan 25, 2:24 PM
Subscribers

Details

Reviewers
andrew
manu
Summary

Round up the SVE buffer size to 16 bytes. The SVE context size calculation could result in a value not divisible by 16 (or even 4), causing misalignment of subsequent context records in the signal frame. This violated the ABI and caused sigreturn(2) to fail with EINVAL when validating the alignment of the next context header.

16-byte alignment is chosen to satisfy the AArch64 stack alignment constraint.

PR: 292177

Test Plan

Run triggering openssl test from 292177 (openssl speed -evp chacha20-poly1305) and observe it no longer crashes after this change.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

At first glance https://reviews.freebsd.org/rGa9e77eb7016df70723c208fc09fbd01ec23a732d will fix this issue. I'll apply it to my copy of the tree and make sure it fixes the openssl crash since that's a nice repeatable crash case for the alignment issue. I should be able to get that done in the next day or two.

I've confirmed that rGa9e77eb7016df70723c208fc09fbd01ec23a732d resolves the issue in PR 292177, so abandoning this change.