Commit 49d1189
committed
scsi: lpfc: Fix buffer free/clear order in deferred receive path
jira VULN-156034
cve CVE-2025-39841
commit-author John Evans <[email protected]>
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: [email protected]
Signed-off-by: John Evans <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Justin Tee <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
(cherry picked from commit 9dba9a4)
Signed-off-by: Roxana Nicolescu <[email protected]>1 parent 9c93236 commit 49d1189
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