Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rec: Add endbr64 instructions in the right spots for OpenBSD/amd64 #13430

Merged
merged 1 commit into from Oct 30, 2023

Conversation

omoerbeek
Copy link
Member

OpenBSD has IBT (aka control flow enforcement) on amd64, for processor models that support it. But it turns out that the existing endbr64 instructions in the boost assembly for context switching are not enough: there needs to be endbr64 instructions right after the jump_fcontext() call, as indirect branches end up there.

Short description

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

OpenBSD has IBT (aka control flow enforcement) on amd64, for processor
models that support it. But it turns out that the existing endbr64
instructions in the boost assembly for context switching are not
enough: there needs to be endbr64 instructions right after the
jump_fcontext() call, as indirect branches end up there.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 6690951893

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • 18 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.3%) to 57.697%

Files with Coverage Reduction New Missed Lines %
modules/lmdbbackend/lmdbbackend.cc 2 72.32%
pdns/misc.cc 2 62.8%
pdns/tcpiohandler.cc 2 66.65%
pdns/recursordist/test-syncres_cc1.cc 12 88.87%
Totals Coverage Status
Change from base Build 6690810486: 0.3%
Covered Lines: 105820
Relevant Lines: 152764

💛 - Coveralls

Copy link
Member

@rgacogne rgacogne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the caveat that I don't the right hardware to test this, the changes look OK to me. Nice work!

pdns/recursordist/mtasker_fcontext.cc Show resolved Hide resolved
@omoerbeek omoerbeek merged commit b224d46 into PowerDNS:master Oct 30, 2023
74 checks passed
@omoerbeek omoerbeek deleted the rec-mtasker-cet branch October 30, 2023 12:25
omoerbeek added a commit to omoerbeek/pdns that referenced this pull request Oct 30, 2023
omoerbeek added a commit that referenced this pull request Oct 30, 2023
rec: Followup to #13430: also define CET_ENDBR on !amd64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants