CyberSecBulletin
CVE-2022-50552NVD status: Modified

Linux: Use After Free

CVE-2022-50552 is a high-severity use after 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 0f90015383cd3f1128bebfbe7a97122d97808046, 9646443f28f33ec545ae303e613c3f476fad4dc1, 63a681bcc32a43528ce0f690569f7f48e59c3963 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.21% 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 0f90015383cd3f1128bebfbe7a97122d97808046 or 9646443f28f33ec545ae303e613c3f476fad4dc1 or 63a681bcc32a43528ce0f690569f7f48e59c3963 or c478b3b2900f1834cf9eda5bfef0d5696099505d, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 5.19.17 or 6.0.3, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinuxd48ece209f82c9ce07be942441b53d3fa3664936 up to, but not including, 0f90015383cd3f1128bebfbe7a97122d97808046; d48ece209f82c9ce07be942441b53d3fa3664936 up to, but not including, 9646443f28f33ec545ae303e613c3f476fad4dc1; d48ece209f82c9ce07be942441b53d3fa3664936 up to, but not including, 63a681bcc32a43528ce0f690569f7f48e59c3963; d48ece209f82c9ce07be942441b53d3fa3664936 up to, but not including, c478b3b2900f1834cf9eda5bfef0d5696099505d; d48ece209f82c9ce07be942441b53d3fa3664936 up to, but not including, 8237c01f1696bc53c470493bf1fe092a107648a6; 4.190f90015383cd3f1128bebfbe7a97122d97808046, 9646443f28f33ec545ae303e613c3f476fad4dc1, 63a681bcc32a43528ce0f690569f7f48e59c3963, c478b3b2900f1834cf9eda5bfef0d5696099505d, 8237c01f1696bc53c470493bf1fe092a107648a6
LinuxLinux Kernel4.19 up to, but not including, 5.19.17; 6.0 up to, but not including, 6.0.35.19.17, 6.0.3

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: blk-mq: use quiesced elevator switch when reinitializing queues The hctx's run_work may be racing with the elevator switch when reinitializing hardware queues. The queue is merely frozen in this context, but that only prevents requests from allocating and doesn't stop the hctx work from running. The work may get an elevator pointer that's being torn down, and can result in use-after-free errors and kernel panics (example below). Use the quiesced elevator switch instead, and make the previous one static since it is now only used locally. nvme nvme0: resetting controller nvme nvme0: 32/0/0 default/read/poll queues BUG: kernel NULL pointer dereference, address: 0000000000000008 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 80000020c8861067 P4D 80000020c8861067 PUD 250f8c8067 PMD 0 Oops: 0000 [#1] SMP PTI Workqueue: kblockd blk_mq_run_work_fn RIP: 0010:kyber_has_work+0x29/0x70 ... Call Trace: __blk_mq_do_dispatch_sched+0x83/0x2b0 __blk_mq_sched_dispatch_requests+0x12e/0x170 blk_mq_sched_dispatch_requests+0x30/0x60 __blk_mq_run_hw_queue+0x2b/0x50 process_one_work+0x1ef/0x380 worker_thread+0x2d/0x3e0

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Use After Free

The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory belongs to the code that operates on the new pointer.

How developers prevent this class of flaw

  • Choose a language that provides automatic memory management.
  • When freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures may lower the usefulness of this strategy.

More Use After Free vulnerabilities (CWE-416)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: partial).
  3. Record last changed materially (score, affected products, status or references).

References

Recent Use After Free vulnerabilities

Spotted an error? Tell us.