{"id":"CVE-2026-98801","aliases":["CVE-2026-98801"],"related":[],"kind":"vulnerability","state":"published","title":"net: restrict SO_RESERVE_MEM to TCP sockets and cap max value","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: restrict SO_RESERVE_MEM to TCP sockets and cap max value\n\nCommit 2bb2f5fb21b0 (\"net: add new socket option SO_RESERVE_MEM\") and\ncommit d00c8ee31729 (\"net: fix possible NULL deref in sock_reserve_memory\")\nonly checked sk_has_account(sk), which is true for both TCP and UDP\nsockets.\n\nHowever, SO_RESERVE_MEM and sk_unused_reserved_mem() are currently only\nsupported by TCP:\n- On UDP sockets, sk->sk_forward_alloc is protected by\n  sk->sk_receive_queue.lock, whereas sock_reserve_memory() and\n  sock_release_reserved_memory() only acquire lock_sock(sk). Concurrent\n  UDP packet reception/release and setsockopt(SO_RESERVE_MEM) corrupt\n  sk_forward_alloc and memcg accounting.\n- udp_rmem_release() reclaims excess sk_forward_alloc without\n  accounting for sk_unused_reserved_mem(sk).\n\nRestrict sock_reserve_memory() to TCP sockets (sk_is_tcp(sk)) for now.\nSupporting SO_RESERVE_MEM for UDP (acquiring sk_receive_queue.lock and\nhonoring sk_unused_reserved_mem() in udp_rmem_release()) can be done in\na future net-next series if needed.\n\nIn addition, reject val > SZ_1G with -EINVAL in\nsk_setsockopt(SO_RESERVE_MEM). Without an upper bound, values near\nINT_MAX cause sk_mem_pages(delta) and (pages << PAGE_SHIFT) to overflow\n32-bit signed int, corrupting sk->sk_forward_alloc and\nsk->sk_reserved_mem. Using a page-aligned cap (SZ_1G) ensures that the\npage-rounded sk->sk_reserved_mem reported by getsockopt(SO_RESERVE_MEM)\ncan always be passed back to setsockopt(SO_RESERVE_MEM).","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: restrict SO_RESERVE_MEM to TCP sockets and cap max value\n\nCommit 2bb2f5fb21b0 (\"net: add new socket option SO_RESERVE_MEM\") and\ncommit d00c8ee31729 (\"net: fix possible NULL deref in sock_reserve_memory\")\nonly checked sk_has_account(sk), which is true for both TCP and UDP\nsockets.\n\nHowever, SO_RESERVE_MEM and sk_unused_reserved_mem() are currently only\nsupported by TCP:\n- On UDP sockets, sk->sk_forward_alloc is protected by\n  sk->sk_receive_queue.lock, whereas sock_reserve_memory() and\n  sock_release_reserved_memory() only acquire lock_sock(sk). Concurrent\n  UDP packet reception/release and setsockopt(SO_RESERVE_MEM) corrupt\n  sk_forward_alloc and memcg accounting.\n- udp_rmem_release() reclaims excess sk_forward_alloc without\n  accounting for sk_unused_reserved_mem(sk).\n\nRestrict sock_reserve_memory() to TCP sockets (sk_is_tcp(sk)) for now.\nSupporting SO_RESERVE_MEM for UDP (acquiring sk_receive_queue.lock and\nhonoring sk_unused_reserved_mem() in udp_rmem_release()) can be done in\na future net-next series if needed.\n\nIn addition, reject val > SZ_1G with -EINVAL in\nsk_setsockopt(SO_RESERVE_MEM). Without an upper bound, values near\nINT_MAX cause sk_mem_pages(delta) and (pages << PAGE_SHIFT) to overflow\n32-bit signed int, corrupting sk->sk_forward_alloc and\nsk->sk_reserved_mem. Using a page-aligned cap (SZ_1G) ensures that the\npage-rounded sk->sk_reserved_mem reported by getsockopt(SO_RESERVE_MEM)\ncan always be passed back to setsockopt(SO_RESERVE_MEM).","source":"cvelist"}],"published":"2026-10-18T15:48:47.171Z","modified":"2026-10-19T10:19:44.163Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"2bb2f5fb21b0486ff69b7b4a1fe03a760527d133","fixed":"492e04f9a00f3cc88a1f6899417b10f3019a624e","status":"affected"},{"type":"git","introduced":"2bb2f5fb21b0486ff69b7b4a1fe03a760527d133","fixed":"5069ce898148bd799395c5a464e006cbb840f188","status":"affected"},{"type":"git","introduced":"2bb2f5fb21b0486ff69b7b4a1fe03a760527d133","fixed":"a467b05b201b5c26be52ed3081992fa9c0387648","status":"affected"},{"type":"git","introduced":"2bb2f5fb21b0486ff69b7b4a1fe03a760527d133","fixed":"37e02c42a00be692c06343e11779aadc45f45971","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.16","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.16","status":"unaffected"},{"type":"semver","introduced":"6.12.113","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.56","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.2.10","lastAffected":"7.2.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.3","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/492e04f9a00f3cc88a1f6899417b10f3019a624e","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5069ce898148bd799395c5a464e006cbb840f188","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a467b05b201b5c26be52ed3081992fa9c0387648","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/37e02c42a00be692c06343e11779aadc45f45971","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-98801","url":"https://www.cve.org/CVERecord?id=CVE-2026-98801","licence":"CVE Terms of Use","modified":"2026-10-19T09:25:54.691Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-98801","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-98801","licence":"Public domain","modified":"2026-10-19T10:19:44.163Z"}],"updatedAt":"2026-11-25T22:59:45.307Z","epss":{"score":0.00168,"percentile":0.06386,"date":"2026-12-01T12:00:22.000Z"}}