Vulnerability record
cxl/features: Ensure that count is set before access to ent[] __counted_by()
In the Linux kernel, the following vulnerability has been resolved:
cxl/features: Ensure that count is set before access to ent[] __counted_by()
get_supported_features() assigns entries->num_features only after the memcpy() loop that fills entries->ent[] has already run. Since ent[] is __counted_by(num_features), the compiler's bounds instrumentation sees a 0-length array during that loop and FORTIFY_SOURCE trips on the memcpy. Set @num_features right after allocation, before any write into ent[], so the bound is correct for the whole lifetime of the array.
This was found via a fortify…
Remediation
No fixed version has been published for this vulnerability yet. Check the references below for vendor advisories, workarounds and mitigation guidance.
Sources