{"answers":{"affected":"It affects 1 product.","exploited":"There is no known exploitation of CVE-2025-22058 in the wild and no public exploit code.","fix":"Apply the vendor's patch.","what":"CVE-2025-22058 is a medium-severity vulnerability in Linux kernel, published on 16 Apr 2025. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2025-22058 and fix it if it is affected.\n\nWhat it is: CVE-2025-22058 is a medium-severity vulnerability in Linux kernel, published on 16 Apr 2025. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2025-22058 in the wild and no public exploit code.\n\nAffected product: Linux kernel. No package-level version data is available, so check the vendor advisory linked from the reference page.\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2025-22058/ (Markdown: https://insights.sbomify.com/CVE-2025-22058/index.md)","id":"CVE-2025-22058","markdown":"https://insights.sbomify.com/CVE-2025-22058/index.md","name":"CVE-2025-22058","record":{"aliases":["ALSA-2025:14439","AZL-69542","BELL-CVE-2025-22058","DEBIAN-CVE-2025-22058","GHSA-qh2m-xfgm-crh8","RHSA-2025:14439","ROOT-OS-DEBIAN-11-CVE-2025-22058","ROOT-OS-UBUNTU-2204-CVE-2025-22058","ROOT-OS-UBUNTU-2404-CVE-2025-22058","UBUNTU-CVE-2025-22058"],"analysis":{"component_type":"kernel","fix_type":"patch","impacts":["denial_of_service"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Linux kernel UDP","requires_auth":"low_privilege","summary":"An integer overflow in Linux kernel UDP memory accounting causes memory leaks and packet drops, leading to denial of service.","user_interaction":"not_required","vuln_class":"integer_overflow"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"Linux","cpe":[{"product":"linux_kernel","vendor":"linux"}],"cvss":{"score":5.5,"severity":"medium","source":"nvd","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","version":"3.1"},"cwes":[{"id":"CWE-401","name":"Missing Release of Memory after Effective Lifetime"}],"description":"In the Linux kernel, the following vulnerability has been resolved:\n\nudp: Fix memory accounting leak.\n\nMatt Dowling reported a weird UDP memory usage issue.\n\nUnder normal operation, the UDP memory usage reported in /proc/net/sockstat\nremains close to zero.  However, it occasionally spiked to 524,288 pages\nand never dropped.  Moreover, the value doubled when the application was\nterminated.  Finally, it caused intermittent packet drops.\n\nWe can reproduce the issue with the script below [0]:\n\n  1. /proc/net/sockstat reports 0 pages\n\n    # cat /proc/net/sockstat | grep UDP:\n    UDP: inuse 1 mem 0\n\n  2. Run the script till the report reaches 524,288\n\n    # python3 test.py \u0026 sleep 5\n    # cat /proc/net/sockstat | grep UDP:\n    UDP: inuse 3 mem 524288  \u003c-- (INT_MAX + 1) \u003e\u003e PAGE_SHIFT\n\n  3. Kill the socket and confirm the number never drops\n\n    # pkill python3 \u0026\u0026 sleep 5\n    # cat /proc/net/sockstat | grep UDP:\n    UDP: inuse 1 mem 524288\n\n  4. (necessary since v6.0) Trigger proto_memory_pcpu_drain()\n\n    # python3 test.py \u0026 sleep 1 \u0026\u0026 pkill python3\n\n  5. The number doubles\n\n    # cat /proc/net/sockstat | grep UDP:\n    UDP: inuse 1 mem 1048577\n\nThe application set INT_MAX to SO_RCVBUF, which triggered an integer\noverflow in udp_rmem_release().\n\nWhen a socket is close()d, udp_destruct_common() purges its receive\nqueue and sums up skb-\u003etruesize in the queue.  This total is calculated\nand stored in a local unsigned integer variable.\n\nThe total size is then passed to udp_rmem_release() to adjust memory\naccounting.  However, because the function takes a signed integer\nargument, the total size can wrap around, causing an overflow.\n\nThen, the released amount is calculated as follows:\n\n  1) Add size to sk-\u003esk_forward_alloc.\n  2) Round down sk-\u003esk_forward_alloc to the nearest lower multiple of\n      PAGE_SIZE and assign it to amount.\n  3) Subtract amount from sk-\u003esk_forward_alloc.\n  4) Pass amount \u003e\u003e PAGE_SHIFT to __sk_mem_reduce_allocated().\n\nWhen the issue occurred, the total in udp_destruct_common() was 2147484480\n(INT_MAX + 833), which was cast to -2147482816 in udp_rmem_release().\n\nAt 1) sk-\u003esk_forward_alloc is changed from 3264 to -2147479552, and\n2) sets -2147479552 to amount.  3) reverts the wraparound, so we don't\nsee a warning in inet_sock_destruct().  However, udp_memory_allocated\nends up doubling at 4).\n\nSince commit 3cd3399dd7a8 (\"net: implement per-cpu reserves for\nmemory_allocated\"), memory usage no longer doubles immediately after\na socket is close()d because __sk_mem_reduce_allocated() caches the\namount in udp_memory_per_cpu_fw_alloc.  However, the next time a UDP\nsocket receives a packet, the subtraction takes effect, causing UDP\nmemory usage to double.\n\nThis issue makes further memory allocation fail once the socket's\nsk-\u003esk_rmem_alloc exceeds net.ipv4.udp_rmem_min, resulting in packet\ndrops.\n\nTo prevent this issue, let's use unsigned int for the calculation and\ncall sk_forward_alloc_add() only once for the small delta.\n\nNote that first_packet_length() also potentially has the same problem.\n\n[0]:\nfrom socket import *\n\nSO_RCVBUFFORCE = 33\nINT_MAX = (2 ** 31) - 1\n\ns = socket(AF_INET, SOCK_DGRAM)\ns.bind(('', 0))\ns.setsockopt(SOL_SOCKET, SO_RCVBUFFORCE, INT_MAX)\n\nc = socket(AF_INET, SOCK_DGRAM)\nc.connect(s.getsockname())\n\ndata = b'a' * 100\n\nwhile True:\n    c.send(data)","ecosystems":["AlmaLinux:8","Red Hat:enterprise_linux:8::nfv","Red Hat:enterprise_linux:8::realtime"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"udp: Fix memory accounting leak.","id":"CVE-2025-22058","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":null,"product":"linux:linux_kernel","products":["linux:linux_kernel"],"type":"integer_overflow","year":"2025"},"n_packages":38,"n_references":9,"next":{"headline":"udp: Fix multiple wraparounds of sk-\u003esk_rmem_alloc.","id":"CVE-2025-22059"},"packages":[{"ecosystem":"AlmaLinux:8","fixed":["4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt","purl":"pkg:rpm/almalinux/kernel-rt","source":"ALSA-2025:14439"},{"ecosystem":"AlmaLinux:8","fixed":["4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-core","purl":"pkg:rpm/almalinux/kernel-rt-core","source":"ALSA-2025:14439"},{"ecosystem":"AlmaLinux:8","fixed":["4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug","purl":"pkg:rpm/almalinux/kernel-rt-debug","source":"ALSA-2025:14439"},{"ecosystem":"AlmaLinux:8","fixed":["4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug-core","purl":"pkg:rpm/almalinux/kernel-rt-debug-core","source":"ALSA-2025:14439"},{"ecosystem":"AlmaLinux:8","fixed":["4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug-devel","purl":"pkg:rpm/almalinux/kernel-rt-debug-devel","source":"ALSA-2025:14439"},{"ecosystem":"AlmaLinux:8","fixed":["4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug-modules","purl":"pkg:rpm/almalinux/kernel-rt-debug-modules","source":"ALSA-2025:14439"},{"ecosystem":"AlmaLinux:8","fixed":["4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug-modules-extra","purl":"pkg:rpm/almalinux/kernel-rt-debug-modules-extra","source":"ALSA-2025:14439"},{"ecosystem":"AlmaLinux:8","fixed":["4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-devel","purl":"pkg:rpm/almalinux/kernel-rt-devel","source":"ALSA-2025:14439"},{"ecosystem":"AlmaLinux:8","fixed":["4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-modules","purl":"pkg:rpm/almalinux/kernel-rt-modules","source":"ALSA-2025:14439"},{"ecosystem":"AlmaLinux:8","fixed":["4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-modules-extra","purl":"pkg:rpm/almalinux/kernel-rt-modules-extra","source":"ALSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::nfv","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt","purl":"pkg:rpm/redhat/kernel-rt","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::nfv","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-core","purl":"pkg:rpm/redhat/kernel-rt-core","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::nfv","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug","purl":"pkg:rpm/redhat/kernel-rt-debug","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::nfv","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug-core","purl":"pkg:rpm/redhat/kernel-rt-debug-core","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::nfv","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug-debuginfo","purl":"pkg:rpm/redhat/kernel-rt-debug-debuginfo","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::nfv","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug-devel","purl":"pkg:rpm/redhat/kernel-rt-debug-devel","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::nfv","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug-kvm","purl":"pkg:rpm/redhat/kernel-rt-debug-kvm","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::nfv","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug-modules","purl":"pkg:rpm/redhat/kernel-rt-debug-modules","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::nfv","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug-modules-extra","purl":"pkg:rpm/redhat/kernel-rt-debug-modules-extra","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::nfv","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debuginfo","purl":"pkg:rpm/redhat/kernel-rt-debuginfo","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::nfv","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debuginfo-common-x86_64","purl":"pkg:rpm/redhat/kernel-rt-debuginfo-common-x86_64","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::nfv","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-devel","purl":"pkg:rpm/redhat/kernel-rt-devel","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::nfv","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-kvm","purl":"pkg:rpm/redhat/kernel-rt-kvm","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::nfv","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-modules","purl":"pkg:rpm/redhat/kernel-rt-modules","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::nfv","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-modules-extra","purl":"pkg:rpm/redhat/kernel-rt-modules-extra","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::realtime","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt","purl":"pkg:rpm/redhat/kernel-rt","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::realtime","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-core","purl":"pkg:rpm/redhat/kernel-rt-core","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::realtime","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug","purl":"pkg:rpm/redhat/kernel-rt-debug","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::realtime","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug-core","purl":"pkg:rpm/redhat/kernel-rt-debug-core","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::realtime","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug-debuginfo","purl":"pkg:rpm/redhat/kernel-rt-debug-debuginfo","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::realtime","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug-devel","purl":"pkg:rpm/redhat/kernel-rt-debug-devel","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::realtime","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug-modules","purl":"pkg:rpm/redhat/kernel-rt-debug-modules","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::realtime","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debug-modules-extra","purl":"pkg:rpm/redhat/kernel-rt-debug-modules-extra","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::realtime","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debuginfo","purl":"pkg:rpm/redhat/kernel-rt-debuginfo","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::realtime","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-debuginfo-common-x86_64","purl":"pkg:rpm/redhat/kernel-rt-debuginfo-common-x86_64","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::realtime","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-devel","purl":"pkg:rpm/redhat/kernel-rt-devel","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::realtime","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-modules","purl":"pkg:rpm/redhat/kernel-rt-modules","source":"RHSA-2025:14439"},{"ecosystem":"Red Hat:enterprise_linux:8::realtime","fixed":["0:4.18.0-553.71.1.rt7.412.el8_10"],"introduced":["0"],"last_affected":[],"package":"kernel-rt-modules-extra","purl":"pkg:rpm/redhat/kernel-rt-modules-extra","source":"RHSA-2025:14439"}],"prev":{"headline":"net: decrease cached dst counters in dst_release","id":"CVE-2025-22057"},"products":["Linux"],"published":"2025-04-16","related":[{"cvss_score":8.8,"headline":"Linux Kernel Out-of-Bounds Write","id":"CVE-2026-53266","kev_date_added":"2026-09-18","published":"2026-06-25"},{"cvss_score":8.8,"headline":"Linux Kernel Improper Input Validation","id":"CVE-2013-6282","kev_date_added":"2022-09-15","published":"2013-11-19"},{"cvss_score":8.4,"headline":"Linux Kernel Heap-Based Buffer Overflow","id":"CVE-2022-0185","kev_date_added":"2024-08-21","published":"2022-02-11"},{"cvss_score":8.4,"headline":"Linux Kernel Privilege Escalation","id":"CVE-2013-2094","kev_date_added":"2022-09-15","published":"2013-05-14"},{"cvss_score":7.8,"headline":"Linux Kernel Unspecified","id":"CVE-2026-53362","kev_date_added":"2026-08-27","published":"2026-07-04"},{"cvss_score":7.8,"headline":"Linux Kernel Missing Initialization of a Variable","id":"CVE-2026-46300","kev_date_added":"2026-10-28","published":"2026-05-23"},{"cvss_score":7.8,"headline":"Linux Kernel Race Condition","id":"CVE-2025-39964","kev_date_added":"2026-09-18","published":"2025-10-13"}],"sources":[{"class":"attribution","licence":"MIT","name":"AlmaLinux","prefix":"ALSA"},{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"Red Hat","prefix":"RHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-06-11","vendors":["Linux"]},"summary":"An integer overflow in Linux kernel UDP memory accounting causes memory leaks and packet drops, leading to denial of service.","url":"https://insights.sbomify.com/CVE-2025-22058/"}