scsi: lpfc: Fix buffer free/clear order in deferred receive path
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 472e146d1cf3410a898b49834500fa9e33ac41a2 · < 367cb5ffd8a8a4c85dc89f55e7fa7cc191425b11| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
scsi: lpfc: Fix buffer free/clear order in deferred receive path
Fix a use-after-free window by correcting the buffer release sequence in the deferred receive path. The code freed the RQ buffer first and only then cleared the context pointer under the lock. Concurrent paths (e.g., ABTS and the repost path) also inspect and release the same pointer under the lock, so the old order could lead to double-free/UAF.
Note that the repost path already uses the correct pattern: detach the pointer under the lock, then free it after dropping the lock. The deferred path should do the same.
From the CVE record · Linux
The Linux kernel's lpfc deferred receive path can free an RQ buffer before clearing its context pointer. If a concurrent ABTS or repost path accesses that pointer, a double-free or use-after-free can result. The input does not establish whether an attacker can trigger this remotely or locally, or whether authentication or user interaction is required.
Engineers running Linux kernels with the lpfc driver should check their versions; affected versions are not specified.