CVE-2022-49159 (GCVE-0-2022-49159)
Vulnerability from cvelistv5
Published
2025-02-26 01:55
Modified
2026-08-12 23:58
Summary
In the Linux kernel, the following vulnerability has been resolved: scsi: qla2xxx: Implement ref count for SRB The timeout handler and the done function are racing. When qla2x00_async_iocb_timeout() starts to run it can be preempted by the normal response path (via the firmware?). qla24xx_async_gpsc_sp_done() releases the SRB unconditionally. When scheduling back to qla2x00_async_iocb_timeout() qla24xx_async_abort_cmd() will access an freed sp->qpair pointer: qla2xxx [0000:83:00.0]-2871:0: Async-gpsc timeout - hdl=63d portid=234500 50:06:0e:80:08:77:b6:21. qla2xxx [0000:83:00.0]-2853:0: Async done-gpsc res 0, WWPN 50:06:0e:80:08:77:b6:21 qla2xxx [0000:83:00.0]-2854:0: Async-gpsc OUT WWPN 20:45:00:27:f8:75:33:00 speeds=2c00 speed=0400. qla2xxx [0000:83:00.0]-28d8:0: qla24xx_handle_gpsc_event 50:06:0e:80:08:77:b6:21 DS 7 LS 6 rc 0 login 1|1 rscn 1|0 lid 5 BUG: unable to handle kernel NULL pointer dereference at 0000000000000004 IP: qla24xx_async_abort_cmd+0x1b/0x1c0 [qla2xxx] Obvious solution to this is to introduce a reference counter. One reference is taken for the normal code path (the 'good' case) and one for the timeout path. As we always race between the normal good case and the timeout/abort handler we need to serialize it. Also we cannot assume any order between the handlers. Since this is slow path we can use proper synchronization via locks. When we are able to cancel a timer (del_timer returns 1) we know there can't be any error handling in progress because the timeout handler hasn't expired yet, thus we can safely decrement the refcounter by one. If we are not able to cancel the timer, we know an abort handler is running. We have to make sure we call sp->done() in the abort handlers before calling kref_put().
Impacted products
Vendor Product Version
Linux Linux Version: ac280b670e6d6666667aba02324e2fc50bd96ae7
Version: ac280b670e6d6666667aba02324e2fc50bd96ae7
Version: ac280b670e6d6666667aba02324e2fc50bd96ae7
Version: ac280b670e6d6666667aba02324e2fc50bd96ae7
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/scsi/qla2xxx/qla_bsg.c",
            "drivers/scsi/qla2xxx/qla_def.h",
            "drivers/scsi/qla2xxx/qla_edif.c",
            "drivers/scsi/qla2xxx/qla_gbl.h",
            "drivers/scsi/qla2xxx/qla_gs.c",
            "drivers/scsi/qla2xxx/qla_init.c",
            "drivers/scsi/qla2xxx/qla_inline.h",
            "drivers/scsi/qla2xxx/qla_iocb.c",
            "drivers/scsi/qla2xxx/qla_mbx.c",
            "drivers/scsi/qla2xxx/qla_mid.c",
            "drivers/scsi/qla2xxx/qla_mr.c",
            "drivers/scsi/qla2xxx/qla_os.c",
            "drivers/scsi/qla2xxx/qla_target.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "e17111dd2fda81c35f309b1e5b6ab35809a375e7",
              "status": "affected",
              "version": "ac280b670e6d6666667aba02324e2fc50bd96ae7",
              "versionType": "git"
            },
            {
              "lessThan": "e140723f78ff418c8df7d990e102e07b65c87d4a",
              "status": "affected",
              "version": "ac280b670e6d6666667aba02324e2fc50bd96ae7",
              "versionType": "git"
            },
            {
              "lessThan": "ceda7f794f3dfe272491e93e3e93049f8be5f07b",
              "status": "affected",
              "version": "ac280b670e6d6666667aba02324e2fc50bd96ae7",
              "versionType": "git"
            },
            {
              "lessThan": "31e6cdbe0eae37badceb5e0d4f06cf051432fd77",
              "status": "affected",
              "version": "ac280b670e6d6666667aba02324e2fc50bd96ae7",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/scsi/qla2xxx/qla_bsg.c",
            "drivers/scsi/qla2xxx/qla_def.h",
            "drivers/scsi/qla2xxx/qla_edif.c",
            "drivers/scsi/qla2xxx/qla_gbl.h",
            "drivers/scsi/qla2xxx/qla_gs.c",
            "drivers/scsi/qla2xxx/qla_init.c",
            "drivers/scsi/qla2xxx/qla_inline.h",
            "drivers/scsi/qla2xxx/qla_iocb.c",
            "drivers/scsi/qla2xxx/qla_mbx.c",
            "drivers/scsi/qla2xxx/qla_mid.c",
            "drivers/scsi/qla2xxx/qla_mr.c",
            "drivers/scsi/qla2xxx/qla_os.c",
            "drivers/scsi/qla2xxx/qla_target.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "2.6.32"
            },
            {
              "lessThan": "2.6.32",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.33",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.16.*",
              "status": "unaffected",
              "version": "5.16.19",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.17.*",
              "status": "unaffected",
              "version": "5.17.2",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "5.18",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.33",
                  "versionStartIncluding": "2.6.32",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.16.19",
                  "versionStartIncluding": "2.6.32",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.17.2",
                  "versionStartIncluding": "2.6.32",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.18",
                  "versionStartIncluding": "2.6.32",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: qla2xxx: Implement ref count for SRB\n\nThe timeout handler and the done function are racing. When\nqla2x00_async_iocb_timeout() starts to run it can be preempted by the\nnormal response path (via the firmware?). qla24xx_async_gpsc_sp_done()\nreleases the SRB unconditionally. When scheduling back to\nqla2x00_async_iocb_timeout() qla24xx_async_abort_cmd() will access an freed\nsp-\u003eqpair pointer:\n\n  qla2xxx [0000:83:00.0]-2871:0: Async-gpsc timeout - hdl=63d portid=234500 50:06:0e:80:08:77:b6:21.\n  qla2xxx [0000:83:00.0]-2853:0: Async done-gpsc res 0, WWPN 50:06:0e:80:08:77:b6:21\n  qla2xxx [0000:83:00.0]-2854:0: Async-gpsc OUT WWPN 20:45:00:27:f8:75:33:00 speeds=2c00 speed=0400.\n  qla2xxx [0000:83:00.0]-28d8:0: qla24xx_handle_gpsc_event 50:06:0e:80:08:77:b6:21 DS 7 LS 6 rc 0 login 1|1 rscn 1|0 lid 5\n  BUG: unable to handle kernel NULL pointer dereference at 0000000000000004\n  IP: qla24xx_async_abort_cmd+0x1b/0x1c0 [qla2xxx]\n\nObvious solution to this is to introduce a reference counter. One reference\nis taken for the normal code path (the \u0027good\u0027 case) and one for the timeout\npath. As we always race between the normal good case and the timeout/abort\nhandler we need to serialize it. Also we cannot assume any order between\nthe handlers. Since this is slow path we can use proper synchronization via\nlocks.\n\nWhen we are able to cancel a timer (del_timer returns 1) we know there\ncan\u0027t be any error handling in progress because the timeout handler hasn\u0027t\nexpired yet, thus we can safely decrement the refcounter by one.\n\nIf we are not able to cancel the timer, we know an abort handler is\nrunning. We have to make sure we call sp-\u003edone() in the abort handlers\nbefore calling kref_put()."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 8.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:A - qla2xxx is a Fibre Channel HBA driver; the race is on async fabric CT commands such as GPSC to the management server, which a peer on the same SAN fabric can stall and complete. FC is a non-routable fabric, so Adjacent is the highest defensible vector.\nAC:L - A fabric peer controls response timing for CT/SNS queries and can delay replies until the async timer fires, then complete them so the timeout and done paths overlap. The attacker therefore drives both sides of the race rather than relying on an uncontrollable condition.\nPR:N - GPSC and related async discovery IOCBs are issued by the host driver during fabric login/RSCN handling and are driven by FC link and management-server behavior, with no Linux credentials or capabilities required on the victim host.\nUI:N - Normal fabric discovery and port registration automatically post GPSC work and arm the async timer; no user action such as mounting or opening a device is required.\nS:U - Impact remains within the host kernel authority that owns the qla2xxx driver (SRB use-after-free and crash); this is not a VM escape, IOMMU bypass, or other cross-boundary scope change.\nC:H - The done path frees the SRB back to a mempool while the timeout handler still holds a dangling pointer\u2014a use-after-free that can be leveraged for arbitrary kernel memory disclosure via heap reuse.\nI:H - The same mempool-backed SRB use-after-free enables heap spraying and control-flow/integrity compromise once the freed object is reclaimed, not merely a clean failure path.\nA:H - The reported BUG (NULL pointer dereference in qla24xx_async_abort_cmd after the GPSC SRB was freed) is a kernel oops/panic, and any UAF on this path reliably destabilizes the host."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-12T23:58:07.027Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/e17111dd2fda81c35f309b1e5b6ab35809a375e7"
        },
        {
          "url": "https://git.kernel.org/stable/c/e140723f78ff418c8df7d990e102e07b65c87d4a"
        },
        {
          "url": "https://git.kernel.org/stable/c/ceda7f794f3dfe272491e93e3e93049f8be5f07b"
        },
        {
          "url": "https://git.kernel.org/stable/c/31e6cdbe0eae37badceb5e0d4f06cf051432fd77"
        }
      ],
      "title": "scsi: qla2xxx: Implement ref count for SRB",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2022-49159",
    "datePublished": "2025-02-26T01:55:22.021Z",
    "dateReserved": "2025-02-26T01:49:39.276Z",
    "dateUpdated": "2026-08-12T23:58:07.027Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…