CVE-2022-49209

Source
https://cve.org/CVERecord?id=CVE-2022-49209
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49209.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49209
Downstream
Related
Published
2025-02-26T01:55:47.154Z
Modified
2026-03-20T12:22:15.752671Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
bpf, sockmap: Fix memleak in tcp_bpf_sendmsg while sk msg is full
Details

In the Linux kernel, the following vulnerability has been resolved:

bpf, sockmap: Fix memleak in tcpbpfsendmsg while sk msg is full

If tcpbpfsendmsg() is running while sk msg is full. When skmsgalloc() returns -ENOMEM error, tcpbpfsendmsg() goes to waitformemory. If partial memory has been alloced by skmsgalloc(), that is, msgtx->sg.size is greater than osize after skmsgalloc(), memleak occurs. To fix we use skmsg_trim() to release the allocated memory, then goto wait for memory.

Other call paths of skmsgalloc() have the similar issue, such as tlsswsendmsg(), so handle skmsgtrim logic inside skmsgalloc(), as Cong Wang suggested.

This issue can cause the following info: WARNING: CPU: 3 PID: 7950 at net/core/stream.c:208 skstreamkillqueues+0xd4/0x1a0 Call Trace: <TASK> inetcskdestroysock+0x55/0x110 __tcpclose+0x279/0x470 tcpclose+0x1f/0x60 inet_release+0x3f/0x80 __sockrelease+0x3d/0xb0 sockclose+0x11/0x20 __fput+0x92/0x250 taskworkrun+0x6a/0xa0 doexit+0x33b/0xb60 dogroupexit+0x2f/0xa0 getsignal+0xb6/0x950 archdosignalorrestart+0xac/0x2a0 exittousermodeprepare+0xa9/0x200 syscallexittousermode+0x12/0x30 dosyscall64+0x46/0x80 entrySYSCALL64afterhwframe+0x44/0xae </TASK>

WARNING: CPU: 3 PID: 2094 at net/ipv4/afinet.c:155 inetsock_destruct+0x13c/0x260 Call Trace: <TASK> _skdestruct+0x24/0x1f0 skpsockdestroy+0x19b/0x1c0 processonework+0x1b3/0x3c0 kthread+0xe6/0x110 retfromfork+0x22/0x30 </TASK>

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49209.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / 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
604326b41a6fb9b4a78b6179335decee0365cd8c
Fixed
6d03722c34d9603df325f67c6d30dc1b7b3c6067
Fixed
bec34a91eba3483e1830c02bdd36f8f968642047
Fixed
de3a8d8fab0710186f7864ec812836d8d70da3c9
Fixed
f677328f05f52d535cbdc15cb04476db49477eb4
Fixed
d0b85dfc6f01d26808e2576c6537c131b590e270
Fixed
9c34e38c4a870eb30b13f42f5b44f42e9d19ccb8

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49209.json"