{"id":"CVE-2021-47048","state":"PUBLISHED","title":"spi: spi-zynqmp-gqspi: fix use-after-free in zynqmp_qspi_exec_op","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nspi: spi-zynqmp-gqspi: fix use-after-free in zynqmp_qspi_exec_op\n\nWhen handling op->addr, it is using the buffer \"tmpbuf\" which has been\nfreed. This will trigger a use-after-free KASAN warning. Let's use\ntemporary variables to store op->addr.val and op->cmd.opcode to fix\nthis issue.","publishedAt":"2024-02-28T08:13:51.551Z","updatedAt":"2026-08-05T08:45:43.114Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1c26372e5aa9e53391a1f8fe0dc7cd93a7e5ba9e","status":"affected","lessThan":"1231279389b5e638bc3b66b9741c94077aed4b5a","versionType":"git"},{"version":"1c26372e5aa9e53391a1f8fe0dc7cd93a7e5ba9e","status":"affected","lessThan":"d67e0d6bd92ebbb0294e7062bbf5cdc773764e62","versionType":"git"},{"version":"1c26372e5aa9e53391a1f8fe0dc7cd93a7e5ba9e","status":"affected","lessThan":"23269ac9f123eca3aea7682d3345c02e71ed696c","versionType":"git"},{"version":"1c26372e5aa9e53391a1f8fe0dc7cd93a7e5ba9e","status":"affected","lessThan":"a2c5bedb2d55dd27c642c7b9fb6886d7ad7bdb58","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/spi/spi-zynqmp-gqspi.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.10","versionType":"semver"},{"version":"5.10.37","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.11.21","status":"unaffected","lessThanOrEqual":"5.11.*","versionType":"semver"},{"version":"5.12.4","status":"unaffected","lessThanOrEqual":"5.12.*","versionType":"semver"},{"version":"5.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/spi/spi-zynqmp-gqspi.c"]}],"references":["https://git.kernel.org/stable/c/1231279389b5e638bc3b66b9741c94077aed4b5a","https://git.kernel.org/stable/c/d67e0d6bd92ebbb0294e7062bbf5cdc773764e62","https://git.kernel.org/stable/c/23269ac9f123eca3aea7682d3345c02e71ed696c","https://git.kernel.org/stable/c/a2c5bedb2d55dd27c642c7b9fb6886d7ad7bdb58"],"weaknesses":[],"ingestedAt":"2026-10-29T19:49:19.404Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2021/47xxx/CVE-2021-47048.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2021-47048","state":"PUBLISHED","datePublished":"2024-02-28T08:13:51.551Z","dateUpdated":"2026-08-05T08:45:43.114Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-02-27T18:42:55.970Z"},"containers":{"cna":{"title":"spi: spi-zynqmp-gqspi: fix use-after-free in zynqmp_qspi_exec_op","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nspi: spi-zynqmp-gqspi: fix use-after-free in zynqmp_qspi_exec_op\n\nWhen handling op->addr, it is using the buffer \"tmpbuf\" which has been\nfreed. This will trigger a use-after-free KASAN warning. Let's use\ntemporary variables to store op->addr.val and op->cmd.opcode to fix\nthis issue."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1c26372e5aa9e53391a1f8fe0dc7cd93a7e5ba9e","status":"affected","lessThan":"1231279389b5e638bc3b66b9741c94077aed4b5a","versionType":"git"},{"version":"1c26372e5aa9e53391a1f8fe0dc7cd93a7e5ba9e","status":"affected","lessThan":"d67e0d6bd92ebbb0294e7062bbf5cdc773764e62","versionType":"git"},{"version":"1c26372e5aa9e53391a1f8fe0dc7cd93a7e5ba9e","status":"affected","lessThan":"23269ac9f123eca3aea7682d3345c02e71ed696c","versionType":"git"},{"version":"1c26372e5aa9e53391a1f8fe0dc7cd93a7e5ba9e","status":"affected","lessThan":"a2c5bedb2d55dd27c642c7b9fb6886d7ad7bdb58","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/spi/spi-zynqmp-gqspi.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.10","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.10","versionType":"semver"},{"version":"5.10.37","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.11.21","status":"unaffected","lessThanOrEqual":"5.11.*","versionType":"semver"},{"version":"5.12.4","status":"unaffected","lessThanOrEqual":"5.12.*","versionType":"semver"},{"version":"5.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/spi/spi-zynqmp-gqspi.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/1231279389b5e638bc3b66b9741c94077aed4b5a"},{"url":"https://git.kernel.org/stable/c/d67e0d6bd92ebbb0294e7062bbf5cdc773764e62"},{"url":"https://git.kernel.org/stable/c/23269ac9f123eca3aea7682d3345c02e71ed696c"},{"url":"https://git.kernel.org/stable/c/a2c5bedb2d55dd27c642c7b9fb6886d7ad7bdb58"}],"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 vulnerable code is in the Xilinx ZynqMP GQSPI controller's spi-mem exec_op path, reached only via local syscalls that perform SPI NOR/MTD flash operations (e.g., reading /dev/mtd* or files on a SPI-NOR-backed filesystem), not via network packets or physical plug-in buses.\nAC:L - Any SPI memory operation with both a command and address (the common case for flash reads/writes/erases) reliably frees tmpbuf then immediately reuses xqspi->txbuf pointing at that freed buffer; no race or attacker-uncontrollable condition is required.\nPR:L - On realistic ZynqMP embedded deployments, QSPI flash is commonly mounted or otherwise readable by unprivileged local users (SPI-NOR-backed filesystems, relaxed /dev/mtd permissions), so basic user privileges suffice to trigger exec_op without requiring real root.\nUI:N - The attacker triggers the UAF solely through their own flash/filesystem accesses; no separate victim action is needed.\nS:U - This is standard kernel memory corruption within the host kernel's security authority and does not cross a VM, IOMMU, or other security boundary.\nC:H - Use-after-free of the kmalloc'd tmpbuf allows reclaim and control of the freed object contents, which per kernel CVSS guidance enables arbitrary information disclosure.\nI:H - The UAF writes attacker-influenced address bytes into freed slab memory that is subsequently consumed by filltxfifo, enabling heap corruption and potential control-flow hijacking primitives.\nA:H - Use-after-free in this kernel driver path can cause kernel oops/panic or otherwise crash the system when the freed buffer is corrupted or reused."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T08:45:43.114Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.10","versionEndExcluding":"5.10.37"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.10","versionEndExcluding":"5.11.21"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.10","versionEndExcluding":"5.12.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.10","versionEndExcluding":"5.13"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://git.kernel.org/stable/c/1231279389b5e638bc3b66b9741c94077aed4b5a","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/d67e0d6bd92ebbb0294e7062bbf5cdc773764e62","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/23269ac9f123eca3aea7682d3345c02e71ed696c","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/a2c5bedb2d55dd27c642c7b9fb6886d7ad7bdb58","tags":["x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-04T05:24:39.431Z"}},{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2021-47048","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2024-09-10T15:57:41.551730Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-09-11T17:33:55.958Z"}}]}}}