In the Linux kernel, the following vulnerability has been resolved:
acpi: nfit: fix narrowing conversion in acpinfitctl
Syzkaller has reported a warning in tonfitbusuuid(): "only secondary bus families can be translated". This warning is emited if the argument is equal to NVDIMMBUSFAMILYNFIT == 0. Function acpinfitctl() first verifies that a user-provided value callpkg->ndfamily of type u64 is not equal to 0. Then the value is converted to int, and only after that is compared to NVDIMMBUSFAMILYMAX. This can lead to passing an invalid argument to acpinfitctl(), if callpkg->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 callpkg->ndfamily.
[iweiny: update commit message]