Commit 9665da2
CKI Backport Bot
scsi: lpfc: Fix buffer free/clear order in deferred receive path
JIRA: https://issues.redhat.com/browse/RHEL-119124
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>1 parent 3e7b609 commit 9665da2
1 file changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1243 | 1243 | | |
1244 | 1244 | | |
1245 | 1245 | | |
1246 | | - | |
| 1246 | + | |
1247 | 1247 | | |
1248 | 1248 | | |
1249 | 1249 | | |
1250 | 1250 | | |
1251 | 1251 | | |
1252 | 1252 | | |
1253 | 1253 | | |
| 1254 | + | |
| 1255 | + | |
1254 | 1256 | | |
| 1257 | + | |
1255 | 1258 | | |
1256 | 1259 | | |
1257 | 1260 | | |
1258 | 1261 | | |
1259 | 1262 | | |
1260 | 1263 | | |
| 1264 | + | |
| 1265 | + | |
1261 | 1266 | | |
1262 | 1267 | | |
1263 | 1268 | | |
1264 | 1269 | | |
1265 | 1270 | | |
1266 | 1271 | | |
1267 | 1272 | | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | 1273 | | |
1272 | 1274 | | |
1273 | 1275 | | |
| |||
0 commit comments