{"id":"CVE-2022-50838","summary":"net: stream: purge sk_error_queue in sk_stream_kill_queues()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: stream: purge sk_error_queue in sk_stream_kill_queues()\n\nChangheon Lee reported TCP socket leaks, with a nice repro.\n\nIt seems we leak TCP sockets with the following sequence:\n\n1) SOF_TIMESTAMPING_TX_ACK is enabled on the socket.\n\n   Each ACK will cook an skb put in error queue, from __skb_tstamp_tx().\n   __skb_tstamp_tx() is using skb_clone(), unless\n   SOF_TIMESTAMPING_OPT_TSONLY was also requested.\n\n2) If the application is also using MSG_ZEROCOPY, then we put in the\n   error queue cloned skbs that had a struct ubuf_info attached to them.\n\n   Whenever an struct ubuf_info is allocated, sock_zerocopy_alloc()\n   does a sock_hold().\n\n   As long as the cloned skbs are still in sk_error_queue,\n   socket refcount is kept elevated.\n\n3) Application closes the socket, while error queue is not empty.\n\nSince tcp_close() no longer purges the socket error queue,\nwe might end up with a TCP socket with at least one skb in\nerror queue keeping the socket alive forever.\n\nThis bug can be (ab)used to consume all kernel memory\nand freeze the host.\n\nWe need to purge the error queue, with proper synchronization\nagainst concurrent writers.","modified":"2026-04-02T08:28:47.210952Z","published":"2025-12-30T12:10:57.721Z","related":["SUSE-SU-2026:0263-1","SUSE-SU-2026:0317-1"],"database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50838.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/4f1d37ff4226eb99d6b69e9f4518e279e1a851bf"},{"type":"WEB","url":"https://git.kernel.org/stable/c/6f00bd0402a1e3d2d556afba57c045bd7931e4d3"},{"type":"WEB","url":"https://git.kernel.org/stable/c/8c330c36b3970d0917f48827fa6c7a9c75aa4602"},{"type":"WEB","url":"https://git.kernel.org/stable/c/9062493811676ee0efe6c74d98f00ca38c4e17d4"},{"type":"WEB","url":"https://git.kernel.org/stable/c/9da204cd67c4fe97e8aa465d10d5c2e7076f7f42"},{"type":"WEB","url":"https://git.kernel.org/stable/c/b458d349f8753f666233828ebd30df6f100cf7d5"},{"type":"WEB","url":"https://git.kernel.org/stable/c/bab542cf56fc174c8447c00b73be99ffd66d2d39"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c8c1eec578a9ae2dc8f14a1846942a0b7bf29d1d"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e0c8bccd40fc1c19e1d246c39bcf79e357e1ada3"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50838.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50838"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"7737b104c211fa843de268b897d601e070292a72"},{"fixed":"c8c1eec578a9ae2dc8f14a1846942a0b7bf29d1d"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"89be5c357de34718eaaaefed80737f432c5ab86f"},{"fixed":"bab542cf56fc174c8447c00b73be99ffd66d2d39"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"8b8b3d738e450d2c2ccdc75f0ab5a951746c2a96"},{"fixed":"6f00bd0402a1e3d2d556afba57c045bd7931e4d3"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"b631c603b5fb98d2bd709c35d384901965a3dd51"},{"fixed":"4f1d37ff4226eb99d6b69e9f4518e279e1a851bf"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"daf15fa1fd997749e881aedd9f03f73a11240e82"},{"fixed":"9062493811676ee0efe6c74d98f00ca38c4e17d4"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"3988164fe9ddf98ebf5b5cdede91ac38c5f08a7e"},{"fixed":"9da204cd67c4fe97e8aa465d10d5c2e7076f7f42"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"24bcbe1cc69fa52dc4f7b5b2456678ed464724d8"},{"fixed":"8c330c36b3970d0917f48827fa6c7a9c75aa4602"},{"fixed":"b458d349f8753f666233828ebd30df6f100cf7d5"},{"fixed":"e0c8bccd40fc1c19e1d246c39bcf79e357e1ada3"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"0"},{"last_affected":"6ba975e14f5ebb87143d737c493adf4031409a68"},{"last_affected":"4437f3ead9e85c35fe0e3adfb98c0b97eaa267eb"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50838.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.9.337"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.10.0"},{"fixed":"4.14.303"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.15.0"},{"fixed":"4.19.270"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.20.0"},{"fixed":"5.4.229"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.5.0"},{"fixed":"5.10.163"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.86"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.0.16"},{"fixed":"6.1.2"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50838.json"}}],"schema_version":"1.7.5"}