{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2025-21835",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2024-12-29T08:45:45.777Z",
        "datePublished": "2025-03-07T09:09:55.320Z",
        "dateUpdated": "2026-05-12T12:04:00.939Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-05-11T21:07:26.767Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: f_midi: fix MIDI Streaming descriptor lengths\n\nWhile the MIDI jacks are configured correctly, and the MIDIStreaming\nendpoint descriptors are filled with the correct information,\nbNumEmbMIDIJack and bLength are set incorrectly in these descriptors.\n\nThis does not matter when the numbers of in and out ports are equal, but\nwhen they differ the host will receive broken descriptors with\nuninitialized stack memory leaking into the descriptor for whichever\nvalue is smaller.\n\nThe precise meaning of \"in\" and \"out\" in the port counts is not clearly\ndefined and can be confusing.  But elsewhere the driver consistently\nuses this to match the USB meaning of IN and OUT viewed from the host,\nso that \"in\" ports send data to the host and \"out\" ports receive data\nfrom it."
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "drivers/usb/gadget/function/f_midi.c"
                    ],
                    "versions": [
                        {
                            "version": "c8933c3f79568263c90a46f06cf80419e6c63c97",
                            "lessThan": "3a983390d14e8498f303fc5cb23ab7d696b815db",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "c8933c3f79568263c90a46f06cf80419e6c63c97",
                            "lessThan": "9f36a89dcb78cb7e37f487b04a16396ac18c0636",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "c8933c3f79568263c90a46f06cf80419e6c63c97",
                            "lessThan": "d8e86700c8a8cf415e300a0921acd6a8f9b494f8",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "c8933c3f79568263c90a46f06cf80419e6c63c97",
                            "lessThan": "9f6860a9c11301b052225ca8825f8d2b1a5825bf",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "c8933c3f79568263c90a46f06cf80419e6c63c97",
                            "lessThan": "6ae6dee9f005a2f3b739b85abb6f14a0935699e0",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "c8933c3f79568263c90a46f06cf80419e6c63c97",
                            "lessThan": "6b16761a928796e4b49e89a0b1ac284155172726",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "c8933c3f79568263c90a46f06cf80419e6c63c97",
                            "lessThan": "a2d0694e1f111379c1efdf439dadd3cfd959fe9d",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "c8933c3f79568263c90a46f06cf80419e6c63c97",
                            "lessThan": "da1668997052ed1cb00322e1f3b63702615c9429",
                            "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/usb/gadget/function/f_midi.c"
                    ],
                    "versions": [
                        {
                            "version": "3.2",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "3.2",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.4.291",
                            "lessThanOrEqual": "5.4.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.10.235",
                            "lessThanOrEqual": "5.10.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.15.179",
                            "lessThanOrEqual": "5.15.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.1.129",
                            "lessThanOrEqual": "6.1.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.6.79",
                            "lessThanOrEqual": "6.6.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.12.16",
                            "lessThanOrEqual": "6.12.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.13.4",
                            "lessThanOrEqual": "6.13.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.14",
                            "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": "3.2",
                                    "versionEndExcluding": "5.4.291"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.2",
                                    "versionEndExcluding": "5.10.235"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.2",
                                    "versionEndExcluding": "5.15.179"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.2",
                                    "versionEndExcluding": "6.1.129"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.2",
                                    "versionEndExcluding": "6.6.79"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.2",
                                    "versionEndExcluding": "6.12.16"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.2",
                                    "versionEndExcluding": "6.13.4"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "3.2",
                                    "versionEndExcluding": "6.14"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/3a983390d14e8498f303fc5cb23ab7d696b815db"
                },
                {
                    "url": "https://git.kernel.org/stable/c/9f36a89dcb78cb7e37f487b04a16396ac18c0636"
                },
                {
                    "url": "https://git.kernel.org/stable/c/d8e86700c8a8cf415e300a0921acd6a8f9b494f8"
                },
                {
                    "url": "https://git.kernel.org/stable/c/9f6860a9c11301b052225ca8825f8d2b1a5825bf"
                },
                {
                    "url": "https://git.kernel.org/stable/c/6ae6dee9f005a2f3b739b85abb6f14a0935699e0"
                },
                {
                    "url": "https://git.kernel.org/stable/c/6b16761a928796e4b49e89a0b1ac284155172726"
                },
                {
                    "url": "https://git.kernel.org/stable/c/a2d0694e1f111379c1efdf439dadd3cfd959fe9d"
                },
                {
                    "url": "https://git.kernel.org/stable/c/da1668997052ed1cb00322e1f3b63702615c9429"
                }
            ],
            "title": "usb: gadget: f_midi: fix MIDI Streaming descriptor lengths",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        },
        "adp": [
            {
                "title": "CVE Program Container",
                "references": [
                    {
                        "url": "https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html"
                    },
                    {
                        "url": "https://lists.debian.org/debian-lts-announce/2025/03/msg00028.html"
                    }
                ],
                "providerMetadata": {
                    "orgId": "af854a3a-2127-422b-91ae-364da2661108",
                    "shortName": "CVE",
                    "dateUpdated": "2025-11-03T21:00:07.684Z"
                }
            },
            {
                "x_adpType": "supplier",
                "providerMetadata": {
                    "orgId": "0b142b55-0307-4c5a-b3c9-f314f3fb7c5e",
                    "shortName": "siemens-SADP",
                    "dateUpdated": "2026-05-12T12:04:00.939Z"
                },
                "affected": [
                    {
                        "vendor": "Siemens",
                        "product": "SIMATIC S7-1500 TM MFP - GNU/Linux subsystem",
                        "versions": [
                            {
                                "status": "affected",
                                "version": "0",
                                "lessThan": "*",
                                "versionType": "custom"
                            }
                        ],
                        "defaultStatus": "unknown"
                    }
                ],
                "references": [
                    {
                        "url": "https://cert-portal.siemens.com/productcert/html/ssa-265688.html"
                    }
                ]
            }
        ]
    }
}