GCVE Workshop - 22 September 2026 (14:00-18:00), Luxembourg Before The Vulnopticon Conference - Registration

FKIE_CVE-2026-89974

Vulnerability from fkie_nvd - Published: 2026-09-16 11:17 - Updated: 2026-09-16 15:18
Summary
In the Linux kernel, the following vulnerability has been resolved: nvme-fc: fix double free of fabrics options when nvme_add_ctrl() fails nvmf_create_ctrl() owns the fabrics options and frees them whenever ->create_ctrl() returns an error, so a transport must not free them on its own error paths. nvme-fc tracks this by testing ctrl->ctrl.opts in nvme_fc_ctrl_free(), which requires nvme_fc_init_ctrl() to clear that pointer on every error exit. The coupling is implicit, and commit 1a9e218195a5 ("nvme: split device add from initialization") broke it by adding a second error exit. When nvme_add_ctrl() fails, nvme_fc_init_ctrl() jumps to out_put_ctrl:, past the "ctrl->ctrl.opts = NULL" that only sits on the fail_ctrl: path, so nvme_fc_ctrl_free() frees the options and nvmf_create_ctrl() frees them a second time: BUG: KASAN: slab-use-after-free in nvmf_free_options+0x30/0x190 nvmf_free_options+0x30/0x190 drivers/nvme/host/fabrics.c:1284 nvmf_create_ctrl drivers/nvme/host/fabrics.c:1374 [inline] Freed by task 5534: nvme_fc_ctrl_free drivers/nvme/host/fc.c:2374 [inline] nvme_fc_init_ctrl+0xe17/0x1450 drivers/nvme/host/fc.c:3605 nvme_add_ctrl() fails when dev_set_name() cannot allocate, so this is reachable under memory pressure or fault injection. Without KASAN the options are freed twice. Rather than clear the pointer on the second exit as well, derive ownership the way nvme-tcp, nvme-rdma and nvme-loop do, from list membership: their free_ctrl leaves the options alone unless the controller made it onto the transport list. The list cannot simply be populated on the success path as it is there. nvme-fc runs the initial connect synchronously via flush_delayed_work(), and the controller has to be reachable on rport->ctrl_list for the whole of it: nvme_fc_unregister_remoteport() needs to find it to signal connectivity loss, nvme_fc_match_disconn_ls() matches an incoming Disconnect Association LS against ctrl->association_id, which is only assigned during that window, nvme_fc_resume_controller() needs it on remoteport re-registration, and nvme_fc_existing_controller() uses it to reject a duplicate connect racing the one in flight. Keep the insertion where it is and add a fail_unlist: label, falling into fail_ctrl:, for the error paths that run after it. The earlier error paths never reach the insertion and keep using fail_ctrl: directly, so the list is only touched where the controller is actually on it. nvme_fc_ctrl_free() cannot use the plain "goto free_ctrl" the other transports use, because it still has to put_device(), release the rport reference and free the ida entry for resources taken before the insertion. Sample list_empty() under rport->lock instead. ctrl->ctrl.opts also stays valid for the whole teardown now. That is not the bug being fixed, but it removes some fragility around the old idiom: nvme_free_ctrl() calls nvme_auth_free() before ->free_ctrl(), and ctrl_max_dhchaps() dereferences ctrl->opts without a NULL check when ctrl->dhchap_ctxs is set, which nvme-fc permits since NVMF_ALLOWED_OPTS allows the dhchap options. The nvme sysfs attributes that dereference ctrl->opts, such as hostnqn and address, evaluate their is_visible() test once at device_add() time and stay readable until cdev_device_del().
Impacted products
Vendor Product Version

{
  "affected": [
    {
      "affectedData": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/nvme/host/fc.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "8bd14aa065112b4d523bea690027c7527a6224f6",
              "status": "affected",
              "version": "1a9e218195a55d0a31e8cbe263aa2f618580ef1d",
              "versionType": "git"
            },
            {
              "lessThan": "7df913a7ced5d7349f0b23bdcf25ad54fe83a1c1",
              "status": "affected",
              "version": "1a9e218195a55d0a31e8cbe263aa2f618580ef1d",
              "versionType": "git"
            },
            {
              "lessThan": "5f89d68c00ccd1b25151da0bf660012380c2bad9",
              "status": "affected",
              "version": "1a9e218195a55d0a31e8cbe263aa2f618580ef1d",
              "versionType": "git"
            },
            {
              "lessThan": "56e6279266f6962bb2d38a54397e3c605165b0c5",
              "status": "affected",
              "version": "1a9e218195a55d0a31e8cbe263aa2f618580ef1d",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/nvme/host/fc.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.11"
            },
            {
              "lessThan": "6.11",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.110",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.18.*",
              "status": "unaffected",
              "version": "6.18.51",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "7.2.*",
              "status": "unaffected",
              "version": "7.2.5",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "7.3-rc2",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    }
  ],
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnvme-fc: fix double free of fabrics options when nvme_add_ctrl() fails\n\nnvmf_create_ctrl() owns the fabrics options and frees them whenever\n-\u003ecreate_ctrl() returns an error, so a transport must not free them on\nits own error paths.  nvme-fc tracks this by testing ctrl-\u003ectrl.opts in\nnvme_fc_ctrl_free(), which requires nvme_fc_init_ctrl() to clear that\npointer on every error exit.\n\nThe coupling is implicit, and commit 1a9e218195a5 (\"nvme: split device\nadd from initialization\") broke it by adding a second error exit.  When\nnvme_add_ctrl() fails, nvme_fc_init_ctrl() jumps to out_put_ctrl:, past\nthe \"ctrl-\u003ectrl.opts = NULL\" that only sits on the fail_ctrl: path, so\nnvme_fc_ctrl_free() frees the options and nvmf_create_ctrl() frees them\na second time:\n\n  BUG: KASAN: slab-use-after-free in nvmf_free_options+0x30/0x190\n   nvmf_free_options+0x30/0x190 drivers/nvme/host/fabrics.c:1284\n   nvmf_create_ctrl drivers/nvme/host/fabrics.c:1374 [inline]\n  Freed by task 5534:\n   nvme_fc_ctrl_free drivers/nvme/host/fc.c:2374 [inline]\n   nvme_fc_init_ctrl+0xe17/0x1450 drivers/nvme/host/fc.c:3605\n\nnvme_add_ctrl() fails when dev_set_name() cannot allocate, so this is\nreachable under memory pressure or fault injection.  Without KASAN the\noptions are freed twice.\n\nRather than clear the pointer on the second exit as well, derive\nownership the way nvme-tcp, nvme-rdma and nvme-loop do, from list\nmembership: their free_ctrl leaves the options alone unless the\ncontroller made it onto the transport list.\n\nThe list cannot simply be populated on the success path as it is there.\nnvme-fc runs the initial connect synchronously via flush_delayed_work(),\nand the controller has to be reachable on rport-\u003ectrl_list for the whole\nof it: nvme_fc_unregister_remoteport() needs to find it to signal\nconnectivity loss, nvme_fc_match_disconn_ls() matches an incoming\nDisconnect Association LS against ctrl-\u003eassociation_id, which is only\nassigned during that window, nvme_fc_resume_controller() needs it on\nremoteport re-registration, and nvme_fc_existing_controller() uses it to\nreject a duplicate connect racing the one in flight.\n\nKeep the insertion where it is and add a fail_unlist: label, falling\ninto fail_ctrl:, for the error paths that run after it.  The earlier\nerror paths never reach the insertion and keep using fail_ctrl:\ndirectly, so the list is only touched where the controller is actually\non it.\n\nnvme_fc_ctrl_free() cannot use the plain \"goto free_ctrl\" the other\ntransports use, because it still has to put_device(), release the rport\nreference and free the ida entry for resources taken before the\ninsertion.  Sample list_empty() under rport-\u003elock instead.\n\nctrl-\u003ectrl.opts also stays valid for the whole teardown now.  That is\nnot the bug being fixed, but it removes some fragility around the old\nidiom: nvme_free_ctrl() calls nvme_auth_free() before -\u003efree_ctrl(), and\nctrl_max_dhchaps() dereferences ctrl-\u003eopts without a NULL check when\nctrl-\u003edhchap_ctxs is set, which nvme-fc permits since NVMF_ALLOWED_OPTS\nallows the dhchap options.  The nvme sysfs attributes that dereference\nctrl-\u003eopts, such as hostnqn and address, evaluate their is_visible()\ntest once at device_add() time and stay readable until\ncdev_device_del()."
    }
  ],
  "id": "CVE-2026-89974",
  "lastModified": "2026-09-16T15:18:21.897",
  "metrics": {
    "cvssMetricV31": [
      {
        "cvssData": {
          "attackComplexity": "HIGH",
          "attackVector": "ADJACENT_NETWORK",
          "availabilityImpact": "HIGH",
          "baseScore": 7.5,
          "baseSeverity": "HIGH",
          "confidentialityImpact": "HIGH",
          "integrityImpact": "HIGH",
          "privilegesRequired": "NONE",
          "scope": "UNCHANGED",
          "userInteraction": "NONE",
          "vectorString": "CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H",
          "version": "3.1"
        },
        "exploitabilityScore": 1.6,
        "impactScore": 5.9,
        "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "type": "Secondary"
      }
    ]
  },
  "published": "2026-09-16T11:17:08.200",
  "references": [
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "url": "https://git.kernel.org/stable/c/56e6279266f6962bb2d38a54397e3c605165b0c5"
    },
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "url": "https://git.kernel.org/stable/c/5f89d68c00ccd1b25151da0bf660012380c2bad9"
    },
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "url": "https://git.kernel.org/stable/c/7df913a7ced5d7349f0b23bdcf25ad54fe83a1c1"
    },
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "url": "https://git.kernel.org/stable/c/8bd14aa065112b4d523bea690027c7527a6224f6"
    }
  ],
  "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
  "vulnStatus": "Received"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…