nvmet: fix refcount leak in nvmet_sq_create()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.18.407.1.57.2In the Linux kernel, the following vulnerability has been resolved:
nvmet: fix refcount leak in nvmet_sq_create()
In nvmet_sq_create(), a reference on the ctrl is taken via kref_get_unless_zero() before calling nvmet_check_sqid(). If nvmet_check_sqid() fails, the function returns the error directly without releasing the reference, leading to a leak.
Fix this by jumping to the "ctrl_put" label, which already performs the necessary nvmet_ctrl_put(ctrl). This ensures the reference is properly released on this error path.
From the CVE record · Linux
The Linux kernel's nvmet_sq_create() leaks a controller reference when nvmet_check_sqid() fails. The input does not specify whether an attacker can trigger this condition, what access it would require, or whether user interaction is needed.
Engineers running the Linux kernel should check whether their version is affected; affected versions are not specified.