CVE-2023-53669: tcp: fix skb_copy_ubufs() vs BIG TCP
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
tcp: fix skb_copy_ubufs() vs BIG TCP
David Ahern reported crashes in skb_copy_ubufs() caused by TCP tx zerocopy using hugepages, and skb length bigger than ~68 KB.
skb_copy_ubufs() assumed it could copy all payload using up to MAX_SKB_FRAGS order-0 pages.
This assumption broke when BIG TCP was able to put up to 512 KB per skb.
We did not hit this bug at Google because we use CONFIG_MAX_SKB_FRAGS=45 and limit gso_max_size to 180000.
A solution is to use higher order pages if needed.
v2: add missing __GFP_COMP, or we leak memory.
The Linux kernel CVE team has assigned CVE-2023-53669 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.19 with commit 7c4e983c4f3cf94fcd879730c6caa877e0768a4d and fixed in 6.1.29 with commit 7fa93e39fbb0566019c388a8038a4d58552e0910 Issue introduced in 5.19 with commit 7c4e983c4f3cf94fcd879730c6caa877e0768a4d and fixed in 6.2.16 with commit 3c77a377877acbaf03cd7caa21d3644a5dd16301 Issue introduced in 5.19 with commit 7c4e983c4f3cf94fcd879730c6caa877e0768a4d and fixed in 6.3.3 with commit 9cd62f0ba465cf647c7d8c2ca7b0d99ea0c1328f Issue introduced in 5.19 with commit 7c4e983c4f3cf94fcd879730c6caa877e0768a4d and fixed in 6.4 with commit 7e692df3933628d974acb9f5b334d2b3e885e2a6
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2023-53669
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
net/core/skbuff.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/7fa93e39fbb0566019c388a8038a4d58552e0910 https://git.kernel.org/stable/c/3c77a377877acbaf03cd7caa21d3644a5dd16301 https://git.kernel.org/stable/c/9cd62f0ba465cf647c7d8c2ca7b0d99ea0c1328f https://git.kernel.org/stable/c/7e692df3933628d974acb9f5b334d2b3e885e2a6