CyberSecBulletin
CVE-2022-49205NVD status: Analyzed

Linux: Double Free

CVE-2022-49205 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 94c6ac22abcdede72bfaa0f4c22fb370891f4002, cd84ea3920aef936c559b63099ef0013ce6b2325, cb6f141ae705af0101e819065a79e6d029f6e393 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.28% chance of exploitation within 30 days, which is low compared with other CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Linux to 94c6ac22abcdede72bfaa0f4c22fb370891f4002 or cd84ea3920aef936c559b63099ef0013ce6b2325 or cb6f141ae705af0101e819065a79e6d029f6e393 or 223f3c51ab163852dd4819d357dcf33039929434, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 5.4.189 or 5.10.110 or 5.15.33 or 5.16.19, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinux604326b41a6fb9b4a78b6179335decee0365cd8c up to, but not including, 94c6ac22abcdede72bfaa0f4c22fb370891f4002; 604326b41a6fb9b4a78b6179335decee0365cd8c up to, but not including, cd84ea3920aef936c559b63099ef0013ce6b2325; 604326b41a6fb9b4a78b6179335decee0365cd8c up to, but not including, cb6f141ae705af0101e819065a79e6d029f6e393; 604326b41a6fb9b4a78b6179335decee0365cd8c up to, but not including, 223f3c51ab163852dd4819d357dcf33039929434; 604326b41a6fb9b4a78b6179335decee0365cd8c up to, but not including, ac3ecb7760c750c8e4fc09c719241d8e6e88028c; 604326b41a6fb9b4a78b6179335decee0365cd8c up to, but not including, 2486ab434b2c2a14e9237296db00b1e1b7ae3273; 4.2094c6ac22abcdede72bfaa0f4c22fb370891f4002, cd84ea3920aef936c559b63099ef0013ce6b2325, cb6f141ae705af0101e819065a79e6d029f6e393, 223f3c51ab163852dd4819d357dcf33039929434, ac3ecb7760c750c8e4fc09c719241d8e6e88028c, 2486ab434b2c2a14e9237296db00b1e1b7ae3273
LinuxLinux Kernel4.20 up to, but not including, 5.4.189; 5.5 up to, but not including, 5.10.110; 5.11 up to, but not including, 5.15.33; 5.16 up to, but not including, 5.16.19; 5.17 up to, but not including, 5.17.25.4.189, 5.10.110, 5.15.33, 5.16.19, 5.17.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.

Official description

In the Linux kernel, the following vulnerability has been resolved: bpf, sockmap: Fix double uncharge the mem of sk_msg If tcp_bpf_sendmsg is running during a tear down operation, psock may be freed. tcp_bpf_sendmsg() tcp_bpf_send_verdict() sk_msg_return() tcp_bpf_sendmsg_redir() unlikely(!psock)) sk_msg_free() The mem of msg has been uncharged in tcp_bpf_send_verdict() by sk_msg_return(), and would be uncharged by sk_msg_free() again. When psock is null, we can simply returning an error code, this would then trigger the sk_msg_free_nocharge in the error path of __SK_REDIRECT and would have the side effect of throwing an error up to user space. This would be a slight change in behavior from user side but would look the same as an error if the redirect on the socket threw an error. This issue can cause the following info: WARNING: CPU: 0 PID: 2136 at net/ipv4/af_inet.c:155 inet_sock_destruct+0x13c/0x260 Call Trace: <TASK> __sk_destruct+0x24/0x1f0 sk_psock_destroy+0x19b/0x1c0 process_one_work+0x1b3/0x3c0 worker_thread+0x30/0x350 ? process_one_work+0x3c0/0x3c0 kthread+0xe6/0x110 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x22/0x30 </TASK>

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.

More Double Free vulnerabilities (CWE-415)

Timeline

  1. CVE record published.
  2. Record last changed materially (score, affected products, status or references).

References

Recent Double Free vulnerabilities

Spotted an error? Tell us.