CVE-2024-42229: Critical Linux Kernel Vulnerability Resolved - Crypto: AEAD, Cipher Zeroize Key Buffer After Use

Security researchers have discovered a critical vulnerability in the Linux kernel that could lead to potential security breaches and data leakage. The vulnerability, labeled as CVE-2024-42229, involves the improper handling of cryptographic information in memory buffers. This vulnerability affects the Linux kernel's implementation of Authenticated Encryption with Associated Data (AEAD) and cipher algorithms.

The issue has been addressed as per the International Cryptographic Module Conference (I.G.) 9.7.B recommendation for FIPS 140-3, which states that variables holding sensitive cryptographic data must be securely erased or "zeroized" after their usage. By implementing this security measure through the kfree_sensitive function, the risk of sensitive data leakage is effectively mitigated.

Code Snippet

The following code snippet demonstrates the changes made to resolve CVE-2024-42229, using the kfree_sensitive function to securely erase memory buffers holding private keys:

void crypto_free_aead(struct crypto_aead *tfm)
{
    unsigned int size;
    if (!tfm)
        return;
    size = crypto_aead_reqsize(tfm);
    memset(tfm, , sizeof(*tfm) + size);
    kfree_sensitive(tfm);
}
...
void crypto_free_cipher(struct crypto_cipher *tfm)
{
    unsigned int size;
    if (!tfm)
        return;
    size = crypto_cipher_reqsize(tfm);
    memset(tfm, , sizeof(*tfm) + size);
    kfree_sensitive(tfm);
}

These changes ensure that the private key data stored in the crypto_aead and crypto_cipher structures are securely erased before deallocating the memory.

Original References

The original patches and discussions about this vulnerability and its resolution can be found on the Linux kernel's public mailing list, where developers have been actively working on addressing various security issues:

- Patch v1: kfree_sensitive and zeroizing memory that held sensitive data
- Patch v2: crypto: Introduce kfree_sensitive and zeroize memory that held sensitive data

Exploit Details

Although there has been no known public exploitation of CVE-2024-42229 to date, potential attackers could potentially use this vulnerability to access sensitive information, such as secret keys and passwords, stored in memory. This can potentially lead to unauthorized access to encrypted data and other security breaches.

By leaving sensitive data in memory, even after it is no longer needed, malicious actors with access to the system could potentially read this data and use it to compromise the encrypted communication or other security measures in place.

Conclusion

CVE-2024-42229 serves as a critical reminder of the importance of securely managing sensitive data in memory. Adhering to security best practices, such as properly handling cryptographic data and zeroizing sensitive data after use, is essential in maintaining a secure environment and preventing potential data leakage. Linux kernel developers have successfully addressed this vulnerability, and users are advised to update their kernel to the latest version to ensure they are protected from potential exploitation.

Timeline

Published on: 07/30/2024 08:15:08 UTC
Last modified on: 07/30/2024 19:46:56 UTC