Linux: Double Free
CVE-2022-50536 is a high-severity double free vulnerability in Linux, with a CVSS 3.1 base score of 7.8 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, without any action from a user. The record lists versions 7508b9f4daac4ec7dfe0b6fb2d688b1c1c105e10, 28e4a763cd4a2b1a78852216ef4bd7df3a05cec6, 8786bde11a4f31b63b3036731df0b47337a7a245 as the first without the flaw, so updating Linux to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.17% chance of exploitation within 30 days, which is low compared with other CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update Linux to 7508b9f4daac4ec7dfe0b6fb2d688b1c1c105e10 or 28e4a763cd4a2b1a78852216ef4bd7df3a05cec6 or 8786bde11a4f31b63b3036731df0b47337a7a245 or 578a7628b838a3ac8ad61deaab5a816ff032ac13, whichever matches your release line, or a later version.
- Update Linux Kernel to 5.4.229 or 5.10.163 or 5.15 or 5.15.86, whichever matches your release line, or a later version.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Linux | Linux | 5f0bfe21c853917aae4bc5a70fe57ddb4054443e up to, but not including, 7508b9f4daac4ec7dfe0b6fb2d688b1c1c105e10; 15dec6d8f8642a26d6a272af2d7f9877df8f02b8 up to, but not including, 28e4a763cd4a2b1a78852216ef4bd7df3a05cec6; cd9733f5d75c94a32544d6ce5be47e14194cf137 up to, but not including, 8786bde11a4f31b63b3036731df0b47337a7a245; cd9733f5d75c94a32544d6ce5be47e14194cf137 up to, but not including, 578a7628b838a3ac8ad61deaab5a816ff032ac13; cd9733f5d75c94a32544d6ce5be47e14194cf137 up to, but not including, 113236e8f49f262f318c00ebb14b15f4834e87c1; cd9733f5d75c94a32544d6ce5be47e14194cf137 up to, but not including, 7a9841ca025275b5b0edfb0b618934abb6ceec15; 6f226ffe4458ea3b8c33287cb8c86f87dc198dce; 5.4.157 up to, but not including, 5.4.229; and 3 more ranges | 7508b9f4daac4ec7dfe0b6fb2d688b1c1c105e10, 28e4a763cd4a2b1a78852216ef4bd7df3a05cec6, 8786bde11a4f31b63b3036731df0b47337a7a245, 578a7628b838a3ac8ad61deaab5a816ff032ac13, 113236e8f49f262f318c00ebb14b15f4834e87c1, 7a9841ca025275b5b0edfb0b618934abb6ceec15 |
| Linux | Linux Kernel | 5.4.157 up to, but not including, 5.4.229; 5.10.77 up to, but not including, 5.10.163; 5.14.16 up to, but not including, 5.15; 5.15.1 up to, but not including, 5.15.86; 5.16 up to, but not including, 6.0.16; 6.1 up to, but not including, 6.1.2; 5.15 | 5.4.229, 5.10.163, 5.15, 5.15.86, 6.0.16, 6.1.2 |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- LocalThe attacker needs local access or must trick a user into running something.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- LowA basic user account is enough.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 7.8 | High | CNA |
| CVSS 3.1 | 7.8 | High | NVD |
Official description
In the Linux kernel, the following vulnerability has been resolved: bpf, sockmap: Fix repeated calls to sock_put() when msg has more_data In tcp_bpf_send_verdict() redirection, the eval variable is assigned to __SK_REDIRECT after the apply_bytes data is sent, if msg has more_data, sock_put() will be called multiple times. We should reset the eval variable to __SK_NONE every time more_data starts. This causes: IPv4: Attempt to release TCP socket in state 1 00000000b4c925d7 ------------[ cut here ]------------ refcount_t: addition on 0; use-after-free. WARNING: CPU: 5 PID: 4482 at lib/refcount.c:25 refcount_warn_saturate+0x7d/0x110 Modules linked in: CPU: 5 PID: 4482 Comm: sockhash_bypass 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> __tcp_transmit_skb+0xa1b/0xb90 ? __alloc_skb+0x8c/0x1a0 ? __kmalloc_node_track_caller+0x184/0x320 tcp_write_xmit+0x22a/0x1110 __tcp_push_pending_frames+0x32/0xf0 do_tcp_sendpages+0x62d/0x640 tcp_bpf_push+0xae/0x2c0 tcp_bpf_sendmsg_redir+0x260/0x410 ? preempt_count_add+0x70/0xa0 tcp_bpf_send_verdict+0x386/0x4b0 tcp_bpf_sendmsg+0x21b/0x3b0 sock_sendmsg+0x58/0x70 __sys_sendto+0xfa/0x170 ? xfd_validate_state+0x1d/0x80 ? switch_fpu_return+0x59/0xe0 __x64_sys_sendto+0x24/0x30 do_syscall_64+0x37/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Double Free
The product calls free() twice on the same memory address.
How developers prevent this class of flaw
- Choose a language that provides automatic memory management.
- Ensure that each allocation is freed only once. After freeing a chunk, set the pointer to NULL to ensure the pointer cannot be freed again. In complicated error conditions, be sure that clean-up routines respect the state of allocation properly. If the language is object oriented, ensure that object destructors delete each chunk of memory only once.
- Use a static analysis tool to find double free instances.
Timeline
- CVE record published.
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
- git.kernel.org/stable/c/113236e8f49f262f318c00ebb14b15f4834e87c1
- git.kernel.org/stable/c/28e4a763cd4a2b1a78852216ef4bd7df3a05cec6
- git.kernel.org/stable/c/578a7628b838a3ac8ad61deaab5a816ff032ac13
- git.kernel.org/stable/c/7508b9f4daac4ec7dfe0b6fb2d688b1c1c105e10
- git.kernel.org/stable/c/7a9841ca025275b5b0edfb0b618934abb6ceec15
- git.kernel.org/stable/c/8786bde11a4f31b63b3036731df0b47337a7a245
Recent Double Free vulnerabilities
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
Spotted an error? Tell us.