{"id":"CVE-2026-139052","aliases":["CVE-2026-139052"],"related":[],"kind":"vulnerability","state":"published","title":"mtd: spi-nor: sfdp: check the length of the SCCR map","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmtd: spi-nor: sfdp: check the length of the SCCR map\n\nThe spi_nor_parse_sccr() sizes its buffer from the table length the\nflash reports in the SFDP parameter header. But it then reads DWORD1\nand DWORD22 without ever checking the table is that long.\n\nSo if a flash reports a length of one, the buffer is only four bytes\nwhile DWORD22 sits at byte offset 84. With a length of zero kmalloc()\nreturns ZERO_SIZE_PTR rather than an error, so the NULL check doesn't\ncatch it and the first read dereferences it.\n\nTo fix this, reject a table that's too short for the highest DWORD the\nparser reads, the way spi_nor_parse_4bait() already does. The table is\noptional, so this isn't fatal. The spi_nor_parse_sfdp() warns and\ncarries on.\n\nThe spi_nor_parse_sccr_mc() doesn't need the same check. It works out\nthe number of dice from the length it allocated with, so its highest\nindex stays inside the buffer.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmtd: spi-nor: sfdp: check the length of the SCCR map\n\nThe spi_nor_parse_sccr() sizes its buffer from the table length the\nflash reports in the SFDP parameter header. But it then reads DWORD1\nand DWORD22 without ever checking the table is that long.\n\nSo if a flash reports a length of one, the buffer is only four bytes\nwhile DWORD22 sits at byte offset 84. With a length of zero kmalloc()\nreturns ZERO_SIZE_PTR rather than an error, so the NULL check doesn't\ncatch it and the first read dereferences it.\n\nTo fix this, reject a table that's too short for the highest DWORD the\nparser reads, the way spi_nor_parse_4bait() already does. The table is\noptional, so this isn't fatal. The spi_nor_parse_sfdp() warns and\ncarries on.\n\nThe spi_nor_parse_sccr_mc() doesn't need the same check. It works out\nthe number of dice from the length it allocated with, so its highest\nindex stays inside the buffer.","source":"cvelist"}],"published":"2026-11-30T13:27:25.270Z","modified":"2026-11-30T14:18:10.850Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"7ab8b810757a32b083c75a61b5638bca82e17a4c","fixed":"b833b44e8b8c2f8e999eef2158982344e3cfcf30","status":"affected"},{"type":"git","introduced":"7ab8b810757a32b083c75a61b5638bca82e17a4c","fixed":"2d03759ef4ad9c7294bb6f0b49eff71d6958e833","status":"affected"},{"type":"git","introduced":"7ab8b810757a32b083c75a61b5638bca82e17a4c","fixed":"7317c31a54bb84decb5b25d1bc03b11e0f63af6a","status":"affected"},{"type":"git","introduced":"7ab8b810757a32b083c75a61b5638bca82e17a4c","fixed":"db4a2da55ca42156acc2f53a5055f7282f2775d4","status":"affected"},{"type":"git","introduced":"7ab8b810757a32b083c75a61b5638bca82e17a4c","fixed":"1413f38f37194673502e61cd3749e091c031370b","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.4","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.4","status":"unaffected"},{"type":"semver","introduced":"6.6.163","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.117","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.63","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.4","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/b833b44e8b8c2f8e999eef2158982344e3cfcf30","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/2d03759ef4ad9c7294bb6f0b49eff71d6958e833","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7317c31a54bb84decb5b25d1bc03b11e0f63af6a","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/db4a2da55ca42156acc2f53a5055f7282f2775d4","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/1413f38f37194673502e61cd3749e091c031370b","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-139052","url":"https://www.cve.org/CVERecord?id=CVE-2026-139052","licence":"CVE Terms of Use","modified":"2026-11-30T13:27:25.270Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-139052","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139052","licence":"Public domain","modified":"2026-11-30T14:18:10.850Z"}],"updatedAt":"2026-11-30T14:32:38.289Z","epss":{"score":0.00209,"percentile":0.11659,"date":"2026-12-01T12:00:22.000Z"}}