CVE-2021-47496: net/tls: Fix flipped sign in tls_err_abort() calls
In the Linux kernel, the following vulnerability has been resolved:
net/tls: Fix flipped sign in tlserrabort() calls
sk->skerr 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] tlsencryptdone(..., err=<negative error from crypto request>) tlserrabort(.., err) sk->skerr = err;
[task] splicefrompipefeed ... tlsswdosendpage if (sk->skerr) { ret = -sk->skerr; // ret is positive
splicefrompipefeed (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 tlserrabort() 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Fix all tls_err_abort() callers to pass a negative error code; ensure the ret value is negative (e.g., avoid cases where ret becomes positive and is interpreted as bytes), so tls_err_abort(.., err) receives <negative error> from crypto requests.
Linux kernel net/tls tls_err_abort() error-code sign handling = Pass a negative error code (fix flipped sign in tls_err_abort() calls)
Event History
Frequently Asked Questions
What is the severity of CVE-2021-47496?
CVE-2021-47496 has been assigned a medium severity rating due to potential memory corruption risks.
How do I fix CVE-2021-47496?
To fix CVE-2021-47496, users should update their Linux kernel to the latest patched version provided by their distribution.
What are the potential impacts of CVE-2021-47496?
The potential impact of CVE-2021-47496 includes memory corruption, which could lead to system crashes or unauthorized data access.
Which versions of the Linux kernel are affected by CVE-2021-47496?
CVE-2021-47496 may affect multiple versions of the Linux kernel, especially those prior to the recent patches that address this issue.
Is CVE-2021-47496 being actively exploited in the wild?
As of now, there is no evidence to suggest that CVE-2021-47496 is being actively exploited in the wild, but users should take precautions.