openssl / openssl/openssl

crypto/modes/asm/aesni-gcm-x86_64.pl uses %rax as frame pointer, not %rbp

Open
#31,504 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

branch: master triaged: refactor
Dominant language
C
Stars
30.8k
Forks
11.5k
Avg merge
10m
Merged PRs (30d)
1

Description

The functions aesni_gcm_decrypt and aesni_gcm_encrypt use %rax pretty much as frame pointer. They store a rounds count in %rbp. This corrupts the frame pointer chain, impacting frame-pointer-based profiling tools.

It is possible to reverse the roles of %rax and %rbp and switch a standard frame layout in those functions. I don't know what Red Hat's CLA status is, so I'm not going to send a patch here.

I think it's possible to adapt the Windows structured exception handler to this, however it's purpose is unclear, see #31503.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with crypto/modes/asm/aesni-gcm-x86_64.pl and inspect aesni_gcm_decrypt and aesni_gcm_encrypt, focusing on their frame layout and register roles. Check how the Windows structured exception handler relates to these functions; done means the functions use a standard frame layout without corrupting the frame-pointer chain while preserving the existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
cryptography
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.