{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143096","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-12-03T03:10:28.348Z","datePublished":"2026-12-03T09:19:16.667Z","dateUpdated":"2026-12-04T03:29:13.518Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-12-04T03:29:13.518Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nspi: axi-spi-engine: Start the program length at zero\n\nspi_engine_optimize_message() allocates the program with kzalloc_flex(),\nwhich sets the __counted_by() counter \"length\" to the allocated size when\nthe compiler supports __builtin_counted_by_ref(). The program is then\nfilled by spi_engine_program_add_cmd(), which increments \"length\" and\nstores at length - 1, expecting it to start at zero as it did when the\nprogram came from kzalloc().\n\nReset \"length\" after the allocation, since it is a \"usage\" counter, not\na \"total allocation\" counter.\n\nBuild tested ARCH=x86_64 defconfig with CONFIG_SPI_AXI_SPI_ENGINE=m and\nW=1, with GCC 16.2.0."}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The overflow is triggered by a local SPI message, not by bytes from a remote peer. Reading the mode-0444 in_voltage*_raw attribute enters iio_read_channel_info(), ad4030_read_raw(), spi_read(), spi_sync(), and __spi_optimize_message(), which calls spi_engine_optimize_message().\nAC:L - kzalloc_flex() sets spi_engine_program.length to the allocation count, and spi_engine_program_add_cmd() then writes instructions[length] on every message. A local read of the raw attribute calls that path on demand.\nPR:L - __iio_device_attr_init() creates the raw attribute with mode 0444, and iio_read_channel_info() calls ad4030_read_raw() with no capability check. Any local user who can read that sysfs file reaches spi_engine_optimize_message() via spi_sync().\nUI:N - The attacker triggers the bug by reading the IIO in_voltage*_raw attribute themselves, which submits the SPI message and enters spi_engine_optimize_message().\nS:U - The out-of-bounds stores from spi_engine_program_add_cmd() corrupt the kernel slab object that follows the spi_engine_program allocation, inside the same kernel security domain as the SPI controller.\nC:H - spi_engine_program_add_cmd() stores each SPI_ENGINE_CMD word at instructions[length - 1] after length was initialized to the allocated element count, so the writes cover the following slab object and can alter lengths or pointers that later leak kernel memory.\nI:H - Each spi_engine_program_add_cmd() does instructions[length - 1] = cmd after bumping a length that kzalloc_flex() already set to the allocation count, so every command is an out-of-bounds write of a uint16_t into the next heap object.\nA:H - The same out-of-bounds write faults if the next page is unmapped, and otherwise corrupts the following slab object so later use oopses or hangs the SPI completion path in spi_engine_transfer_one_message()."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/spi/spi-axi-spi-engine.c"],"versions":[{"version":"69050f8d6d075dc01af7a5f2f550a8067510366f","lessThan":"20e028e01d62557de76c8da648ae52e0ad487c27","status":"affected","versionType":"git"},{"version":"69050f8d6d075dc01af7a5f2f550a8067510366f","lessThan":"2a490521d74ac76e5eb3c9a69d928a4c76dd3f78","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/spi/spi-axi-spi-engine.c"],"versions":[{"version":"7.0","status":"affected"},{"version":"0","lessThan":"7.0","status":"unaffected","versionType":"semver"},{"version":"7.3.7","lessThanOrEqual":"7.3.*","status":"unaffected","versionType":"semver"},{"version":"7.4-rc3","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":"7.0","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"7.0","versionEndExcluding":"7.4-rc3"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/20e028e01d62557de76c8da648ae52e0ad487c27"},{"url":"https://git.kernel.org/stable/c/2a490521d74ac76e5eb3c9a69d928a4c76dd3f78"}],"title":"spi: axi-spi-engine: Start the program length at zero","x_generator":{"engine":"bippy-1.2.0"}}}}