acpi: nfit: fix narrowing conversion in acpi_nfit_ctl
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 6450ddbd5d8e83ea9927c7f9076a21f829699e0f · < 73851cfceb00cc77d7a0851bc10f2263394c3e87| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
acpi: nfit: fix narrowing conversion in acpi_nfit_ctl
Syzkaller has reported a warning in to_nfit_bus_uuid(): "only secondary bus families can be translated". This warning is emited if the argument is equal to NVDIMM_BUS_FAMILY_NFIT == 0. Function acpi_nfit_ctl() first verifies that a user-provided value call_pkg->nd_family of type u64 is not equal to 0. Then the value is converted to int, and only after that is compared to NVDIMM_BUS_FAMILY_MAX. This can lead to passing an invalid argument to acpi_nfit_ctl(), if call_pkg->nd_family is non-zero, while the lower 32 bits are zero.
Furthermore, it is best to return EINVAL immediately upon seeing the invalid user input. The WARNING is insufficient to prevent further undefined behavior based on other invalid user input.
All checks of the input value should be applied to the original variable call_pkg->nd_family.
[iweiny: update commit message]
From the CVE record · Linux
The Linux kernel’s acpi_nfit_ctl() checks a user-provided value before narrowing it to an integer, allowing an invalid value to pass validation. Someone able to provide that input could trigger a warning and potentially further undefined behavior; the input does not specify authentication or user-interaction requirements.
Engineers running Linux kernels with the ACPI NFIT component should check their versions against the vendor advisory; affected versions are not specified.