Lucene search

K
cvelistLinuxCVELIST:CVE-2024-37021
HistoryJun 24, 2024 - 1:56 p.m.

CVE-2024-37021 fpga: manager: add owner module and take its refcount

2024-06-2413:56:52
Linux
www.cve.org
3
linux kernel
vulnerability
cve-2024-37021
fpga manager
owner module
refcount
documentation
low-level module
parent device
driver
null pointer
dereference
compatibility
code clarity

0.0004 Low

EPSS

Percentile

15.7%

In the Linux kernel, the following vulnerability has been resolved:

fpga: manager: add owner module and take its refcount

The current implementation of the fpga manager assumes that the low-level
module registers a driver for the parent device and uses its owner pointer
to take the module’s refcount. This approach is problematic since it can
lead to a null pointer dereference while attempting to get the manager if
the parent device does not have a driver.

To address this problem, add a module owner pointer to the fpga_manager
struct and use it to take the module’s refcount. Modify the functions for
registering the manager to take an additional owner module parameter and
rename them to avoid conflicts. Use the old function names for helper
macros that automatically set the module that registers the manager as the
owner. This ensures compatibility with existing low-level control modules
and reduces the chances of registering a manager without setting the owner.

Also, update the documentation to keep it consistent with the new interface
for registering an fpga manager.

Other changes: opportunistically move put_device() from __fpga_mgr_get() to
fpga_mgr_get() and of_fpga_mgr_get() to improve code clarity since the
manager device is taken in these functions.

CNA Affected

[
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "unaffected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "Documentation/driver-api/fpga/fpga-mgr.rst",
      "drivers/fpga/fpga-mgr.c",
      "include/linux/fpga/fpga-mgr.h"
    ],
    "versions": [
      {
        "version": "654ba4cc0f3e",
        "lessThan": "2da62a139a62",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "654ba4cc0f3e",
        "lessThan": "62ac496a01c9",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "654ba4cc0f3e",
        "lessThan": "4d4d2d434685",
        "status": "affected",
        "versionType": "git"
      }
    ]
  },
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "affected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "Documentation/driver-api/fpga/fpga-mgr.rst",
      "drivers/fpga/fpga-mgr.c",
      "include/linux/fpga/fpga-mgr.h"
    ],
    "versions": [
      {
        "version": "4.4",
        "status": "affected"
      },
      {
        "version": "0",
        "lessThan": "4.4",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.6.33",
        "lessThanOrEqual": "6.6.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.9.4",
        "lessThanOrEqual": "6.9.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "6.10-rc1",
        "lessThanOrEqual": "*",
        "status": "unaffected",
        "versionType": "original_commit_for_fix"
      }
    ]
  }
]

0.0004 Low

EPSS

Percentile

15.7%

Related for CVELIST:CVE-2024-37021