diff options
| author | Mohamad Raizudeen <raizudeen.kerneldev@gmail.com> | 2026-10-05 20:33:24 +0530 |
|---|---|---|
| committer | Eric Biggers <ebiggers@kernel.org> | 2026-10-05 17:13:25 +0200 |
| commit | 6a50ce0af5c91fd665d65d357af8ae55db1df7d0 (patch) | |
| tree | 6cb448ce1625da5e5e186f0dde790ce635d22e29 /tools/perf/scripts/python/flamegraph.py | |
| parent | 290fa0470d6d6c95bf4b22daba2cf37b05a88227 (diff) | |
| download | linux-6a50ce0af5c91fd665d65d357af8ae55db1df7d0.tar.gz linux-6a50ce0af5c91fd665d65d357af8ae55db1df7d0.zip | |
lib/crypto: chacha20poly1305: zeroize state in __chacha20poly1305_decrypt
The `__chacha20poly1305_decrypt` function does not zeroize the chacha
state, unlike its encrypt counterpart. The regular
`chacha20poly1305_decrypt` function handles this by manually calling
chacha_zeroize_state(). However, `xchacha20poly1305_decrypt` returns
the result directly without clearing the state, leaving the derived
chacha20 subkey on the stack.
Because this function is EXPORT_SYMBOL()ed, this is an ABI robustness
improvement. To ensure consistent and safe cleanup for any future
callers, move the chacha_zeroize_state() call into
`__chacha20poly1305_decrypt()` itself, so the helper cleans up after its
own state just like `__chacha20poly1305_encrypt()` does.
Additionally, moved the src_len check to the callers so the state is not
initialized on invalid inputs, matching the logic in
chacha20poly1305_crypt_sg_inplace().
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
Link: https://patch.msgid.link/20261005150324.5621-1-raizudeen.kerneldev@gmail.com
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions
