CyberSecBulletin
CVE-2022-49073NVD status: Modified

Linux: Out-of-bounds Write

CVE-2022-49073 is a high-severity out-of-bounds write 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 596c7efd69aae94f4b0e91172b075eb197958b99, 55e1465ba79562a191708a40eeae3f8082a209e3, fc629224aa62f23849cae83717932985ac51232d 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 596c7efd69aae94f4b0e91172b075eb197958b99 or 55e1465ba79562a191708a40eeae3f8082a209e3 or fc629224aa62f23849cae83717932985ac51232d or 8a05a6952ecd59aaa62cbdcdaf523ae2c8f436e8, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 4.19.238 or 5.4.189 or 5.10.111 or 5.15.34, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinux28361c403683c2b00d4f5e76045f3ccd299bf99d up to, but not including, 596c7efd69aae94f4b0e91172b075eb197958b99; 28361c403683c2b00d4f5e76045f3ccd299bf99d up to, but not including, 55e1465ba79562a191708a40eeae3f8082a209e3; 28361c403683c2b00d4f5e76045f3ccd299bf99d up to, but not including, fc629224aa62f23849cae83717932985ac51232d; 28361c403683c2b00d4f5e76045f3ccd299bf99d up to, but not including, 8a05a6952ecd59aaa62cbdcdaf523ae2c8f436e8; 28361c403683c2b00d4f5e76045f3ccd299bf99d up to, but not including, 234c0132f76f0676d175757f61b0025191a3d935; 28361c403683c2b00d4f5e76045f3ccd299bf99d up to, but not including, 3a8751c0d4e24129e72dcec0139e99833b13904a; 28361c403683c2b00d4f5e76045f3ccd299bf99d up to, but not including, 7aa8104a554713b685db729e66511b93d989dd6a; 4.18596c7efd69aae94f4b0e91172b075eb197958b99, 55e1465ba79562a191708a40eeae3f8082a209e3, fc629224aa62f23849cae83717932985ac51232d, 8a05a6952ecd59aaa62cbdcdaf523ae2c8f436e8, 234c0132f76f0676d175757f61b0025191a3d935, 3a8751c0d4e24129e72dcec0139e99833b13904a
LinuxLinux Kernel4.18 up to, but not including, 4.19.238; 4.20 up to, but not including, 5.4.189; 5.5 up to, but not including, 5.10.111; 5.11 up to, but not including, 5.15.34; 5.16 up to, but not including, 5.16.20; 5.17 up to, but not including, 5.17.3; 5.184.19.238, 5.4.189, 5.10.111, 5.15.34, 5.16.20, 5.17.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.

Scoring systemScoreSeverityScored by
CVSS 3.17.8HighCNA
CVSS 3.17.8HighNVD

Official description

In the Linux kernel, the following vulnerability has been resolved: ata: sata_dwc_460ex: Fix crash due to OOB write the driver uses libata's "tag" values from in various arrays. Since the mentioned patch bumped the ATA_TAG_INTERNAL to 32, the value of the SATA_DWC_QCMD_MAX needs to account for that. Otherwise ATA_TAG_INTERNAL usage cause similar crashes like this as reported by Tice Rex on the OpenWrt Forum and reproduced (with symbols) here: | BUG: Kernel NULL pointer dereference at 0x00000000 | Faulting instruction address: 0xc03ed4b8 | Oops: Kernel access of bad area, sig: 11 [#1] | BE PAGE_SIZE=4K PowerPC 44x Platform | CPU: 0 PID: 362 Comm: scsi_eh_1 Not tainted 5.4.163 #0 | NIP: c03ed4b8 LR: c03d27e8 CTR: c03ed36c | REGS: cfa59950 TRAP: 0300 Not tainted (5.4.163) | MSR: 00021000 <CE,ME> CR: 42000222 XER: 00000000 | DEAR: 00000000 ESR: 00000000 | GPR00: c03d27e8 cfa59a08 cfa55fe0 00000000 0fa46bc0 [...] | [..] | NIP [c03ed4b8] sata_dwc_qc_issue+0x14c/0x254 | LR [c03d27e8] ata_qc_issue+0x1c8/0x2dc | Call Trace: | [cfa59a08] [c003f4e0] __cancel_work_timer+0x124/0x194 (unreliable) | [cfa59a78] [c03d27e8] ata_qc_issue+0x1c8/0x2dc | [cfa59a98] [c03d2b3c] ata_exec_internal_sg+0x240/0x524 | [cfa59b08] [c03d2e98] ata_exec_internal+0x78/0xe0 | [cfa59b58] [c03d30fc] ata_read_log_page.part.38+0x1dc/0x204 | [cfa59bc8] [c03d324c] ata_identify_page_supported+0x68/0x130 | [...] This is because sata_dwc_dma_xfer_complete() NULLs the dma_pending's next neighbour "chan" (a *dma_chan struct) in this '32' case right here (line ~735): > hsdevp->dma_pending[tag] = SATA_DWC_DMA_PENDING_NONE; Then the next time, a dma gets issued; dma_dwc_xfer_setup() passes the NULL'd hsdevp->chan to the dmaengine_slave_config() which then causes the crash. With this patch, SATA_DWC_QCMD_MAX is now set to ATA_MAX_QUEUE + 1. This avoids the OOB. But please note, there was a worthwhile discussion on what ATA_TAG_INTERNAL and ATA_MAX_QUEUE is. And why there should not be a "fake" 33 command-long queue size. Ideally, the dw driver should account for the ATA_TAG_INTERNAL. In Damien Le Moal's words: "... having looked at the driver, it is a bigger change than just faking a 33rd "tag" that is in fact not a command tag at all." BugLink: https://github.com/openwrt/openwrt/issues/9505

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

The underlying weakness: Out-of-bounds Write

The product writes data past the end, or before the beginning, of the intended buffer.

How developers prevent this class of flaw

  • Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages, such as Ada and C#, typically provide overflow protection, but the protection can be disabled by the programmer. Be wary that a language's interface to native code may still be subject to overflows, even if the language itself is theoretically safe.
  • Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. Examples include the Safe C String Library (SafeStr) by Messier and Viega, and the Strsafe.h library from Microsoft. These libraries provide safer versions of overflow-prone string-handling functions.
  • Use automatic buffer overflow detection mechanisms that are offered by certain compilers or compiler extensions. Examples include: the Microsoft Visual Studio /GS flag, Fedora/Red Hat FORTIFY_SOURCE GCC flag, StackGuard, and ProPolice, which provide various mechanisms including canary-based detection and range/index checking. D3-SFCV (Stack Frame Canary Validation) from D3FEND discusses canary-based detection in detail.

More Out-of-bounds Write vulnerabilities (CWE-787)

Timeline

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

References

Recent Out-of-bounds Write vulnerabilities

Spotted an error? Tell us.