uacce: ensure safe queue release with state management
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 015d239ac0142ad0e26567fd890ef8d171f13709 · < 92e4f11e29b98ef424ff72d6371acac03e5d973c| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
uacce: ensure safe queue release with state management
Directly calling `put_queue` carries risks since it cannot guarantee that resources of `uacce_queue` have been fully released beforehand. So adding a `stop_queue` operation for the UACCE_CMD_PUT_Q command and leaving the `put_queue` operation to the final resource release ensures safety.
Queue states are defined as follows: - UACCE_Q_ZOMBIE: Initial state - UACCE_Q_INIT: After opening `uacce` - UACCE_Q_STARTED: After `start` is issued via `ioctl`
When executing `poweroff -f` in virt while accelerator are still working, `uacce_fops_release` and `uacce_remove` may execute concurrently. This can cause `uacce_put_queue` within `uacce_fops_release` to access a NULL `ops` pointer. Therefore, add state checks to prevent accessing freed pointers.
From the CVE record · Linux
The Linux kernel's uacce queue release can access a NULL operations pointer if queue release and device removal run concurrently. This can occur when `poweroff -f` runs in a virtualized environment while accelerators are still working; the input does not establish an attacker path or authentication requirements.
Engineers running Linux kernels with uacce and active accelerators should check their deployments; affected versions are not specified.