vfio/mlx5: Fix racy bitfields and tighten struct layout
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 61a2f1460fd03285ea34c1a235f2f50f71e13a1f · < f2365a63b02ddea32e7db78b742c2503ec7b81f1| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
vfio/mlx5: Fix racy bitfields and tighten struct layout
Bitfield operations are not atomic, they use a read-modify-write pattern, therefore we should be careful not to pack bitfields that can be concurrently updated into the same storage unit.
This split takes a binary approach: flags that are only modified pre/post open/close remain bitfields, flags modified from user action, including actions that reach across to another device (ex. reset) use dedicated storage units.
Note mlx5_vhca_page_tracker.status is relocated to fill the alignment hole this split exposes.
Bitfield justifications:
migrate_cap: written only in mlx5vf_cmd_set_migratable() at probe chunk_mode: written only in mlx5vf_cmd_set_migratable() at probe mig_state_cap: written only in mlx5vf_cmd_set_migratable() at probe
Dedicated storage units:
From the CVE record · Linux
The Linux kernel's vfio/mlx5 component packs flags that can be updated concurrently into bitfields, even though bitfield updates are not atomic. This can cause a race during runtime operations, including actions initiated by a user; the input does not specify an attacker outcome, access requirements, or whether interaction is needed.
Engineers running Linux kernels with the vfio/mlx5 component should check their deployments; affected versions are not specified.