{"api_version":"1","generated_at":"2026-05-13T15:18:00+00:00","cve":"CVE-2025-21835","urls":{"html":"https://cve.report/CVE-2025-21835","api":"https://cve.report/api/cve/CVE-2025-21835.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2025-21835","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2025-21835"},"summary":{"title":"usb: gadget: f_midi: fix MIDI Streaming descriptor lengths","description":"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.","state":"PUBLISHED","assigner":"Linux","published_at":"2025-03-07 09:15:16","updated_at":"2026-05-12 13:16:37"},"problem_types":["NVD-CWE-noinfo"],"metrics":[{"version":"3.1","source":"nvd@nist.gov","type":"Primary","score":"5.5","severity":"MEDIUM","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","data":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","baseScore":5.5,"baseSeverity":"MEDIUM","attackVector":"LOCAL","attackComplexity":"LOW","privilegesRequired":"LOW","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"NONE","integrityImpact":"NONE","availabilityImpact":"HIGH"}}],"references":[{"url":"https://git.kernel.org/stable/c/3a983390d14e8498f303fc5cb23ab7d696b815db","name":"https://git.kernel.org/stable/c/3a983390d14e8498f303fc5cb23ab7d696b815db","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html","name":"https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/d8e86700c8a8cf415e300a0921acd6a8f9b494f8","name":"https://git.kernel.org/stable/c/d8e86700c8a8cf415e300a0921acd6a8f9b494f8","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/9f36a89dcb78cb7e37f487b04a16396ac18c0636","name":"https://git.kernel.org/stable/c/9f36a89dcb78cb7e37f487b04a16396ac18c0636","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-265688.html","name":"https://cert-portal.siemens.com/productcert/html/ssa-265688.html","refsource":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/9f6860a9c11301b052225ca8825f8d2b1a5825bf","name":"https://git.kernel.org/stable/c/9f6860a9c11301b052225ca8825f8d2b1a5825bf","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/a2d0694e1f111379c1efdf439dadd3cfd959fe9d","name":"https://git.kernel.org/stable/c/a2d0694e1f111379c1efdf439dadd3cfd959fe9d","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/6ae6dee9f005a2f3b739b85abb6f14a0935699e0","name":"https://git.kernel.org/stable/c/6ae6dee9f005a2f3b739b85abb6f14a0935699e0","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/da1668997052ed1cb00322e1f3b63702615c9429","name":"https://git.kernel.org/stable/c/da1668997052ed1cb00322e1f3b63702615c9429","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00028.html","name":"https://lists.debian.org/debian-lts-announce/2025/03/msg00028.html","refsource":"af854a3a-2127-422b-91ae-364da2661108","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/6b16761a928796e4b49e89a0b1ac284155172726","name":"https://git.kernel.org/stable/c/6b16761a928796e4b49e89a0b1ac284155172726","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2025-21835","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-21835","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected c8933c3f79568263c90a46f06cf80419e6c63c97 3a983390d14e8498f303fc5cb23ab7d696b815db git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected c8933c3f79568263c90a46f06cf80419e6c63c97 9f36a89dcb78cb7e37f487b04a16396ac18c0636 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected c8933c3f79568263c90a46f06cf80419e6c63c97 d8e86700c8a8cf415e300a0921acd6a8f9b494f8 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected c8933c3f79568263c90a46f06cf80419e6c63c97 9f6860a9c11301b052225ca8825f8d2b1a5825bf git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected c8933c3f79568263c90a46f06cf80419e6c63c97 6ae6dee9f005a2f3b739b85abb6f14a0935699e0 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected c8933c3f79568263c90a46f06cf80419e6c63c97 6b16761a928796e4b49e89a0b1ac284155172726 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected c8933c3f79568263c90a46f06cf80419e6c63c97 a2d0694e1f111379c1efdf439dadd3cfd959fe9d git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected c8933c3f79568263c90a46f06cf80419e6c63c97 da1668997052ed1cb00322e1f3b63702615c9429 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 3.2","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 3.2 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.4.291 5.4.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.10.235 5.10.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.15.179 5.15.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.1.129 6.1.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.6.79 6.6.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.12.16 6.12.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.13.4 6.13.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.14 * original_commit_for_fix","platforms":[]},{"source":"ADP","vendor":"Siemens","product":"SIMATIC S7-1500 TM MFP - GNU/Linux subsystem","version":"affected * custom","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[{"cve_year":"2025","cve_id":"21835","vulnerable":"1","versionEndIncluding":"","cpe1":"cpe","cpe2":"2.3","cpe3":"o","cpe4":"linux","cpe5":"linux_kernel","cpe6":"*","cpe7":"*","cpe8":"*","cpe9":"*","cpe10":"*","cpe11":"*","cpe12":"*","cpe13":"*"}],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"adp":[{"providerMetadata":{"dateUpdated":"2025-11-03T21:00:07.684Z","orgId":"af854a3a-2127-422b-91ae-364da2661108","shortName":"CVE"},"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"}],"title":"CVE Program Container"},{"affected":[{"defaultStatus":"unknown","product":"SIMATIC S7-1500 TM MFP - GNU/Linux subsystem","vendor":"Siemens","versions":[{"lessThan":"*","status":"affected","version":"0","versionType":"custom"}]}],"providerMetadata":{"dateUpdated":"2026-05-12T12:04:00.939Z","orgId":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","shortName":"siemens-SADP"},"references":[{"url":"https://cert-portal.siemens.com/productcert/html/ssa-265688.html"}],"x_adpType":"supplier"}],"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["drivers/usb/gadget/function/f_midi.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"3a983390d14e8498f303fc5cb23ab7d696b815db","status":"affected","version":"c8933c3f79568263c90a46f06cf80419e6c63c97","versionType":"git"},{"lessThan":"9f36a89dcb78cb7e37f487b04a16396ac18c0636","status":"affected","version":"c8933c3f79568263c90a46f06cf80419e6c63c97","versionType":"git"},{"lessThan":"d8e86700c8a8cf415e300a0921acd6a8f9b494f8","status":"affected","version":"c8933c3f79568263c90a46f06cf80419e6c63c97","versionType":"git"},{"lessThan":"9f6860a9c11301b052225ca8825f8d2b1a5825bf","status":"affected","version":"c8933c3f79568263c90a46f06cf80419e6c63c97","versionType":"git"},{"lessThan":"6ae6dee9f005a2f3b739b85abb6f14a0935699e0","status":"affected","version":"c8933c3f79568263c90a46f06cf80419e6c63c97","versionType":"git"},{"lessThan":"6b16761a928796e4b49e89a0b1ac284155172726","status":"affected","version":"c8933c3f79568263c90a46f06cf80419e6c63c97","versionType":"git"},{"lessThan":"a2d0694e1f111379c1efdf439dadd3cfd959fe9d","status":"affected","version":"c8933c3f79568263c90a46f06cf80419e6c63c97","versionType":"git"},{"lessThan":"da1668997052ed1cb00322e1f3b63702615c9429","status":"affected","version":"c8933c3f79568263c90a46f06cf80419e6c63c97","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["drivers/usb/gadget/function/f_midi.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"3.2"},{"lessThan":"3.2","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"5.4.*","status":"unaffected","version":"5.4.291","versionType":"semver"},{"lessThanOrEqual":"5.10.*","status":"unaffected","version":"5.10.235","versionType":"semver"},{"lessThanOrEqual":"5.15.*","status":"unaffected","version":"5.15.179","versionType":"semver"},{"lessThanOrEqual":"6.1.*","status":"unaffected","version":"6.1.129","versionType":"semver"},{"lessThanOrEqual":"6.6.*","status":"unaffected","version":"6.6.79","versionType":"semver"},{"lessThanOrEqual":"6.12.*","status":"unaffected","version":"6.12.16","versionType":"semver"},{"lessThanOrEqual":"6.13.*","status":"unaffected","version":"6.13.4","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"6.14","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.4.291","versionStartIncluding":"3.2","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.10.235","versionStartIncluding":"3.2","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.15.179","versionStartIncluding":"3.2","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.1.129","versionStartIncluding":"3.2","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.6.79","versionStartIncluding":"3.2","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.12.16","versionStartIncluding":"3.2","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.13.4","versionStartIncluding":"3.2","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.14","versionStartIncluding":"3.2","vulnerable":true}],"negate":false,"operator":"OR"}]}],"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."}],"providerMetadata":{"dateUpdated":"2026-05-11T21:07:26.767Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"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"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2025-21835","datePublished":"2025-03-07T09:09:55.320Z","dateReserved":"2024-12-29T08:45:45.777Z","dateUpdated":"2026-05-12T12:04:00.939Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2025-03-07 09:15:16","lastModifiedDate":"2026-05-12 13:16:37","problem_types":["NVD-CWE-noinfo"],"metrics":{"cvssMetricV31":[{"source":"nvd@nist.gov","type":"Primary","cvssData":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","baseScore":5.5,"baseSeverity":"MEDIUM","attackVector":"LOCAL","attackComplexity":"LOW","privilegesRequired":"LOW","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"NONE","integrityImpact":"NONE","availabilityImpact":"HIGH"},"exploitabilityScore":1.8,"impactScore":3.6}]},"configurations":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.2","versionEndExcluding":"5.4.291","matchCriteriaId":"A429BFA2-6201-4C4E-AE0F-6DBEE200B8CD"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.5","versionEndExcluding":"5.10.235","matchCriteriaId":"545121FA-DE31-4154-9446-C2000FB4104D"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.11","versionEndExcluding":"5.15.179","matchCriteriaId":"C708062C-4E1B-465F-AE6D-C09C46400875"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.16","versionEndExcluding":"6.1.129","matchCriteriaId":"2DA5009C-C9B9-4A1D-9B96-78427E8F232C"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.2","versionEndExcluding":"6.6.79","matchCriteriaId":"B16AADE5-B2FD-4C14-B4E4-85E8EDAFE775"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.7","versionEndExcluding":"6.12.16","matchCriteriaId":"13C8DB18-FC60-425F-84E5-3EDDEC61B2FC"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.13","versionEndExcluding":"6.13.4","matchCriteriaId":"2A2093ED-74A9-43F9-AC72-50030F374EA4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:6.14:rc1:*:*:*:*:*:*","matchCriteriaId":"186716B6-2B66-4BD0-852E-D48E71C0C85F"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:6.14:rc2:*:*:*:*:*:*","matchCriteriaId":"0D3E781C-403A-498F-9DA9-ECEE50F41E75"}]}]}]},"legacy_mitre":{"record":{"CveYear":"2025","CveId":"21835","Ordinal":"1","Title":"usb: gadget: f_midi: fix MIDI Streaming descriptor lengths","CVE":"CVE-2025-21835","Year":"2025"},"notes":[{"CveYear":"2025","CveId":"21835","Ordinal":"1","NoteData":"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.","Type":"Description","Title":"usb: gadget: f_midi: fix MIDI Streaming descriptor lengths"}]}}}