{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2025-40343",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2025-04-16T07:20:57.187Z",
        "datePublished": "2025-12-09T04:10:00.973Z",
        "dateUpdated": "2026-08-05T12:09:45.994Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T12:09:45.994Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnvmet-fc: avoid scheduling association deletion twice\n\nWhen forcefully shutting down a port via the configfs interface,\nnvmet_port_subsys_drop_link() first calls nvmet_port_del_ctrls() and\nthen nvmet_disable_port(). Both functions will eventually schedule all\nremaining associations for deletion.\n\nThe current implementation checks whether an association is about to be\nremoved, but only after the work item has already been scheduled. As a\nresult, it is possible for the first scheduled work item to free all\nresources, and then for the same work item to be scheduled again for\ndeletion.\n\nBecause the association list is an RCU list, it is not possible to take\na lock and remove the list entry directly, so it cannot be looked up\nagain. Instead, a flag (terminating) must be used to determine whether\nthe association is already in the process of being deleted."
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
                        "baseScore": 9.8,
                        "baseSeverity": "CRITICAL"
                    },
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "AV:N - The vulnerable association-deletion path is driven by FC-NVMe Link Service frames (Create/Disconnect Association) received from a remote host port by the nvmet-fc target, and by remote-controlled events such as keep-alive expiry and fabric logout; like the sibling nvmet-tcp transport, this is remote-peer protocol data, and FC/FCoE fabrics are multi-hop and extendable over FCIP rather than limited to one physical segment.\nAC:L - The attacker controls both racers — it can issue duplicate Disconnect Association LSs concurrently, choose a short KATO so the keep-alive timeout fires on demand, or drop its fabric login — and the window is wide because the first work item sits in `synchronize_rcu()` plus `flush_workqueue()` with `WORK_STRUCT_PENDING` already cleared; the sequence can be retried indefinitely across many associations.\nPR:N - `nvmet_fc_ls_create_association()` and `nvmet_fc_ls_disconnect()` perform no host-NQN or allowed-host validation — the NQN check only occurs later in the NVMe fabrics Connect command — so an unauthenticated host port on the fabric can create and tear down associations; FC zoning is network access control, not a privilege of the vulnerable component.\nUI:N - The attacking host issues the LS frames and controls the timing entirely on its own; no action by an administrator or any other user is required.\nS:U - The use-after-free and double free corrupt kernel slab memory within the same kernel security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - After `kfree(assoc)` the re-queued work re-enters `nvmet_fc_target_assoc_free()`, which reads `association_id`, `hostport`, `rcv_disconn` and `queues[]` from the reclaimed slab object and transmits a Disconnect LS/LS response built from that memory back to the remote host, leaking attacker-reclaimable kernel heap contents and giving attacker-directed reads.\nI:H - The `work_struct` lives inside the freed allocation, so the workqueue writes into reclaimed memory and dispatches through a `work->func` taken from it, and the second `kref_put()` causes a refcount underflow and double free of `assoc`, `hostport` and the queue objects — a control-flow-hijack and arbitrary-free primitive.\nA:H - Even without weaponization, the second execution performs `list_del_rcu` and `spin_lock` on freed memory and double-frees the association, reliably producing list corruption, a KASAN splat, or a kernel panic on the storage target."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "drivers/nvme/target/fc.c"
                    ],
                    "versions": [
                        {
                            "version": "a07b4970f464f13640e28e16dad6cfa33647cc99",
                            "lessThan": "2f4852db87e25d4e226b25cb6f652fef9504360e",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "a07b4970f464f13640e28e16dad6cfa33647cc99",
                            "lessThan": "85e2ce1920cb511d57aae59f0df6ff85b28bf04d",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "a07b4970f464f13640e28e16dad6cfa33647cc99",
                            "lessThan": "601ed47b2363c24d948d7bac0c23abc8bd459570",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "a07b4970f464f13640e28e16dad6cfa33647cc99",
                            "lessThan": "04d17540ef51e2c291eb863ca87fd332259b2d40",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "a07b4970f464f13640e28e16dad6cfa33647cc99",
                            "lessThan": "c09ac9a63fc3aaf4670ad7b5e4f5afd764424154",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "a07b4970f464f13640e28e16dad6cfa33647cc99",
                            "lessThan": "f2537be4f8421f6495edfa0bc284d722f253841d",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "drivers/nvme/target/fc.c"
                    ],
                    "versions": [
                        {
                            "version": "4.8",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "4.8",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.15.197",
                            "lessThanOrEqual": "5.15.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.1.159",
                            "lessThanOrEqual": "6.1.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.6.117",
                            "lessThanOrEqual": "6.6.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.12.58",
                            "lessThanOrEqual": "6.12.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.17.8",
                            "lessThanOrEqual": "6.17.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.18",
                            "lessThanOrEqual": "*",
                            "status": "unaffected",
                            "versionType": "original_commit_for_fix"
                        }
                    ]
                }
            ],
            "cpeApplicability": [
                {
                    "nodes": [
                        {
                            "operator": "OR",
                            "negate": false,
                            "cpeMatch": [
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.8",
                                    "versionEndExcluding": "5.15.197"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.8",
                                    "versionEndExcluding": "6.1.159"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.8",
                                    "versionEndExcluding": "6.6.117"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.8",
                                    "versionEndExcluding": "6.12.58"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.8",
                                    "versionEndExcluding": "6.17.8"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.8",
                                    "versionEndExcluding": "6.18"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/2f4852db87e25d4e226b25cb6f652fef9504360e"
                },
                {
                    "url": "https://git.kernel.org/stable/c/85e2ce1920cb511d57aae59f0df6ff85b28bf04d"
                },
                {
                    "url": "https://git.kernel.org/stable/c/601ed47b2363c24d948d7bac0c23abc8bd459570"
                },
                {
                    "url": "https://git.kernel.org/stable/c/04d17540ef51e2c291eb863ca87fd332259b2d40"
                },
                {
                    "url": "https://git.kernel.org/stable/c/c09ac9a63fc3aaf4670ad7b5e4f5afd764424154"
                },
                {
                    "url": "https://git.kernel.org/stable/c/f2537be4f8421f6495edfa0bc284d722f253841d"
                }
            ],
            "title": "nvmet-fc: avoid scheduling association deletion twice",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        }
    }
}