Commit 1383ecf
committed
Merge: CVE-2025-39841: scsi: lpfc: Fix buffer free/clear order in deferred receive path
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7444
JIRA: https://issues.redhat.com/browse/RHEL-119116
CVE: CVE-2025-39841
```
commit 9dba9a4
Author: John Evans <evans1210144@gmail.com>
Date: Thu Aug 28 12:40:08 2025 +0800
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.
Fixes: 472e146 ("scsi: lpfc: Correct upcalling nvmet_fc transport during io done downcall")
Cc: stable@vger.kernel.org
Signed-off-by: John Evans <evans1210144@gmail.com>
Link: https://lore.kernel.org/r/20250828044008.743-1-evans1210144@gmail.com
Reviewed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
```
Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>
---
<small>Created 2025-10-03 12:02 UTC by backporter - [KWF FAQ](https://red.ht/kernel_workflow_doc) - [Slack #team-kernel-workflow](https://redhat-internal.slack.com/archives/C04LRUPMJQ5) - [Source](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/webhook/utils/backporter.py) - [Documentation](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/docs/README.backporter.md) - [Report an issue](https://issues.redhat.com/secure/CreateIssueDetails!init.jspa?pid=12334433&issuetype=1&priority=4&summary=backporter+webhook+issue&components=kernel-workflow+/+backporter)</small>
Approved-by: Ewan D. Milne <emilne@redhat.com>
Approved-by: Chris Leech <cleech@redhat.com>
Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com>
Merged-by: Patrick Talbert <ptalbert@redhat.com>1 file changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1245 | 1245 | | |
1246 | 1246 | | |
1247 | 1247 | | |
1248 | | - | |
| 1248 | + | |
1249 | 1249 | | |
1250 | 1250 | | |
1251 | 1251 | | |
1252 | 1252 | | |
1253 | 1253 | | |
1254 | 1254 | | |
1255 | 1255 | | |
| 1256 | + | |
| 1257 | + | |
1256 | 1258 | | |
| 1259 | + | |
1257 | 1260 | | |
1258 | 1261 | | |
1259 | 1262 | | |
1260 | 1263 | | |
1261 | 1264 | | |
1262 | 1265 | | |
| 1266 | + | |
| 1267 | + | |
1263 | 1268 | | |
1264 | 1269 | | |
1265 | 1270 | | |
1266 | 1271 | | |
1267 | 1272 | | |
1268 | 1273 | | |
1269 | 1274 | | |
1270 | | - | |
1271 | | - | |
1272 | | - | |
1273 | 1275 | | |
1274 | 1276 | | |
1275 | 1277 | | |
| |||
0 commit comments