0263-qla2xxx-prevent-speculative-execution.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Elena Reshetova <[email protected]>
  3. Date: Mon, 4 Sep 2017 13:11:49 +0300
  4. Subject: [PATCH] qla2xxx: prevent speculative execution
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. CVE-2017-5753
  9. CVE-2017-5715
  10. Real commit text tbd
  11. Signed-off-by: Elena Reshetova <[email protected]>
  12. Signed-off-by: Tim Chen <[email protected]>
  13. Signed-off-by: Andy Whitcroft <[email protected]>
  14. Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
  15. (cherry picked from commit d71318e5f16371dbc0e89a786336a521551f8946)
  16. Signed-off-by: Fabian Grünbichler <[email protected]>
  17. ---
  18. drivers/scsi/qla2xxx/qla_mr.c | 12 ++++++++----
  19. 1 file changed, 8 insertions(+), 4 deletions(-)
  20. diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c
  21. index 10b742d27e16..ca923d8803f9 100644
  22. --- a/drivers/scsi/qla2xxx/qla_mr.c
  23. +++ b/drivers/scsi/qla2xxx/qla_mr.c
  24. @@ -2304,10 +2304,12 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
  25. req = ha->req_q_map[que];
  26. /* Validate handle. */
  27. - if (handle < req->num_outstanding_cmds)
  28. + if (handle < req->num_outstanding_cmds) {
  29. + gmb();
  30. sp = req->outstanding_cmds[handle];
  31. - else
  32. + } else {
  33. sp = NULL;
  34. + }
  35. if (sp == NULL) {
  36. ql_dbg(ql_dbg_io, vha, 0x3034,
  37. @@ -2655,10 +2657,12 @@ qlafx00_multistatus_entry(struct scsi_qla_host *vha,
  38. req = ha->req_q_map[que];
  39. /* Validate handle. */
  40. - if (handle < req->num_outstanding_cmds)
  41. + if (handle < req->num_outstanding_cmds) {
  42. + gmb();
  43. sp = req->outstanding_cmds[handle];
  44. - else
  45. + } else {
  46. sp = NULL;
  47. + }
  48. if (sp == NULL) {
  49. ql_dbg(ql_dbg_io, vha, 0x3044,
  50. --
  51. 2.14.2