CyberSecBulletin
CVE-2022-50220NVD status: Analyzed

Linux: Use After Free

CVE-2022-50220 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 d2d6b530d89b0a912148018027386aa049f0a309, e2a521a7dcc463c5017b4426ca0804e151faeff7, 7f77dcbc030c2faa6d8e8a594985eeb34018409e 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.26% 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 d2d6b530d89b0a912148018027386aa049f0a309 or e2a521a7dcc463c5017b4426ca0804e151faeff7 or 7f77dcbc030c2faa6d8e8a594985eeb34018409e or 8b4588b8b00b299be16a35be67b331d8fdba03f3, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 4.9.326 or 4.14.291 or 4.19.256 or 5.4.211, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinux23f333a2bfafba80339315b724808982a9de57d9 up to, but not including, d2d6b530d89b0a912148018027386aa049f0a309; 23f333a2bfafba80339315b724808982a9de57d9 up to, but not including, e2a521a7dcc463c5017b4426ca0804e151faeff7; 23f333a2bfafba80339315b724808982a9de57d9 up to, but not including, 7f77dcbc030c2faa6d8e8a594985eeb34018409e; 23f333a2bfafba80339315b724808982a9de57d9 up to, but not including, 8b4588b8b00b299be16a35be67b331d8fdba03f3; 23f333a2bfafba80339315b724808982a9de57d9 up to, but not including, 135199a2edd459d2b123144efcd7f9bcd95128e4; 23f333a2bfafba80339315b724808982a9de57d9 up to, but not including, 635fd8953e4309b54ca6a81bed1d4a87668694f4; 23f333a2bfafba80339315b724808982a9de57d9 up to, but not including, d49bb8cf9bfaa06aa527eb30f1a52a071da2e32f; 23f333a2bfafba80339315b724808982a9de57d9 up to, but not including, db3b738ae5f726204876f4303c49cfdf4311403f; and 2 more rangesd2d6b530d89b0a912148018027386aa049f0a309, e2a521a7dcc463c5017b4426ca0804e151faeff7, 7f77dcbc030c2faa6d8e8a594985eeb34018409e, 8b4588b8b00b299be16a35be67b331d8fdba03f3, 135199a2edd459d2b123144efcd7f9bcd95128e4, 635fd8953e4309b54ca6a81bed1d4a87668694f4
LinuxLinux Kernel2.6.38 up to, but not including, 4.9.326; 4.10 up to, but not including, 4.14.291; 4.15 up to, but not including, 4.19.256; 4.20 up to, but not including, 5.4.211; 5.5 up to, but not including, 5.10.137; 5.11 up to, but not including, 5.15.61; 5.16 up to, but not including, 5.18.18; 5.19 up to, but not including, 5.19.24.9.326, 4.14.291, 4.19.256, 5.4.211, 5.10.137, 5.15.61

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: usbnet: Fix linkwatch use-after-free on disconnect usbnet uses the work usbnet_deferred_kevent() to perform tasks which may sleep. On disconnect, completion of the work was originally awaited in ->ndo_stop(). But in 2003, that was moved to ->disconnect() by historic commit "[PATCH] USB: usbnet, prevent exotic rtnl deadlock": https://git.kernel.org/tglx/history/c/0f138bbfd83c The change was made because back then, the kernel's workqueue implementation did not allow waiting for a single work. One had to wait for completion of *all* work by calling flush_scheduled_work(), and that could deadlock when waiting for usbnet_deferred_kevent() with rtnl_mutex held in ->ndo_stop(). The commit solved one problem but created another: It causes a use-after-free in USB Ethernet drivers aqc111.c, asix_devices.c, ax88179_178a.c, ch9200.c and smsc75xx.c: * If the drivers receive a link change interrupt immediately before disconnect, they raise EVENT_LINK_RESET in their (non-sleepable) ->status() callback and schedule usbnet_deferred_kevent(). * usbnet_deferred_kevent() invokes the driver's ->link_reset() callback, which calls netif_carrier_{on,off}(). * That in turn schedules the work linkwatch_event(). Because usbnet_deferred_kevent() is awaited after unregister_netdev(), netif_carrier_{on,off}() may operate on an unregistered netdev and linkwatch_event() may run after free_netdev(), causing a use-after-free. In 2010, usbnet was changed to only wait for a single instance of usbnet_deferred_kevent() instead of *all* work by commit 23f333a2bfaf ("drivers/net: don't use flush_scheduled_work()"). Unfortunately the commit neglected to move the wait back to ->ndo_stop(). Rectify that omission at long last.

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.