CVE-2022-50838 (GCVE-0-2022-50838)
Vulnerability from cvelistv5 – Published: 2025-12-30 12:10 – Updated: 2025-12-30 12:10
VLAI?
Title
net: stream: purge sk_error_queue in sk_stream_kill_queues()
Summary
In the Linux kernel, the following vulnerability has been resolved:
net: stream: purge sk_error_queue in sk_stream_kill_queues()
Changheon Lee reported TCP socket leaks, with a nice repro.
It seems we leak TCP sockets with the following sequence:
1) SOF_TIMESTAMPING_TX_ACK is enabled on the socket.
Each ACK will cook an skb put in error queue, from __skb_tstamp_tx().
__skb_tstamp_tx() is using skb_clone(), unless
SOF_TIMESTAMPING_OPT_TSONLY was also requested.
2) If the application is also using MSG_ZEROCOPY, then we put in the
error queue cloned skbs that had a struct ubuf_info attached to them.
Whenever an struct ubuf_info is allocated, sock_zerocopy_alloc()
does a sock_hold().
As long as the cloned skbs are still in sk_error_queue,
socket refcount is kept elevated.
3) Application closes the socket, while error queue is not empty.
Since tcp_close() no longer purges the socket error queue,
we might end up with a TCP socket with at least one skb in
error queue keeping the socket alive forever.
This bug can be (ab)used to consume all kernel memory
and freeze the host.
We need to purge the error queue, with proper synchronization
against concurrent writers.
Severity ?
No CVSS data available.
Assigner
References
Impacted products
| Vendor | Product | Version | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Linux | Linux |
Affected:
7737b104c211fa843de268b897d601e070292a72 , < c8c1eec578a9ae2dc8f14a1846942a0b7bf29d1d
(git)
Affected: 89be5c357de34718eaaaefed80737f432c5ab86f , < bab542cf56fc174c8447c00b73be99ffd66d2d39 (git) Affected: 8b8b3d738e450d2c2ccdc75f0ab5a951746c2a96 , < 6f00bd0402a1e3d2d556afba57c045bd7931e4d3 (git) Affected: b631c603b5fb98d2bd709c35d384901965a3dd51 , < 4f1d37ff4226eb99d6b69e9f4518e279e1a851bf (git) Affected: daf15fa1fd997749e881aedd9f03f73a11240e82 , < 9062493811676ee0efe6c74d98f00ca38c4e17d4 (git) Affected: 3988164fe9ddf98ebf5b5cdede91ac38c5f08a7e , < 9da204cd67c4fe97e8aa465d10d5c2e7076f7f42 (git) Affected: 24bcbe1cc69fa52dc4f7b5b2456678ed464724d8 , < 8c330c36b3970d0917f48827fa6c7a9c75aa4602 (git) Affected: 24bcbe1cc69fa52dc4f7b5b2456678ed464724d8 , < b458d349f8753f666233828ebd30df6f100cf7d5 (git) Affected: 24bcbe1cc69fa52dc4f7b5b2456678ed464724d8 , < e0c8bccd40fc1c19e1d246c39bcf79e357e1ada3 (git) Affected: 6ba975e14f5ebb87143d737c493adf4031409a68 (git) Affected: 4437f3ead9e85c35fe0e3adfb98c0b97eaa267eb (git) |
|||||||
|
|||||||||
{
"containers": {
"cna": {
"affected": [
{
"defaultStatus": "unaffected",
"product": "Linux",
"programFiles": [
"net/core/stream.c"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"versions": [
{
"lessThan": "c8c1eec578a9ae2dc8f14a1846942a0b7bf29d1d",
"status": "affected",
"version": "7737b104c211fa843de268b897d601e070292a72",
"versionType": "git"
},
{
"lessThan": "bab542cf56fc174c8447c00b73be99ffd66d2d39",
"status": "affected",
"version": "89be5c357de34718eaaaefed80737f432c5ab86f",
"versionType": "git"
},
{
"lessThan": "6f00bd0402a1e3d2d556afba57c045bd7931e4d3",
"status": "affected",
"version": "8b8b3d738e450d2c2ccdc75f0ab5a951746c2a96",
"versionType": "git"
},
{
"lessThan": "4f1d37ff4226eb99d6b69e9f4518e279e1a851bf",
"status": "affected",
"version": "b631c603b5fb98d2bd709c35d384901965a3dd51",
"versionType": "git"
},
{
"lessThan": "9062493811676ee0efe6c74d98f00ca38c4e17d4",
"status": "affected",
"version": "daf15fa1fd997749e881aedd9f03f73a11240e82",
"versionType": "git"
},
{
"lessThan": "9da204cd67c4fe97e8aa465d10d5c2e7076f7f42",
"status": "affected",
"version": "3988164fe9ddf98ebf5b5cdede91ac38c5f08a7e",
"versionType": "git"
},
{
"lessThan": "8c330c36b3970d0917f48827fa6c7a9c75aa4602",
"status": "affected",
"version": "24bcbe1cc69fa52dc4f7b5b2456678ed464724d8",
"versionType": "git"
},
{
"lessThan": "b458d349f8753f666233828ebd30df6f100cf7d5",
"status": "affected",
"version": "24bcbe1cc69fa52dc4f7b5b2456678ed464724d8",
"versionType": "git"
},
{
"lessThan": "e0c8bccd40fc1c19e1d246c39bcf79e357e1ada3",
"status": "affected",
"version": "24bcbe1cc69fa52dc4f7b5b2456678ed464724d8",
"versionType": "git"
},
{
"status": "affected",
"version": "6ba975e14f5ebb87143d737c493adf4031409a68",
"versionType": "git"
},
{
"status": "affected",
"version": "4437f3ead9e85c35fe0e3adfb98c0b97eaa267eb",
"versionType": "git"
}
]
},
{
"defaultStatus": "affected",
"product": "Linux",
"programFiles": [
"net/core/stream.c"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"versions": [
{
"status": "affected",
"version": "5.16"
},
{
"lessThan": "5.16",
"status": "unaffected",
"version": "0",
"versionType": "semver"
},
{
"lessThanOrEqual": "4.9.*",
"status": "unaffected",
"version": "4.9.337",
"versionType": "semver"
},
{
"lessThanOrEqual": "4.14.*",
"status": "unaffected",
"version": "4.14.303",
"versionType": "semver"
},
{
"lessThanOrEqual": "4.19.*",
"status": "unaffected",
"version": "4.19.270",
"versionType": "semver"
},
{
"lessThanOrEqual": "5.4.*",
"status": "unaffected",
"version": "5.4.229",
"versionType": "semver"
},
{
"lessThanOrEqual": "5.10.*",
"status": "unaffected",
"version": "5.10.163",
"versionType": "semver"
},
{
"lessThanOrEqual": "5.15.*",
"status": "unaffected",
"version": "5.15.86",
"versionType": "semver"
},
{
"lessThanOrEqual": "6.0.*",
"status": "unaffected",
"version": "6.0.16",
"versionType": "semver"
},
{
"lessThanOrEqual": "6.1.*",
"status": "unaffected",
"version": "6.1.2",
"versionType": "semver"
},
{
"lessThanOrEqual": "*",
"status": "unaffected",
"version": "6.2",
"versionType": "original_commit_for_fix"
}
]
}
],
"cpeApplicability": [
{
"nodes": [
{
"cpeMatch": [
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "4.9.337",
"versionStartIncluding": "4.9.291",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "4.14.303",
"versionStartIncluding": "4.14.256",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "4.19.270",
"versionStartIncluding": "4.19.218",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "5.4.229",
"versionStartIncluding": "5.4.160",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "5.10.163",
"versionStartIncluding": "5.10.80",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "5.15.86",
"versionStartIncluding": "5.15.3",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "6.0.16",
"versionStartIncluding": "5.16",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "6.1.2",
"versionStartIncluding": "5.16",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "6.2",
"versionStartIncluding": "5.16",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionStartIncluding": "4.4.293",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionStartIncluding": "5.14.19",
"vulnerable": true
}
],
"negate": false,
"operator": "OR"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "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."
}
],
"providerMetadata": {
"dateUpdated": "2025-12-30T12:10:57.721Z",
"orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"shortName": "Linux"
},
"references": [
{
"url": "https://git.kernel.org/stable/c/c8c1eec578a9ae2dc8f14a1846942a0b7bf29d1d"
},
{
"url": "https://git.kernel.org/stable/c/bab542cf56fc174c8447c00b73be99ffd66d2d39"
},
{
"url": "https://git.kernel.org/stable/c/6f00bd0402a1e3d2d556afba57c045bd7931e4d3"
},
{
"url": "https://git.kernel.org/stable/c/4f1d37ff4226eb99d6b69e9f4518e279e1a851bf"
},
{
"url": "https://git.kernel.org/stable/c/9062493811676ee0efe6c74d98f00ca38c4e17d4"
},
{
"url": "https://git.kernel.org/stable/c/9da204cd67c4fe97e8aa465d10d5c2e7076f7f42"
},
{
"url": "https://git.kernel.org/stable/c/8c330c36b3970d0917f48827fa6c7a9c75aa4602"
},
{
"url": "https://git.kernel.org/stable/c/b458d349f8753f666233828ebd30df6f100cf7d5"
},
{
"url": "https://git.kernel.org/stable/c/e0c8bccd40fc1c19e1d246c39bcf79e357e1ada3"
}
],
"title": "net: stream: purge sk_error_queue in sk_stream_kill_queues()",
"x_generator": {
"engine": "bippy-1.2.0"
}
}
},
"cveMetadata": {
"assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"assignerShortName": "Linux",
"cveId": "CVE-2022-50838",
"datePublished": "2025-12-30T12:10:57.721Z",
"dateReserved": "2025-12-30T12:06:07.133Z",
"dateUpdated": "2025-12-30T12:10:57.721Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2",
"vulnerability-lookup:meta": {
"nvd": "{\"cve\":{\"id\":\"CVE-2022-50838\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-12-30T13:15:58.350\",\"lastModified\":\"2025-12-30T13:15:58.350\",\"vulnStatus\":\"Received\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"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.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/4f1d37ff4226eb99d6b69e9f4518e279e1a851bf\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/6f00bd0402a1e3d2d556afba57c045bd7931e4d3\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/8c330c36b3970d0917f48827fa6c7a9c75aa4602\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/9062493811676ee0efe6c74d98f00ca38c4e17d4\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/9da204cd67c4fe97e8aa465d10d5c2e7076f7f42\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/b458d349f8753f666233828ebd30df6f100cf7d5\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/bab542cf56fc174c8447c00b73be99ffd66d2d39\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/c8c1eec578a9ae2dc8f14a1846942a0b7bf29d1d\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/e0c8bccd40fc1c19e1d246c39bcf79e357e1ada3\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
}
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…