diff options
| author | Eric Biggers <ebiggers@kernel.org> | 2026-10-11 15:48:41 +0200 |
|---|---|---|
| committer | Eric Biggers <ebiggers@kernel.org> | 2026-10-13 15:41:38 +0200 |
| commit | 0b173877fbc07f4922f0c6a6fc43fd99088befd2 (patch) | |
| tree | 2400f3eb004cf046a70e451359215d8d24478e87 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 6a50ce0af5c91fd665d65d357af8ae55db1df7d0 (diff) | |
| download | linux-0b173877fbc07f4922f0c6a6fc43fd99088befd2.tar.gz linux-0b173877fbc07f4922f0c6a6fc43fd99088befd2.zip | |
lib/crypto: x86/sha1: Follow the normal %rbp convention
Some of the SHA-1 assembly functions push callee-save GPRs to the stack
*before* they set up the frame pointer (%rbp). (They are leaf
functions, but they need to set up a frame pointer anyway because they
allocate a 16- or 32-byte-aligned buffer on the stack.)
As a result, during these functions, 8(%rbp) doesn't contain a return
address like it is supposed to.
This differs from the convention used by C code, and it interferes with
the frame pointer unwinder (CONFIG_UNWINDER_FRAME_POINTER=y).
Specifically, if a call trace is dumped in these functions, then all
entries are populated purely from the fallback scan of the entire stack:
RIP: 0010:sha1_transform_avx2+0x1921/0x1ea0
[...]
Call Trace:
<TASK>
? sha1_transform_avx+0x2a9/0xc90
? sha1_blocks_avx2+0x78/0x140
? kernel_fpu_end+0x2d/0x40
? sha1_blocks_avx2+0x52/0x140
? sha1_update+0x77/0x220
[...]
? do_syscall_64+0x6f/0x3e0
With this fix to follow the normal %rbp convention, the call trace is
generated reliably:
RIP: 0010:sha1_transform_avx2+0x66e/0x1ea0
[...]
Call Trace:
<TASK>
sha1_blocks_avx2+0x78/0x140
sha1_update+0x77/0x220
[...]
do_syscall_64+0x6f/0x3e0
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://patch.msgid.link/20261011134843.166585-2-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
