Commit 7c51a90
committed
scsi: lpfc: Fix buffer free/clear order in deferred receive path
jira VULN-156029
cve CVE-2025-39841
commit-author John Evans <evans1210144@gmail.com>
commit 9dba9a4
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>
(cherry picked from commit 9dba9a4)
Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>1 parent c17a9df commit 7c51a90
1 file changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1241 | 1241 | | |
1242 | 1242 | | |
1243 | 1243 | | |
1244 | | - | |
| 1244 | + | |
1245 | 1245 | | |
1246 | 1246 | | |
1247 | 1247 | | |
1248 | 1248 | | |
1249 | 1249 | | |
1250 | 1250 | | |
1251 | 1251 | | |
| 1252 | + | |
| 1253 | + | |
1252 | 1254 | | |
| 1255 | + | |
1253 | 1256 | | |
1254 | 1257 | | |
1255 | 1258 | | |
1256 | 1259 | | |
1257 | 1260 | | |
1258 | 1261 | | |
| 1262 | + | |
| 1263 | + | |
1259 | 1264 | | |
1260 | 1265 | | |
1261 | 1266 | | |
1262 | 1267 | | |
1263 | 1268 | | |
1264 | 1269 | | |
1265 | 1270 | | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
1269 | 1271 | | |
1270 | 1272 | | |
1271 | 1273 | | |
| |||
0 commit comments