In the Linux kernel, the following vulnerability has been resolved:
mptcp: ensure snd_nxt is properly initialized on connect
Christoph reported a splat hinting at a corrupted snd_una:
WARNING: CPU: 1 PID: 38 at net/mptcp/protocol.c:1005 mptcpcleanuna+0x4b3/0x620 net/mptcp/protocol.c:1005 Modules linked in: CPU: 1 PID: 38 Comm: kworker/1:1 Not tainted 6.9.0-rc1-gbbeac67456c9 #59 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.el7 04/01/2014 Workqueue: events mptcpworker RIP: 0010:mptcpcleanuna+0x4b3/0x620 net/mptcp/protocol.c:1005 Code: be 06 01 00 00 bf 06 01 00 00 e8 a8 12 e7 fe e9 00 fe ff ff e8 8e 1a e7 fe 0f b7 ab 3e 02 00 00 e9 d3 fd ff ff e8 7d 1a e7 fe <0f> 0b 4c 8b bb e0 05 00 00 e9 74 fc ff ff e8 6a 1a e7 fe 0f 0b e9 RSP: 0018:ffffc9000013fd48 EFLAGS: 00010293 RAX: 0000000000000000 RBX: ffff8881029bd280 RCX: ffffffff82382fe4 RDX: ffff8881003cbd00 RSI: ffffffff823833c3 RDI: 0000000000000001 RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: fefefefefefefeff R12: ffff888138ba8000 R13: 0000000000000106 R14: ffff8881029bd908 R15: ffff888126560000 FS: 0000000000000000(0000) GS:ffff88813bd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f604a5dae38 CR3: 0000000101dac002 CR4: 0000000000170ef0 Call Trace: <TASK> _mptcpcleanunawakeup net/mptcp/protocol.c:1055 [inline] mptcpcleanunawakeup net/mptcp/protocol.c:1062 [inline] _mptcpretrans+0x7f/0x7e0 net/mptcp/protocol.c:2615 mptcpworker+0x434/0x740 net/mptcp/protocol.c:2767 processonework+0x1e0/0x560 kernel/workqueue.c:3254 processscheduledworks kernel/workqueue.c:3335 [inline] workerthread+0x3c7/0x640 kernel/workqueue.c:3416 kthread+0x121/0x170 kernel/kthread.c:388 retfromfork+0x44/0x50 arch/x86/kernel/process.c:147 retfromforkasm+0x1a/0x30 arch/x86/entry/entry64.S:243 </TASK>
When fallback to TCP happens early on a client socket, sndnxt is not yet initialized and any incoming ack will copy such value into snduna. If the mptcp worker (dumbly) tries mptcp-level re-injection after such ack, that would unconditionally trigger a send buffer cleanup using 'bad' snd_una values.
We could easily disable re-injection for fallback sockets, but such dumb behavior already helped catching a few subtle issues and a very low to zero impact in practice.
Instead address the issue always initializing sndnxt (and writeseq, for consistency) at connect time.
[
{
"id": "CVE-2024-36889-09ffca79",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "mptcp_connect",
"file": "net/mptcp/protocol.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aa0c07c1f20e05b30019bff083ec43665536f06f",
"digest": {
"length": 1192.0,
"function_hash": "77841484773299560342378887668293471773"
},
"signature_type": "Function"
},
{
"id": "CVE-2024-36889-21542b7e",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "mptcp_connect",
"file": "net/mptcp/protocol.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@592f69b41766d366dbb8ff4ef5a67c4396527bbe",
"digest": {
"length": 1192.0,
"function_hash": "77841484773299560342378887668293471773"
},
"signature_type": "Function"
},
{
"id": "CVE-2024-36889-518f2a75",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/mptcp/protocol.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aa0c07c1f20e05b30019bff083ec43665536f06f",
"digest": {
"line_hashes": [
"174902517335324095823054543361589669758",
"88064349880061677941687516588818938952",
"124996856067438751074317648937339857095",
"138392868226931213849505365618890896903"
],
"threshold": 0.9
},
"signature_type": "Line"
},
{
"id": "CVE-2024-36889-555af78c",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/mptcp/protocol.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@592f69b41766d366dbb8ff4ef5a67c4396527bbe",
"digest": {
"line_hashes": [
"174902517335324095823054543361589669758",
"88064349880061677941687516588818938952",
"124996856067438751074317648937339857095",
"138392868226931213849505365618890896903"
],
"threshold": 0.9
},
"signature_type": "Line"
},
{
"id": "CVE-2024-36889-ad44beca",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "net/mptcp/protocol.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@99951b62bf20cec9247f633a3bea898338b9e5b4",
"digest": {
"line_hashes": [
"337960439436030062166967997677131855732",
"331120937942222304345863151711655758994",
"180250595057691033520147141150904763851"
],
"threshold": 0.9
},
"signature_type": "Line"
},
{
"id": "CVE-2024-36889-df09ffaf",
"deprecated": false,
"signature_version": "v1",
"target": {
"function": "mptcp_stream_connect",
"file": "net/mptcp/protocol.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@99951b62bf20cec9247f633a3bea898338b9e5b4",
"digest": {
"length": 940.0,
"function_hash": "104464554996616183743751737238806657376"
},
"signature_type": "Function"
}
]