Skip to content
Heist/ feed
Back to feed
HighFix available

spi: sun6i: fix race between DMA RX transfer completion and RX FIFO drain

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: spi: sun6i: fix race between DMA RX transfer completion and RX FIFO drain Previously the transfer complete IRQ immediately drained to RX FIFO to read any data remaining in FIFO to the RX buffer. This behaviour is correct when dealing with SPI in interrupt mode. However in DMA mode the transfer complete interrupt still fires as soon as all bytes to be transferred have been stored in the FIFO. At that point data in the FIFO still needs to be picked up by the DMA engine. Thus the drain procedure and DMA engine end up racing to read from RX FIFO, corrupting any data read. Additionally the RX buffer pointer is never adjusted according to DMA progress in DMA mode, thus calling the RX FIFO drain procedure in DMA mode is a bug. Fix corruptions in DMA RX mode by draining RX FIFO only in interrupt mode. Also wait for completion of RX DMA when in DMA mode before returning to ensure all data has been copied to the supplied memory buffer.

Products
Kernel
Affected versions
Not specified
Fixed versions
5.15.134, 6.1.56, 6.5.6
CVEs
CVE-2023-52517
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 02:52 UTC · Revision 1

Source evidence

spi: sun6i: fix race between DMA RX transfer completion and RX FIFO drain

core-osv · Original source

Published 2 Mar 2024, 21:52 UTC

In the Linux kernel, the following vulnerability has been resolved: spi: sun6i: fix race between DMA RX transfer completion and RX FIFO drain Previously the transfer complete IRQ immediately drained to RX FIFO to read any data remaining in FIFO to the RX buffer. This behaviour is correct when dealing with SPI in interrupt mode. However in DMA mode the transfer complete interrupt still fires as soon as all bytes to be transferred have been stored in the FIFO. At that point data in the FIFO still needs to be picked up by the DMA engine. Thus the drain procedure and DMA engine end up racing to read from RX FIFO, corrupting any data read. Additionally the RX buffer pointer is never adjusted according to DMA progress in DMA mode, thus calling the RX FIFO drain procedure in DMA mode is a bug. Fix corruptions in DMA RX mode by draining RX FIFO only in interrupt mode. Also wait for completion of RX DMA when in DMA mode before returning to ensure all data has been copied to the supplied memory buffer.

osv:CVE-2023-52517

Kernel

Fixed versions: 5.15.134, 6.1.56, 6.5.6

Complete source record
{
  "id": "6b610723026024debcffa08596b74f51291a01d8874311d02699309f80dd034d",
  "url": "https://osv.dev/vulnerability/CVE-2023-52517",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "spi: sun6i: fix race between DMA RX transfer completion and RX FIFO drain",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: spi: sun6i: fix race between DMA RX transfer completion and RX FIFO drain Previously the transfer complete IRQ immediately drained to RX FIFO to read any data remaining in FIFO to the RX buffer. This behaviour is correct when dealing with SPI in interrupt mode. However in DMA mode the transfer complete interrupt still fires as soon as all bytes to be transferred have been stored in the FIFO. At that point data in the FIFO still needs to be picked up by the DMA engine. Thus the drain procedure and DMA engine end up racing to read from RX FIFO, corrupting any data read. Additionally the RX buffer pointer is never adjusted according to DMA progress in DMA mode, thus calling the RX FIFO drain procedure in DMA mode is a bug. Fix corruptions in DMA RX mode by draining RX FIFO only in interrupt mode. Also wait for completion of RX DMA when in DMA mode before returning to ensure all data has been copied to the supplied memory buffer.",
    "evidence": "osv:CVE-2023-52517",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "5.15.134",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.1.56",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.5.6",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "CVE-2023-52517",
      "aliases": [
        "CVE-2023-52517"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "345980a3a5e5e1c99fc621e2ce878fb150ad2287"
                },
                {
                  "fixed": "bd1ec7f9983b5cd3c77e0f7cda3fa8aed041af2f"
                },
                {
                  "fixed": "36b29974a7ad2ff604c24ad348f940506c7b1209"
                },
                {
                  "fixed": "4e149d524678431638ff378ef6025e4e89b71097"
                },
                {
                  "fixed": "1f11f4202caf5710204d334fe63392052783876d"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-52517.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.11.0"
                },
                {
                  "fixed": "5.15.134"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.16.0"
                },
                {
                  "fixed": "6.1.56"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.2.0"
                },
                {
                  "fixed": "6.5.6"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-52517.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:32.840115317Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/1f11f4202caf5710204d334fe63392052783876d",
        "https://git.kernel.org/stable/c/36b29974a7ad2ff604c24ad348f940506c7b1209",
        "https://git.kernel.org/stable/c/4e149d524678431638ff378ef6025e4e89b71097",
        "https://git.kernel.org/stable/c/bd1ec7f9983b5cd3c77e0f7cda3fa8aed041af2f",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/52xxx/CVE-2023-52517.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2023-52517",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/52xxx/CVE-2023-52517.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2023-52517",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 499822,
  "published_at": "2024-03-02T21:52:27.152+00:00"
}