{"id":"CVE-2025-21789","state":"PUBLISHED","title":"LoongArch: csum: Fix OoB access in IP checksum code for negative lengths","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nLoongArch: csum: Fix OoB access in IP checksum code for negative lengths\n\nCommit 69e3a6aa6be2 (\"LoongArch: Add checksum optimization for 64-bit\nsystem\") would cause an undefined shift and an out-of-bounds read.\n\nCommit 8bd795fedb84 (\"arm64: csum: Fix OoB access in IP checksum code\nfor negative lengths\") fixes the same issue on ARM64.","publishedAt":"2025-02-27T02:18:27.817Z","updatedAt":"2026-08-05T11:54:27.092Z","severity":{"score":7.3,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"69e3a6aa6be21de6aaf38130fad97ecde34a193c","status":"affected","lessThan":"964a8895704a22efc06a2a3276b624a5ae985a06","versionType":"git"},{"version":"69e3a6aa6be21de6aaf38130fad97ecde34a193c","status":"affected","lessThan":"9f15a8df542c0f08732a67d1a14ee7c22948fb97","versionType":"git"},{"version":"69e3a6aa6be21de6aaf38130fad97ecde34a193c","status":"affected","lessThan":"d6508ffff32b44b6d0de06704034e4eef1c307a7","versionType":"git"},{"version":"69e3a6aa6be21de6aaf38130fad97ecde34a193c","status":"affected","lessThan":"6287f1a8c16138c2ec750953e35039634018c84a","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/loongarch/lib/csum.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.4","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.4","versionType":"semver"},{"version":"6.6.79","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.16","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.4","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/loongarch/lib/csum.c"]}],"references":["https://git.kernel.org/stable/c/964a8895704a22efc06a2a3276b624a5ae985a06","https://git.kernel.org/stable/c/9f15a8df542c0f08732a67d1a14ee7c22948fb97","https://git.kernel.org/stable/c/d6508ffff32b44b6d0de06704034e4eef1c307a7","https://git.kernel.org/stable/c/6287f1a8c16138c2ec750953e35039634018c84a"],"weaknesses":["CWE-125"],"ingestedAt":"2026-10-29T20:08:39.238Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/21xxx/CVE-2025-21789.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-21789","state":"PUBLISHED","datePublished":"2025-02-27T02:18:27.817Z","dateUpdated":"2026-08-05T11:54:27.092Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-12-29T08:45:45.766Z"},"containers":{"cna":{"title":"LoongArch: csum: Fix OoB access in IP checksum code for negative lengths","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nLoongArch: csum: Fix OoB access in IP checksum code for negative lengths\n\nCommit 69e3a6aa6be2 (\"LoongArch: Add checksum optimization for 64-bit\nsystem\") would cause an undefined shift and an out-of-bounds read.\n\nCommit 8bd795fedb84 (\"arm64: csum: Fix OoB access in IP checksum code\nfor negative lengths\") fixes the same issue on ARM64."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"69e3a6aa6be21de6aaf38130fad97ecde34a193c","status":"affected","lessThan":"964a8895704a22efc06a2a3276b624a5ae985a06","versionType":"git"},{"version":"69e3a6aa6be21de6aaf38130fad97ecde34a193c","status":"affected","lessThan":"9f15a8df542c0f08732a67d1a14ee7c22948fb97","versionType":"git"},{"version":"69e3a6aa6be21de6aaf38130fad97ecde34a193c","status":"affected","lessThan":"d6508ffff32b44b6d0de06704034e4eef1c307a7","versionType":"git"},{"version":"69e3a6aa6be21de6aaf38130fad97ecde34a193c","status":"affected","lessThan":"6287f1a8c16138c2ec750953e35039634018c84a","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/loongarch/lib/csum.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.4","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.4","versionType":"semver"},{"version":"6.6.79","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.16","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13.4","status":"unaffected","lessThanOrEqual":"6.13.*","versionType":"semver"},{"version":"6.14","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/loongarch/lib/csum.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/964a8895704a22efc06a2a3276b624a5ae985a06"},{"url":"https://git.kernel.org/stable/c/9f15a8df542c0f08732a67d1a14ee7c22948fb97"},{"url":"https://git.kernel.org/stable/c/d6508ffff32b44b6d0de06704034e4eef1c307a7"},{"url":"https://git.kernel.org/stable/c/6287f1a8c16138c2ec750953e35039634018c84a"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H","baseScore":7.3,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The negative length originates from skb metadata (csum_start vs. transport header offset) that the attacker sets locally via an AF_PACKET/tun socket with virtio_net_hdr, not from remote packet header fields — every RX path that derives lengths from peer-supplied headers validates them first (e.g. `tcf_csum_skb_nextlayer()`'s `ipl < hl` check). Exploitation therefore requires local socket API access.\nAC:L - The attacker deterministically chooses csum_start, csum_offset and gso_size in the virtio_net_hdr and immediately drives the packet through the GSO segmentation path; there is no race, no memory-layout dependency, and no state outside the attacker's control.\nPR:L - An unprivileged local user can obtain CAP_NET_RAW in a new user+network namespace (`unshare -Urn`) and open the AF_PACKET socket needed to inject the crafted virtio_net_hdr; no real root and no init-namespace capability is required.\nUI:N - The entire sequence is a single sendmsg() by the attacker's own process; no victim action, mount, or file open is involved.\nS:U - The out-of-bounds read stays within the kernel's own address space and security authority — there is no VM, IOMMU, or sandbox boundary crossed.\nC:H - This is a slab-out-of-bounds read (KASAN reports it as an unbounded ~4 GB read) whose out-of-bounds bytes are folded into the checksum that is then written into the outgoing packet header and transmitted, giving the attacker an observable channel onto adjacent kernel heap contents.\nI:L - The undefined shift makes the tail-masking meaningless, so a corrupted checksum is computed from out-of-bounds data and stored into the transmitted packet's checksum field; this modifies network data but yields no kernel memory write primitive.\nA:H - On KASAN/UBSAN-instrumented kernels the negative length produces a slab-out-of-bounds report and an undefined-shift splat that panics under the widely deployed panic_on_warn setting, and the huge shadow-memory scan from `kasan_check_read()` with a ~4 GB size makes an oops the expected outcome."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:54:27.092Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"6.6.79"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"6.12.16"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"6.13.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"6.14"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.1,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","integrityImpact":"NONE","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2025-21789","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2025-10-01T19:29:57.287707Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-125","lang":"en","type":"CWE","description":"CWE-125 Out-of-bounds Read"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-10-01T19:36:39.729Z"}}]}}}