cxl: fix possible null-ptr-deref in cxl_pci_init_afu|adapter() (Linux Linux)

CVE-2022-50244
MEDIUM 5.5

At a glance

Source
NVD
EPSS
EPSS 0.16 % · percentile 6 ()
State
PUBLISHED
Published
Updated
Assigner
Linux
NVD status
Analyzed

Description

In the Linux kernel, the following vulnerability has been resolved: cxl: fix possible null-ptr-deref in cxl_pci_init_afu|adapter() If device_register() fails in cxl_pci_afu|adapter(), the device is not added, device_unregister() can not be called in the error path, otherwise it will cause a null-ptr-deref because of removing not added device. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So split device_unregister() into device_del() and put_device(), then goes to put dev when register fails.

Weaknesses (CWE)

  • CWE-476 — NULL Pointer Dereference

References

Scores

VersionScoreVectorScored by
CVSS 3.1MEDIUM 5.5CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:HNVD · nvd@nist.gov (Primary)

European references

CERT-FR advisories

Affected configurations (NVD CPE)

Affected products

ProductVersions
Linux · Linuxaffected f204e0b8cedd7da1dfcfd05ed6b7692737e24029 < 82e68432668ae75b4c814d160f6987ecb0681273 ; affected f204e0b8cedd7da1dfcfd05ed6b7692737e24029 < 82e5481428faf11c79b9c094dd24a1849bbf64ac ; affected f204e0b8cedd7da1dfcfd05ed6b7692737e24029 < c4b2e35df919d99bbbed033c2fa0b607f9f463b5 ; affected f204e0b8cedd7da1dfcfd05ed6b7692737e24029 < 361412dae1690d4b5df6f92fc943cdc773c95cbc ; affected f204e0b8cedd7da1dfcfd05ed6b7692737e24029 < 0f63c0ddc2ea20d783d29243f4dbe0f9e95dfdec ; affected f204e0b8cedd7da1dfcfd05ed6b7692737e24029 < 22511eefa61db26e12c97dd7ada3071dbdfcb004
Linux · Linuxaffected 3.18 ; unaffected 0 < 3.18 ; unaffected 4.9.337 ≤ 4.9.* ; unaffected 4.14.303 ≤ 4.14.* ; unaffected 4.19.270 ≤ 4.19.* ; unaffected 5.4.229 ≤ 5.4.*

Sources

SourceLicence
CVE List (CVEProject cvelistV5)CVE Program Terms of Use
EPSS (FIRST.org)FIRST — attribution requested
ENISA EUVDENISA — reproduction authorised, source acknowledged
CERT-FR (ANSSI)Licence Ouverte / Etalab 2.0
NVD (NIST) via fkie-cad/nvd-json-data-feedsPublic domain — this product uses data from the NVD API but is not endorsed or certified by the NVD