CVE-2022-50536

Source
https://cve.org/CVERecord?id=CVE-2022-50536
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-50536.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-50536
Downstream
Related
Published
2025-10-07T15:21:03.056Z
Modified
2026-03-20T12:22:36.043487Z
Summary
bpf, sockmap: Fix repeated calls to sock_put() when msg has more_data
Details

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

bpf, sockmap: Fix repeated calls to sockput() when msg has moredata

In tcpbpfsend_verdict() redirection, the eval variable is assigned to __SKREDIRECT after the applybytes data is sent, if msg has moredata, sockput() will be called multiple times.

We should reset the eval variable to __SKNONE every time moredata starts.

This causes:

IPv4: Attempt to release TCP socket in state 1 00000000b4c925d7 ------------[ cut here ]------------ refcountt: addition on 0; use-after-free. WARNING: CPU: 5 PID: 4482 at lib/refcount.c:25 refcountwarnsaturate+0x7d/0x110 Modules linked in: CPU: 5 PID: 4482 Comm: sockhashbypass Kdump: loaded Not tainted 6.0.0 #1 Hardware name: Red Hat KVM, BIOS 1.11.0-2.el7 04/01/2014 Call Trace: <TASK> __tcptransmitskb+0xa1b/0xb90 ? __alloc_skb+0x8c/0x1a0 ? __kmallocnodetrackcaller+0x184/0x320 tcpwrite_xmit+0x22a/0x1110 __tcppushpendingframes+0x32/0xf0 dotcpsendpages+0x62d/0x640 tcpbpfpush+0xae/0x2c0 tcpbpfsendmsgredir+0x260/0x410 ? preemptcountadd+0x70/0xa0 tcpbpfsendverdict+0x386/0x4b0 tcpbpfsendmsg+0x21b/0x3b0 socksendmsg+0x58/0x70 __syssendto+0xfa/0x170 ? xfdvalidate_state+0x1d/0x80 ? switchfpureturn+0x59/0xe0 __x64syssendto+0x24/0x30 dosyscall64+0x37/0x90 entrySYSCALL64afterhwframe+0x63/0xcd

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50536.json"
}
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
5f0bfe21c853917aae4bc5a70fe57ddb4054443e
Fixed
7508b9f4daac4ec7dfe0b6fb2d688b1c1c105e10
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
15dec6d8f8642a26d6a272af2d7f9877df8f02b8
Fixed
28e4a763cd4a2b1a78852216ef4bd7df3a05cec6
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
cd9733f5d75c94a32544d6ce5be47e14194cf137
Fixed
8786bde11a4f31b63b3036731df0b47337a7a245
Fixed
578a7628b838a3ac8ad61deaab5a816ff032ac13
Fixed
113236e8f49f262f318c00ebb14b15f4834e87c1
Fixed
7a9841ca025275b5b0edfb0b618934abb6ceec15
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
6f226ffe4458ea3b8c33287cb8c86f87dc198dce

Database specific

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