{"api_version":"1","generated_at":"2026-11-20T07:30:00+00:00","cve":"CVE-2026-99795","urls":{"html":"https://cve.report/CVE-2026-99795","api":"https://cve.report/api/cve/CVE-2026-99795.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-99795","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-99795"},"summary":{"title":"cxl/features: Ensure that count is set before access to ent[] __counted_by()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ncxl/features: Ensure that count is set before access to ent[] __counted_by()\n\nget_supported_features() assigns entries->num_features only after the\nmemcpy() loop that fills entries->ent[] has already run. Since ent[]\nis __counted_by(num_features), the compiler's bounds instrumentation\nsees a 0-length array during that loop and FORTIFY_SOURCE trips on\nthe memcpy. Set @num_features right after allocation, before any\nwrite into ent[], so the bound is correct for the whole lifetime of\nthe array.\n\nThis was found via a fortify panic:\n\n memcpy: detected buffer overflow: 384 byte write of buffer size 0\n WARNING: lib/string_helpers.c:1035 at __fortify_report+0x54/0xa0\n kernel BUG at lib/string_helpers.c:1043!\n Call trace:\n  __fortify_panic+0x10/0x18\n  get_supported_features.isra.0+0x4a0/0x4d0 [cxl_core]\n  devm_cxl_setup_features+0x84/0x120 [cxl_core]\n  cxl_pci_probe+0x254/0x5e0 [cxl_pci]\n\nSame class of bug, same fix shape as commit 6c9d2e87df40\n(\"cxl/fwctl: Fix __fortify_panic\"), which fixed the analogous issue\nin cxlctl_get_supported_features() but missed this one.\n\n[ dj: Fixed up title typo per Jonathan. ]","state":"PUBLISHED","assigner":"Linux","published_at":"2026-11-20 06:18:19","updated_at":"2026-11-20 06:18:19"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/c1031c2474f73261d8d5e4deef2b5dc20fb964f5","name":"https://git.kernel.org/stable/c/c1031c2474f73261d8d5e4deef2b5dc20fb964f5","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/deb8b87c027db150de626a5808f648b1e52d90a1","name":"https://git.kernel.org/stable/c/deb8b87c027db150de626a5808f648b1e52d90a1","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/63714fa4033b51ce615be6f083be0b19847d0d1e","name":"https://git.kernel.org/stable/c/63714fa4033b51ce615be6f083be0b19847d0d1e","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-99795","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99795","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f0e6a2329bf9d44138be2163370ae9537cbdaf74 63714fa4033b51ce615be6f083be0b19847d0d1e git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f0e6a2329bf9d44138be2163370ae9537cbdaf74 deb8b87c027db150de626a5808f648b1e52d90a1 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f0e6a2329bf9d44138be2163370ae9537cbdaf74 c1031c2474f73261d8d5e4deef2b5dc20fb964f5 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 6.15","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.15 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.64 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.5 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["drivers/cxl/core/features.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"63714fa4033b51ce615be6f083be0b19847d0d1e","status":"affected","version":"f0e6a2329bf9d44138be2163370ae9537cbdaf74","versionType":"git"},{"lessThan":"deb8b87c027db150de626a5808f648b1e52d90a1","status":"affected","version":"f0e6a2329bf9d44138be2163370ae9537cbdaf74","versionType":"git"},{"lessThan":"c1031c2474f73261d8d5e4deef2b5dc20fb964f5","status":"affected","version":"f0e6a2329bf9d44138be2163370ae9537cbdaf74","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["drivers/cxl/core/features.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"6.15"},{"lessThan":"6.15","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.64","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.5","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.64","versionStartIncluding":"6.15","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.5","versionStartIncluding":"6.15","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc1","versionStartIncluding":"6.15","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ncxl/features: Ensure that count is set before access to ent[] __counted_by()\n\nget_supported_features() assigns entries->num_features only after the\nmemcpy() loop that fills entries->ent[] has already run. Since ent[]\nis __counted_by(num_features), the compiler's bounds instrumentation\nsees a 0-length array during that loop and FORTIFY_SOURCE trips on\nthe memcpy. Set @num_features right after allocation, before any\nwrite into ent[], so the bound is correct for the whole lifetime of\nthe array.\n\nThis was found via a fortify panic:\n\n memcpy: detected buffer overflow: 384 byte write of buffer size 0\n WARNING: lib/string_helpers.c:1035 at __fortify_report+0x54/0xa0\n kernel BUG at lib/string_helpers.c:1043!\n Call trace:\n  __fortify_panic+0x10/0x18\n  get_supported_features.isra.0+0x4a0/0x4d0 [cxl_core]\n  devm_cxl_setup_features+0x84/0x120 [cxl_core]\n  cxl_pci_probe+0x254/0x5e0 [cxl_pci]\n\nSame class of bug, same fix shape as commit 6c9d2e87df40\n(\"cxl/fwctl: Fix __fortify_panic\"), which fixed the analogous issue\nin cxlctl_get_supported_features() but missed this one.\n\n[ dj: Fixed up title typo per Jonathan. ]"}],"providerMetadata":{"dateUpdated":"2026-11-20T05:51:54.478Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/63714fa4033b51ce615be6f083be0b19847d0d1e"},{"url":"https://git.kernel.org/stable/c/deb8b87c027db150de626a5808f648b1e52d90a1"},{"url":"https://git.kernel.org/stable/c/c1031c2474f73261d8d5e4deef2b5dc20fb964f5"}],"title":"cxl/features: Ensure that count is set before access to ent[] __counted_by()","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-99795","datePublished":"2026-11-20T05:51:54.478Z","dateReserved":"2026-09-25T10:25:14.435Z","dateUpdated":"2026-11-20T05:51:54.478Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-11-20 06:18:19","lastModifiedDate":"2026-11-20 06:18:19","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"99795","Ordinal":"1","Title":"cxl/features: Ensure that count is set before access to ent[] __","CVE":"CVE-2026-99795","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"99795","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\ncxl/features: Ensure that count is set before access to ent[] __counted_by()\n\nget_supported_features() assigns entries->num_features only after the\nmemcpy() loop that fills entries->ent[] has already run. Since ent[]\nis __counted_by(num_features), the compiler's bounds instrumentation\nsees a 0-length array during that loop and FORTIFY_SOURCE trips on\nthe memcpy. Set @num_features right after allocation, before any\nwrite into ent[], so the bound is correct for the whole lifetime of\nthe array.\n\nThis was found via a fortify panic:\n\n memcpy: detected buffer overflow: 384 byte write of buffer size 0\n WARNING: lib/string_helpers.c:1035 at __fortify_report+0x54/0xa0\n kernel BUG at lib/string_helpers.c:1043!\n Call trace:\n  __fortify_panic+0x10/0x18\n  get_supported_features.isra.0+0x4a0/0x4d0 [cxl_core]\n  devm_cxl_setup_features+0x84/0x120 [cxl_core]\n  cxl_pci_probe+0x254/0x5e0 [cxl_pci]\n\nSame class of bug, same fix shape as commit 6c9d2e87df40\n(\"cxl/fwctl: Fix __fortify_panic\"), which fixed the analogous issue\nin cxlctl_get_supported_features() but missed this one.\n\n[ dj: Fixed up title typo per Jonathan. ]","Type":"Description","Title":"cxl/features: Ensure that count is set before access to ent[] __"}]}}}