net/mlx5e: Fix HV VHCA stats agent registration race
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ cef35af34d6dc3792333075115c7deb7062b6e18 · < 89b25b5f46f488ea3b29b3444864c76944c9075b| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net/mlx5e: Fix HV VHCA stats agent registration race
mlx5e_hv_vhca_stats_create() registers the stats agent through mlx5_hv_vhca_agent_create(). The helper publishes the agent in hv_vhca->agents[type] under agents_lock and immediately schedules an asynchronous control invalidation on the HV VHCA workqueue before returning to mlx5e.
The asynchronous invalidation invokes the control agent's invalidate callback, which reads the hypervisor control block and forwards the command to mlx5e_hv_vhca_stats_control(). That callback may either:
- call cancel_delayed_work_sync(&priv->stats_agent.work), or - call queue_delayed_work(priv->wq, &sagent->work, sagent->delay).
However, the delayed_work and priv->stats_agent.agent are only initialized after mlx5_hv_vhca_agent_create() returns to mlx5e:
agent = mlx5_hv_vhca_agent_create(...); /* publish + invalidate */ ... priv->stats_agent.agent = agent; /* too late */ INIT_DELAYED_WORK(&priv->stats_agent.work, ...); /* too late */
If the asynchronous control path runs before the two assignments above, it can:
From the CVE record · Linux
A registration race in the Linux kernel's net/mlx5e HV VHCA stats agent can let an asynchronous callback access uninitialized work or a NULL agent pointer, potentially crashing the kernel. The input does not establish an attacker-controlled trigger or specify network or local access, authentication requirements, or user interaction.
Engineers running Linux kernels with the net/mlx5e HV VHCA stats agent should check their builds; affected versions are not specified.