CVE-2024-35841: net: tls, fix WARNIING in __sk_msg_free
In the Linux kernel, the following vulnerability has been resolved:
net: tls, fix WARNIING in skmsgfree
A splice with MSGSPLICEPAGES will cause tls code to use the tlsswsendmsgsplice path in the TLS sendmsg code to move the user provided pages from the msg into the msgpl. This will loop over the msg until msgpl is full, checked by skmsgfull(msgpl). The user can also set the MORE flag to hint stack to delay sending until receiving more pages and ideally a full buffer.
If the user adds more pages to the msg than can fit in the msgpl scatterlist (MAXMSGFRAGS) we should ignore the MORE flag and send the buffer anyways.
What actually happens though is we abort the msg to msgpl scatterlist setup and then because we forget to set 'full record' indicating we can no longer consume data without a send we fallthrough to the 'continue' path which will check if msgdataleft(msg) has more bytes to send and then attempts to fit them in the already full msgpl. Then next iteration of sender doing send will encounter a full msgpl and throw the warning in the syzbot report.
To fix simply check if we have a fullrecord in splice code path and if not send the msg regardless of MORE flag.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.7.7-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.115-2Fixed in 7.2.12-1Fixed in 7.2.15-1
Event History
Frequently Asked Questions
What is the severity of CVE-2024-35841?
CVE-2024-35841 is classified as a moderate severity vulnerability in the Linux kernel.
How do I fix CVE-2024-35841?
To mitigate CVE-2024-35841, upgrade to the patched versions of the Linux kernel: 5.10.223-1, 5.10.226-1, 6.1.123-1, 6.1.119-1, 6.12.11-1, or 6.12.12-1.
What systems are affected by CVE-2024-35841?
CVE-2024-35841 affects specific versions of the Linux kernel in Debian-based distributions.
Is CVE-2024-35841 exploited in the wild?
There are currently no reported cases of exploitation for CVE-2024-35841 in the wild.
What components are impacted by CVE-2024-35841?
CVE-2024-35841 impacts the transport layer security (TLS) implementation within the Linux kernel.