CVE-2021-47496: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: net/tls: Fix flipped sign in tls_err_abort() calls sk->sk_err appears to expect a positive value, a convention that ktls doesn't always follow and that leads to memory corruption in other code. For instance, [kworker] tls_encrypt_done(..., err=<negative error from crypto request>) tls_err_abort(.., err) sk->sk_err = err; [task] splice_from_pipe_feed ... tls_sw_do_sendpage if (sk->sk_err) { ret = -sk->sk_err; // ret is positive splice_from_pipe_feed (continued) ret = actor(...) // ret is still positive and interpreted as bytes // written, resulting in underflow of buf->len and // sd->len, leading to huge buf->offset and bogus // addresses computed in later calls to actor() Fix all tls_err_abort() callers to pass a negative error code consistently and centralize the error-prone sign flip there, throwing in a warning to catch future misuse and uninlining the function so it really does only warn once.
AI Analysis
Technical Summary
CVE-2021-47496 is a vulnerability identified in the Linux kernel's TLS (Transport Layer Security) implementation, specifically within the kernel TLS (ktls) subsystem. The issue arises from inconsistent handling of error codes' sign conventions in the tls_err_abort() function and its callers. The kernel socket error field (sk->sk_err) expects a positive error value, but ktls sometimes assigns negative error codes directly, leading to memory corruption. The flaw manifests when tls_encrypt_done() returns a negative error from a crypto request, which is passed to tls_err_abort() and assigned directly to sk->sk_err. Subsequent code, such as splice_from_pipe_feed(), interprets sk->sk_err as a positive value, resulting in incorrect calculations of buffer lengths and offsets. This causes underflow conditions and the computation of bogus memory addresses during later operations, potentially leading to memory corruption. The fix involves ensuring all callers of tls_err_abort() pass negative error codes consistently and centralizing the sign flip logic within tls_err_abort(), along with adding a warning to detect future misuse. The function was also uninlined to ensure the warning triggers only once. This vulnerability affects specific Linux kernel versions identified by the commit hash c46234ebb4d1eee5e09819f49169e51cfc6eb909 and was published on May 22, 2024. There are no known exploits in the wild as of the publication date, and no CVSS score has been assigned yet.
Potential Impact
For European organizations, this vulnerability poses a risk primarily to systems running vulnerable Linux kernel versions with kernel TLS enabled. The memory corruption caused by incorrect error handling can lead to system instability, crashes, or potentially exploitable conditions that could be leveraged for privilege escalation or denial of service attacks. Given the widespread use of Linux servers in European enterprises, cloud providers, and critical infrastructure, exploitation could disrupt services, compromise data integrity, or impact availability. Organizations relying on TLS offloading at the kernel level for performance may be particularly exposed. Although no active exploits are known, the vulnerability's nature suggests that attackers with local access or the ability to trigger TLS operations could exploit it. This risk is heightened in environments where untrusted users or processes can interact with the kernel TLS stack. The impact on confidentiality is indirect but possible if memory corruption leads to information disclosure. Integrity and availability impacts are more direct due to potential memory corruption and system crashes.
Mitigation Recommendations
European organizations should prioritize updating their Linux kernels to versions that include the fix for CVE-2021-47496. Since the vulnerability involves kernel TLS, organizations should audit their use of ktls and consider disabling kernel TLS if immediate patching is not feasible, as a temporary mitigation. Monitoring kernel logs for warnings related to tls_err_abort() misuse can help detect attempts to trigger the vulnerability. Security teams should also review access controls to limit unprivileged users' ability to initiate TLS operations at the kernel level. For environments using custom or older kernels, backporting the patch or applying vendor-provided updates is critical. Additionally, organizations should implement robust kernel integrity monitoring and system behavior anomaly detection to identify potential exploitation attempts. Coordinating with Linux distribution maintainers to ensure timely patch deployment is recommended. Finally, maintaining comprehensive backups and incident response plans will help mitigate potential impacts from exploitation.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Italy, Spain, Poland
CVE-2021-47496: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: net/tls: Fix flipped sign in tls_err_abort() calls sk->sk_err appears to expect a positive value, a convention that ktls doesn't always follow and that leads to memory corruption in other code. For instance, [kworker] tls_encrypt_done(..., err=<negative error from crypto request>) tls_err_abort(.., err) sk->sk_err = err; [task] splice_from_pipe_feed ... tls_sw_do_sendpage if (sk->sk_err) { ret = -sk->sk_err; // ret is positive splice_from_pipe_feed (continued) ret = actor(...) // ret is still positive and interpreted as bytes // written, resulting in underflow of buf->len and // sd->len, leading to huge buf->offset and bogus // addresses computed in later calls to actor() Fix all tls_err_abort() callers to pass a negative error code consistently and centralize the error-prone sign flip there, throwing in a warning to catch future misuse and uninlining the function so it really does only warn once.
AI-Powered Analysis
Technical Analysis
CVE-2021-47496 is a vulnerability identified in the Linux kernel's TLS (Transport Layer Security) implementation, specifically within the kernel TLS (ktls) subsystem. The issue arises from inconsistent handling of error codes' sign conventions in the tls_err_abort() function and its callers. The kernel socket error field (sk->sk_err) expects a positive error value, but ktls sometimes assigns negative error codes directly, leading to memory corruption. The flaw manifests when tls_encrypt_done() returns a negative error from a crypto request, which is passed to tls_err_abort() and assigned directly to sk->sk_err. Subsequent code, such as splice_from_pipe_feed(), interprets sk->sk_err as a positive value, resulting in incorrect calculations of buffer lengths and offsets. This causes underflow conditions and the computation of bogus memory addresses during later operations, potentially leading to memory corruption. The fix involves ensuring all callers of tls_err_abort() pass negative error codes consistently and centralizing the sign flip logic within tls_err_abort(), along with adding a warning to detect future misuse. The function was also uninlined to ensure the warning triggers only once. This vulnerability affects specific Linux kernel versions identified by the commit hash c46234ebb4d1eee5e09819f49169e51cfc6eb909 and was published on May 22, 2024. There are no known exploits in the wild as of the publication date, and no CVSS score has been assigned yet.
Potential Impact
For European organizations, this vulnerability poses a risk primarily to systems running vulnerable Linux kernel versions with kernel TLS enabled. The memory corruption caused by incorrect error handling can lead to system instability, crashes, or potentially exploitable conditions that could be leveraged for privilege escalation or denial of service attacks. Given the widespread use of Linux servers in European enterprises, cloud providers, and critical infrastructure, exploitation could disrupt services, compromise data integrity, or impact availability. Organizations relying on TLS offloading at the kernel level for performance may be particularly exposed. Although no active exploits are known, the vulnerability's nature suggests that attackers with local access or the ability to trigger TLS operations could exploit it. This risk is heightened in environments where untrusted users or processes can interact with the kernel TLS stack. The impact on confidentiality is indirect but possible if memory corruption leads to information disclosure. Integrity and availability impacts are more direct due to potential memory corruption and system crashes.
Mitigation Recommendations
European organizations should prioritize updating their Linux kernels to versions that include the fix for CVE-2021-47496. Since the vulnerability involves kernel TLS, organizations should audit their use of ktls and consider disabling kernel TLS if immediate patching is not feasible, as a temporary mitigation. Monitoring kernel logs for warnings related to tls_err_abort() misuse can help detect attempts to trigger the vulnerability. Security teams should also review access controls to limit unprivileged users' ability to initiate TLS operations at the kernel level. For environments using custom or older kernels, backporting the patch or applying vendor-provided updates is critical. Additionally, organizations should implement robust kernel integrity monitoring and system behavior anomaly detection to identify potential exploitation attempts. Coordinating with Linux distribution maintainers to ensure timely patch deployment is recommended. Finally, maintaining comprehensive backups and incident response plans will help mitigate potential impacts from exploitation.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- Linux
- Date Reserved
- 2024-05-22T06:20:56.202Z
- Cisa Enriched
- true
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 682d9833c4522896dcbe92a0
Added to database: 5/21/2025, 9:09:07 AM
Last enriched: 6/30/2025, 1:42:05 PM
Last updated: 8/17/2025, 10:24:29 PM
Views: 15
Related Threats
CVE-2025-9303: Buffer Overflow in TOTOLINK A720R
HighCVE-2025-55371: n/a
HighCVE-2025-52194: n/a
HighCVE-2025-50860: n/a
HighCVE-2025-9302: SQL Injection in PHPGurukul User Management System
MediumActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.