lib/crypto: chacha: Zeroize permuted_state before it leaves scope
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c08d0e647305c3f8f640010a56c9e4bafb9488d3 · < 1933249263c3a98df79992f61a566476e4163bcc| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
lib/crypto: chacha: Zeroize permuted_state before it leaves scope
Since the ChaCha permutation is invertible, the local variable 'permuted_state' is sufficient to compute the original 'state', and thus the key, even after the permutation has been done.
While the kernel is quite inconsistent about zeroizing secrets on the stack (and some prominent userspace crypto libraries don't bother at all since it's not guaranteed to work anyway), the kernel does try to do it as a best practice, especially in cases involving the RNG.
Thus, explicitly zeroize 'permuted_state' before it goes out of scope.
From the CVE record · Linux
The Linux kernel’s ChaCha code leaves a local permutation state on the stack instead of zeroizing it. That state can be used to recover the original state and key if exposed; the input does not specify attacker access or user-interaction requirements.
Engineers running Linux kernels that may lack the ChaCha zeroization fix should check their kernel builds; affected versions are not specified.