{"id":"CVE-2023-54022","state":"PUBLISHED","title":"ALSA: usb-audio: Fix potential memory leaks at error path for UMP open","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nALSA: usb-audio: Fix potential memory leaks at error path for UMP open\n\nThe allocation and initialization errors at alloc_midi_urbs() that is\ncalled at MIDI 2.0 / UMP device are supposed to be handled at the\ncaller side by invoking free_midi_urbs().  However, free_midi_urbs()\nloops only for ep->num_urbs entries, and since ep->num_entries wasn't\nupdated yet at the allocation / init error in alloc_midi_urbs(), this\nentry won't be released.\n\nThe intention of free_midi_urbs() is to release the whole elements, so\nchange the loop size to NUM_URBS to scan over all elements for fixing\nthe missed releases.\n\nAlso, the call of free_midi_urbs() is missing at\nsnd_usb_midi_v2_open().  Although it'll be released later at\nreopen/close or disconnection, it's better to release immediately at\nthe error path.","publishedAt":"2025-12-24T10:55:52.045Z","updatedAt":"2026-05-11T19:53:46.898Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"ff49d1df79aef7580fe3ac99d17c3f886655d080","status":"affected","lessThan":"f819b343aa95d24d5f7d6e06660c7f62591abc5f","versionType":"git"},{"version":"ff49d1df79aef7580fe3ac99d17c3f886655d080","status":"affected","lessThan":"b1757fa30ef14f254f4719bf6f7d54a4c8207216","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["sound/usb/midi2.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.5","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.5","versionType":"semver"},{"version":"6.5.3","status":"unaffected","lessThanOrEqual":"6.5.*","versionType":"semver"},{"version":"6.6","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["sound/usb/midi2.c"]}],"references":["https://git.kernel.org/stable/c/f819b343aa95d24d5f7d6e06660c7f62591abc5f","https://git.kernel.org/stable/c/b1757fa30ef14f254f4719bf6f7d54a4c8207216"],"weaknesses":[],"ingestedAt":"2026-10-29T20:06:42.242Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2023/54xxx/CVE-2023-54022.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2023-54022","state":"PUBLISHED","datePublished":"2025-12-24T10:55:52.045Z","dateUpdated":"2026-05-11T19:53:46.898Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-12-24T10:53:46.179Z"},"containers":{"cna":{"title":"ALSA: usb-audio: Fix potential memory leaks at error path for UMP open","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nALSA: usb-audio: Fix potential memory leaks at error path for UMP open\n\nThe allocation and initialization errors at alloc_midi_urbs() that is\ncalled at MIDI 2.0 / UMP device are supposed to be handled at the\ncaller side by invoking free_midi_urbs().  However, free_midi_urbs()\nloops only for ep->num_urbs entries, and since ep->num_entries wasn't\nupdated yet at the allocation / init error in alloc_midi_urbs(), this\nentry won't be released.\n\nThe intention of free_midi_urbs() is to release the whole elements, so\nchange the loop size to NUM_URBS to scan over all elements for fixing\nthe missed releases.\n\nAlso, the call of free_midi_urbs() is missing at\nsnd_usb_midi_v2_open().  Although it'll be released later at\nreopen/close or disconnection, it's better to release immediately at\nthe error path."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"ff49d1df79aef7580fe3ac99d17c3f886655d080","status":"affected","lessThan":"f819b343aa95d24d5f7d6e06660c7f62591abc5f","versionType":"git"},{"version":"ff49d1df79aef7580fe3ac99d17c3f886655d080","status":"affected","lessThan":"b1757fa30ef14f254f4719bf6f7d54a4c8207216","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["sound/usb/midi2.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.5","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.5","versionType":"semver"},{"version":"6.5.3","status":"unaffected","lessThanOrEqual":"6.5.*","versionType":"semver"},{"version":"6.6","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["sound/usb/midi2.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/f819b343aa95d24d5f7d6e06660c7f62591abc5f"},{"url":"https://git.kernel.org/stable/c/b1757fa30ef14f254f4719bf6f7d54a4c8207216"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T19:53:46.898Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.5","versionEndExcluding":"6.5.3"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.5","versionEndExcluding":"6.6"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}