{"api_version":"1","generated_at":"2026-04-26T00:14:25+00:00","cve":"CVE-2026-31570","urls":{"html":"https://cve.report/CVE-2026-31570","api":"https://cve.report/api/cve/CVE-2026-31570.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-31570","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-31570"},"summary":{"title":"can: gw: fix OOB heap access in cgw_csum_crc8_rel()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ncan: gw: fix OOB heap access in cgw_csum_crc8_rel()\n\ncgw_csum_crc8_rel() correctly computes bounds-safe indices via calc_idx():\n\n    int from = calc_idx(crc8->from_idx, cf->len);\n    int to   = calc_idx(crc8->to_idx,   cf->len);\n    int res  = calc_idx(crc8->result_idx, cf->len);\n\n    if (from < 0 || to < 0 || res < 0)\n        return;\n\nHowever, the loop and the result write then use the raw s8 fields directly\ninstead of the computed variables:\n\n    for (i = crc8->from_idx; ...)        /* BUG: raw negative index */\n    cf->data[crc8->result_idx] = ...;    /* BUG: raw negative index */\n\nWith from_idx = to_idx = result_idx = -64 on a 64-byte CAN FD frame,\ncalc_idx(-64, 64) = 0 so the guard passes, but the loop iterates with\ni = -64, reading cf->data[-64], and the write goes to cf->data[-64].\nThis write might end up to 56 (7.0-rc) or 40 (<= 6.19) bytes before the\nstart of the canfd_frame on the heap.\n\nThe companion function cgw_csum_xor_rel() uses `from`/`to`/`res`\ncorrectly throughout; fix cgw_csum_crc8_rel() to match.\n\nConfirmed with KASAN on linux-7.0-rc2:\n  BUG: KASAN: slab-out-of-bounds in cgw_csum_crc8_rel+0x515/0x5b0\n  Read of size 1 at addr ffff8880076619c8 by task poc_cgw_oob/62\n\nTo configure the can-gw crc8 checksums CAP_NET_ADMIN is needed.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-04-24 15:16:31","updated_at":"2026-04-24 17:51:40"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/c4e8eaa75fa0b6bcbfa5356d6195c4ad0e05e57a","name":"https://git.kernel.org/stable/c/c4e8eaa75fa0b6bcbfa5356d6195c4ad0e05e57a","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/84f8b76d24273175a22713e83e90874e1880d801","name":"https://git.kernel.org/stable/c/84f8b76d24273175a22713e83e90874e1880d801","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/66b689efd08227da2c5ca49b58b30a95d23c695a","name":"https://git.kernel.org/stable/c/66b689efd08227da2c5ca49b58b30a95d23c695a","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/54ecdf76a55e75c1f5085e440f8ab671a3283ef5","name":"https://git.kernel.org/stable/c/54ecdf76a55e75c1f5085e440f8ab671a3283ef5","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/b9c310d72783cc2f30d103eed83920a5a29c671a","name":"https://git.kernel.org/stable/c/b9c310d72783cc2f30d103eed83920a5a29c671a","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/e7c99348b0612b2bc02d5ce6ff9873261cc7605f","name":"https://git.kernel.org/stable/c/e7c99348b0612b2bc02d5ce6ff9873261cc7605f","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/999ca48d55a8a46da21519db7e834e5867200379","name":"https://git.kernel.org/stable/c/999ca48d55a8a46da21519db7e834e5867200379","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/a025283d7f7404c739225e457fb99db2368bb544","name":"https://git.kernel.org/stable/c/a025283d7f7404c739225e457fb99db2368bb544","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-31570","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31570","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 456a8a646b2563438c16a9b27decf9aa717f1ebb e7c99348b0612b2bc02d5ce6ff9873261cc7605f git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 456a8a646b2563438c16a9b27decf9aa717f1ebb 999ca48d55a8a46da21519db7e834e5867200379 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 456a8a646b2563438c16a9b27decf9aa717f1ebb a025283d7f7404c739225e457fb99db2368bb544 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 456a8a646b2563438c16a9b27decf9aa717f1ebb 54ecdf76a55e75c1f5085e440f8ab671a3283ef5 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 456a8a646b2563438c16a9b27decf9aa717f1ebb c4e8eaa75fa0b6bcbfa5356d6195c4ad0e05e57a git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 456a8a646b2563438c16a9b27decf9aa717f1ebb 84f8b76d24273175a22713e83e90874e1880d801 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 456a8a646b2563438c16a9b27decf9aa717f1ebb 66b689efd08227da2c5ca49b58b30a95d23c695a git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 456a8a646b2563438c16a9b27decf9aa717f1ebb b9c310d72783cc2f30d103eed83920a5a29c671a git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 5.4","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.4 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.10.253 5.10.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.15.203 5.15.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.1.168 6.1.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.6.131 6.6.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.12.80 6.12.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.21 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.19.11 6.19.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.0 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":{"cve_year":"2026","cve_id":"31570","cve":"CVE-2026-31570","epss":"0.000240000","percentile":"0.068020000","score_date":"2026-04-25","updated_at":"2026-04-26 00:00:20"},"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["net/can/gw.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"e7c99348b0612b2bc02d5ce6ff9873261cc7605f","status":"affected","version":"456a8a646b2563438c16a9b27decf9aa717f1ebb","versionType":"git"},{"lessThan":"999ca48d55a8a46da21519db7e834e5867200379","status":"affected","version":"456a8a646b2563438c16a9b27decf9aa717f1ebb","versionType":"git"},{"lessThan":"a025283d7f7404c739225e457fb99db2368bb544","status":"affected","version":"456a8a646b2563438c16a9b27decf9aa717f1ebb","versionType":"git"},{"lessThan":"54ecdf76a55e75c1f5085e440f8ab671a3283ef5","status":"affected","version":"456a8a646b2563438c16a9b27decf9aa717f1ebb","versionType":"git"},{"lessThan":"c4e8eaa75fa0b6bcbfa5356d6195c4ad0e05e57a","status":"affected","version":"456a8a646b2563438c16a9b27decf9aa717f1ebb","versionType":"git"},{"lessThan":"84f8b76d24273175a22713e83e90874e1880d801","status":"affected","version":"456a8a646b2563438c16a9b27decf9aa717f1ebb","versionType":"git"},{"lessThan":"66b689efd08227da2c5ca49b58b30a95d23c695a","status":"affected","version":"456a8a646b2563438c16a9b27decf9aa717f1ebb","versionType":"git"},{"lessThan":"b9c310d72783cc2f30d103eed83920a5a29c671a","status":"affected","version":"456a8a646b2563438c16a9b27decf9aa717f1ebb","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["net/can/gw.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"5.4"},{"lessThan":"5.4","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"5.10.*","status":"unaffected","version":"5.10.253","versionType":"semver"},{"lessThanOrEqual":"5.15.*","status":"unaffected","version":"5.15.203","versionType":"semver"},{"lessThanOrEqual":"6.1.*","status":"unaffected","version":"6.1.168","versionType":"semver"},{"lessThanOrEqual":"6.6.*","status":"unaffected","version":"6.6.131","versionType":"semver"},{"lessThanOrEqual":"6.12.*","status":"unaffected","version":"6.12.80","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.21","versionType":"semver"},{"lessThanOrEqual":"6.19.*","status":"unaffected","version":"6.19.11","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.0","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.10.253","versionStartIncluding":"5.4","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.15.203","versionStartIncluding":"5.4","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.1.168","versionStartIncluding":"5.4","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.6.131","versionStartIncluding":"5.4","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.12.80","versionStartIncluding":"5.4","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.21","versionStartIncluding":"5.4","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.19.11","versionStartIncluding":"5.4","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.0","versionStartIncluding":"5.4","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ncan: gw: fix OOB heap access in cgw_csum_crc8_rel()\n\ncgw_csum_crc8_rel() correctly computes bounds-safe indices via calc_idx():\n\n    int from = calc_idx(crc8->from_idx, cf->len);\n    int to   = calc_idx(crc8->to_idx,   cf->len);\n    int res  = calc_idx(crc8->result_idx, cf->len);\n\n    if (from < 0 || to < 0 || res < 0)\n        return;\n\nHowever, the loop and the result write then use the raw s8 fields directly\ninstead of the computed variables:\n\n    for (i = crc8->from_idx; ...)        /* BUG: raw negative index */\n    cf->data[crc8->result_idx] = ...;    /* BUG: raw negative index */\n\nWith from_idx = to_idx = result_idx = -64 on a 64-byte CAN FD frame,\ncalc_idx(-64, 64) = 0 so the guard passes, but the loop iterates with\ni = -64, reading cf->data[-64], and the write goes to cf->data[-64].\nThis write might end up to 56 (7.0-rc) or 40 (<= 6.19) bytes before the\nstart of the canfd_frame on the heap.\n\nThe companion function cgw_csum_xor_rel() uses `from`/`to`/`res`\ncorrectly throughout; fix cgw_csum_crc8_rel() to match.\n\nConfirmed with KASAN on linux-7.0-rc2:\n  BUG: KASAN: slab-out-of-bounds in cgw_csum_crc8_rel+0x515/0x5b0\n  Read of size 1 at addr ffff8880076619c8 by task poc_cgw_oob/62\n\nTo configure the can-gw crc8 checksums CAP_NET_ADMIN is needed."}],"providerMetadata":{"dateUpdated":"2026-04-24T14:35:49.435Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/e7c99348b0612b2bc02d5ce6ff9873261cc7605f"},{"url":"https://git.kernel.org/stable/c/999ca48d55a8a46da21519db7e834e5867200379"},{"url":"https://git.kernel.org/stable/c/a025283d7f7404c739225e457fb99db2368bb544"},{"url":"https://git.kernel.org/stable/c/54ecdf76a55e75c1f5085e440f8ab671a3283ef5"},{"url":"https://git.kernel.org/stable/c/c4e8eaa75fa0b6bcbfa5356d6195c4ad0e05e57a"},{"url":"https://git.kernel.org/stable/c/84f8b76d24273175a22713e83e90874e1880d801"},{"url":"https://git.kernel.org/stable/c/66b689efd08227da2c5ca49b58b30a95d23c695a"},{"url":"https://git.kernel.org/stable/c/b9c310d72783cc2f30d103eed83920a5a29c671a"}],"title":"can: gw: fix OOB heap access in cgw_csum_crc8_rel()","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-31570","datePublished":"2026-04-24T14:35:49.435Z","dateReserved":"2026-03-09T15:48:24.117Z","dateUpdated":"2026-04-24T14:35:49.435Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-04-24 15:16:31","lastModifiedDate":"2026-04-24 17:51:40","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"31570","Ordinal":"1","Title":"can: gw: fix OOB heap access in cgw_csum_crc8_rel()","CVE":"CVE-2026-31570","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"31570","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\ncan: gw: fix OOB heap access in cgw_csum_crc8_rel()\n\ncgw_csum_crc8_rel() correctly computes bounds-safe indices via calc_idx():\n\n    int from = calc_idx(crc8->from_idx, cf->len);\n    int to   = calc_idx(crc8->to_idx,   cf->len);\n    int res  = calc_idx(crc8->result_idx, cf->len);\n\n    if (from < 0 || to < 0 || res < 0)\n        return;\n\nHowever, the loop and the result write then use the raw s8 fields directly\ninstead of the computed variables:\n\n    for (i = crc8->from_idx; ...)        /* BUG: raw negative index */\n    cf->data[crc8->result_idx] = ...;    /* BUG: raw negative index */\n\nWith from_idx = to_idx = result_idx = -64 on a 64-byte CAN FD frame,\ncalc_idx(-64, 64) = 0 so the guard passes, but the loop iterates with\ni = -64, reading cf->data[-64], and the write goes to cf->data[-64].\nThis write might end up to 56 (7.0-rc) or 40 (<= 6.19) bytes before the\nstart of the canfd_frame on the heap.\n\nThe companion function cgw_csum_xor_rel() uses `from`/`to`/`res`\ncorrectly throughout; fix cgw_csum_crc8_rel() to match.\n\nConfirmed with KASAN on linux-7.0-rc2:\n  BUG: KASAN: slab-out-of-bounds in cgw_csum_crc8_rel+0x515/0x5b0\n  Read of size 1 at addr ffff8880076619c8 by task poc_cgw_oob/62\n\nTo configure the can-gw crc8 checksums CAP_NET_ADMIN is needed.","Type":"Description","Title":"can: gw: fix OOB heap access in cgw_csum_crc8_rel()"}]}}}