CVE-2022-49877

Source
https://cve.org/CVERecord?id=CVE-2022-49877
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49877.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-49877
Downstream
Related
Published
2025-05-01T14:10:25.682Z
Modified
2026-04-02T08:28:00.920547Z
Summary
bpf, sockmap: Fix the sk->sk_forward_alloc warning of sk_stream_kill_queues
Details

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

bpf, sockmap: Fix the sk->skforwardalloc warning of skstreamkill_queues

When running test_sockmap selftests, the following warning appears:

WARNING: CPU: 2 PID: 197 at net/core/stream.c:205 skstreamkillqueues+0xd3/0xf0 Call Trace: <TASK> inetcskdestroysock+0x55/0x110 tcprcvstateprocess+0xd28/0x1380 ? tcpv4dorcv+0x77/0x2c0 tcpv4do_rcv+0x77/0x2c0 __release_sock+0x106/0x130 __tcpclose+0x1a7/0x4e0 tcpclose+0x20/0x70 inet_release+0x3c/0x80 __sockrelease+0x3a/0xb0 sockclose+0x14/0x20 __fput+0xa3/0x260 taskworkrun+0x59/0xb0 exittousermodeprepare+0x1b3/0x1c0 syscallexittousermode+0x19/0x50 dosyscall64+0x48/0x90 entrySYSCALL64afterhwframe+0x44/0xae

The root case is in commit 84472b436e76 ("bpf, sockmap: Fix more uncharged while msg has more_data"), where I used msg->sg.size to replace the tosend, causing breakage:

if (msg->applybytes && msg->applybytes < tosend) tosend = psock->apply_bytes;

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49877.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
244ce90c8d0bd10ebf957da02c6f3fcd5d920bdf
Fixed
d975bec1eaeb52341acc9273db79ddb078220399
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
7b812a369e6416ab06d83cdd39d8e3f752781dd0
Fixed
cc21dc48a78cc9e5af9a4d039cd456446a6e73ff
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
168ff181f5b6e7fce684c98a30d35da1dbf8f82a
Fixed
95adbd2ac8de82e43fd6b347e7e1b47f74dc1abb
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
84472b436e760ba439e1969a9e3c5ae7c86de39d
Fixed
14e8bc3bf7bd6af64d7538a0684c8238d96cdfd7
Fixed
8ec95b94716a1e4d126edc3fb2bc426a717e2dba
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
87d532d41ef937e16f61b3d2094f3a2ac49be365
Last affected
abb4caa477a5450817d2aa1198edce66450aecf8

Database specific

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