{"id":"CVE-2026-139052","state":"PUBLISHED","title":"mtd: spi-nor: sfdp: check the length of the SCCR map","description":"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.","publishedAt":"2026-11-30T13:27:25.270Z","updatedAt":"2026-11-30T13:27:25.270Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"7ab8b810757a32b083c75a61b5638bca82e17a4c","status":"affected","lessThan":"b833b44e8b8c2f8e999eef2158982344e3cfcf30","versionType":"git"},{"version":"7ab8b810757a32b083c75a61b5638bca82e17a4c","status":"affected","lessThan":"2d03759ef4ad9c7294bb6f0b49eff71d6958e833","versionType":"git"},{"version":"7ab8b810757a32b083c75a61b5638bca82e17a4c","status":"affected","lessThan":"7317c31a54bb84decb5b25d1bc03b11e0f63af6a","versionType":"git"},{"version":"7ab8b810757a32b083c75a61b5638bca82e17a4c","status":"affected","lessThan":"db4a2da55ca42156acc2f53a5055f7282f2775d4","versionType":"git"},{"version":"7ab8b810757a32b083c75a61b5638bca82e17a4c","status":"affected","lessThan":"1413f38f37194673502e61cd3749e091c031370b","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/mtd/spi-nor/sfdp.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.4","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.4","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.117","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.63","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.4","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/mtd/spi-nor/sfdp.c"]}],"references":["https://git.kernel.org/stable/c/b833b44e8b8c2f8e999eef2158982344e3cfcf30","https://git.kernel.org/stable/c/2d03759ef4ad9c7294bb6f0b49eff71d6958e833","https://git.kernel.org/stable/c/7317c31a54bb84decb5b25d1bc03b11e0f63af6a","https://git.kernel.org/stable/c/db4a2da55ca42156acc2f53a5055f7282f2775d4","https://git.kernel.org/stable/c/1413f38f37194673502e61cd3749e091c031370b"],"weaknesses":[],"ingestedAt":"2026-11-30T13:42:04.437Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139052.json","commit":"5317bbbde1916a58cb1fadabb726eb126daf44c1","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139052","state":"PUBLISHED","datePublished":"2026-11-30T13:27:25.270Z","dateUpdated":"2026-11-30T13:27:25.270Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.911Z"},"containers":{"cna":{"title":"mtd: spi-nor: sfdp: check the length of the SCCR map","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"7ab8b810757a32b083c75a61b5638bca82e17a4c","status":"affected","lessThan":"b833b44e8b8c2f8e999eef2158982344e3cfcf30","versionType":"git"},{"version":"7ab8b810757a32b083c75a61b5638bca82e17a4c","status":"affected","lessThan":"2d03759ef4ad9c7294bb6f0b49eff71d6958e833","versionType":"git"},{"version":"7ab8b810757a32b083c75a61b5638bca82e17a4c","status":"affected","lessThan":"7317c31a54bb84decb5b25d1bc03b11e0f63af6a","versionType":"git"},{"version":"7ab8b810757a32b083c75a61b5638bca82e17a4c","status":"affected","lessThan":"db4a2da55ca42156acc2f53a5055f7282f2775d4","versionType":"git"},{"version":"7ab8b810757a32b083c75a61b5638bca82e17a4c","status":"affected","lessThan":"1413f38f37194673502e61cd3749e091c031370b","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/mtd/spi-nor/sfdp.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.4","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.4","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.117","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.63","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.4","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/mtd/spi-nor/sfdp.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/b833b44e8b8c2f8e999eef2158982344e3cfcf30"},{"url":"https://git.kernel.org/stable/c/2d03759ef4ad9c7294bb6f0b49eff71d6958e833"},{"url":"https://git.kernel.org/stable/c/7317c31a54bb84decb5b25d1bc03b11e0f63af6a"},{"url":"https://git.kernel.org/stable/c/db4a2da55ca42156acc2f53a5055f7282f2775d4"},{"url":"https://git.kernel.org/stable/c/1413f38f37194673502e61cd3749e091c031370b"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:27:25.270Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"6.12.117"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"6.18.63"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"7.3.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.4","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}