{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2025-38463",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2025-04-16T04:51:24.020Z",
        "datePublished": "2025-07-25T15:27:45.975Z",
        "dateUpdated": "2026-08-05T12:02:05.755Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T12:02:05.755Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ntcp: Correct signedness in skb remaining space calculation\n\nSyzkaller reported a bug [1] where sk->sk_forward_alloc can overflow.\n\nWhen we send data, if an skb exists at the tail of the write queue, the\nkernel will attempt to append the new data to that skb. However, the code\nthat checks for available space in the skb is flawed:\n'''\ncopy = size_goal - skb->len\n'''\n\nThe types of the variables involved are:\n'''\ncopy: ssize_t (s64 on 64-bit systems)\nsize_goal: int\nskb->len: unsigned int\n'''\n\nDue to C's type promotion rules, the signed size_goal is converted to an\nunsigned int to match skb->len before the subtraction. The result is an\nunsigned int.\n\nWhen this unsigned int result is then assigned to the s64 copy variable,\nit is zero-extended, preserving its non-negative value. Consequently, copy\nis always >= 0.\n\nAssume we are sending 2GB of data and size_goal has been adjusted to a\nvalue smaller than skb->len. The subtraction will result in copy holding a\nvery large positive integer. In the subsequent logic, this large value is\nused to update sk->sk_forward_alloc, which can easily cause it to overflow.\n\nThe syzkaller reproducer uses TCP_REPAIR to reliably create this\ncondition. However, this can also occur in real-world scenarios. The\ntcp_bound_to_half_wnd() function can also reduce size_goal to a small\nvalue. This would cause the subsequent tcp_wmem_schedule() to set\nsk->sk_forward_alloc to a value close to INT_MAX. Further memory\nallocation requests would then cause sk_forward_alloc to wrap around and\nbecome negative.\n\n[1]: https://syzkaller.appspot.com/bug?extid=de6565462ab540f50e47"
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                        "baseScore": 7.8,
                        "baseSeverity": "HIGH"
                    },
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "AV:L - Triggering requires the attacker to issue `sendmsg()`/`sendfile()` on a local TCP socket (with MSG_OOB, MSG_ZEROCOPY, MSG_SPLICE_PAGES, or TCP_REPAIR), so the entry point is a local syscall; a remote peer can only influence `size_goal` via MSS/PMTU/window, it cannot drive the send path on its own.\nAC:L - The attacker fully controls both sides of the condition — it queues a large tail skb via TCP_CORK/MSG_MORE and then shrinks `size_goal` deterministically with MSG_OOB (`tcp_xmit_size_goal(..., large_allowed=0)`) or TCP_REPAIR, exactly as the syzkaller reproducer does; no race or uncontrollable state is involved.\nPR:L - An ordinary unprivileged user can open a TCP socket, set SO_ZEROCOPY and TCP_CORK, and send with MSG_OOB/MSG_ZEROCOPY with no capabilities; the TCP_REPAIR variant only needs CAP_NET_ADMIN in a user namespace, obtainable via `unshare -Urn`.\nUI:N - The attacking process performs every step itself through ordinary socket syscalls; no victim action, mount, or file open is required.\nS:U - The overflow corrupts socket memory accounting and kernel heap within the same kernel security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - Once `sk_forward_alloc` wraps negative, `tcp_wmem_schedule()` returns a negative `copy` that corrupts skb frag lengths via `skb_frag_size_add()`/`skb_fill_page_desc()`, causing adjacent kernel heap memory to be included in transmitted packets, and the resulting heap corruption is leverageable for broader kernel memory disclosure.\nI:H - The negative `copy` is converted to a huge `size_t` in `skb_do_copy_data_nocache()` → `copy_from_iter_full()`, writing attacker-controlled data far past the `page_frag` allocation — an out-of-bounds heap write suitable for control-flow hijacking.\nA:H - The `sk_forward_alloc` overflow trips `WARN_ON_ONCE()` in `inet_sock_destruct()` (kernel panic with panic_on_warn) and permanently inflates the global `tcp_memory_allocated` counter, forcing the entire host into TCP memory pressure so all TCP sockets fail to allocate — a repeatable system-wide denial of service."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "net/ipv4/tcp.c"
                    ],
                    "versions": [
                        {
                            "version": "270a1c3de47e49dd2fc18f48e46b101e48050e78",
                            "lessThan": "81373cd1d72d87c7d844d4454a526b8f53e72d00",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "270a1c3de47e49dd2fc18f48e46b101e48050e78",
                            "lessThan": "62e6160cfb5514787bda833d466509edc38fde23",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "270a1c3de47e49dd2fc18f48e46b101e48050e78",
                            "lessThan": "9f164fa6bb09fbcc60fa5c3ff551ce9eec1befd7",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "270a1c3de47e49dd2fc18f48e46b101e48050e78",
                            "lessThan": "d3a5f2871adc0c61c61869f37f3e697d97f03d8c",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "net/ipv4/tcp.c"
                    ],
                    "versions": [
                        {
                            "version": "6.5",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "6.5",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.6.99",
                            "lessThanOrEqual": "6.6.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.12.39",
                            "lessThanOrEqual": "6.12.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.15.7",
                            "lessThanOrEqual": "6.15.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.16",
                            "lessThanOrEqual": "*",
                            "status": "unaffected",
                            "versionType": "original_commit_for_fix"
                        }
                    ]
                }
            ],
            "cpeApplicability": [
                {
                    "nodes": [
                        {
                            "operator": "OR",
                            "negate": false,
                            "cpeMatch": [
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.5",
                                    "versionEndExcluding": "6.6.99"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.5",
                                    "versionEndExcluding": "6.12.39"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.5",
                                    "versionEndExcluding": "6.15.7"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.5",
                                    "versionEndExcluding": "6.16"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/81373cd1d72d87c7d844d4454a526b8f53e72d00"
                },
                {
                    "url": "https://git.kernel.org/stable/c/62e6160cfb5514787bda833d466509edc38fde23"
                },
                {
                    "url": "https://git.kernel.org/stable/c/9f164fa6bb09fbcc60fa5c3ff551ce9eec1befd7"
                },
                {
                    "url": "https://git.kernel.org/stable/c/d3a5f2871adc0c61c61869f37f3e697d97f03d8c"
                }
            ],
            "title": "tcp: Correct signedness in skb remaining space calculation",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        }
    }
}