{"id":"CVE-2026-31720","state":"PUBLISHED","title":"usb: gadget: f_uac1_legacy: validate control request size","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: f_uac1_legacy: validate control request size\n\nf_audio_complete() copies req->length bytes into a 4-byte stack\nvariable:\n\n  u32 data = 0;\n  memcpy(&data, req->buf, req->length);\n\nreq->length is derived from the host-controlled USB request path,\nwhich can lead to a stack out-of-bounds write.\n\nValidate req->actual against the expected payload size for the\nsupported control selectors and decode only the expected amount\nof data.\n\nThis avoids copying a host-influenced length into a fixed-size\nstack object.","publishedAt":"2026-05-01T14:14:22.832Z","updatedAt":"2026-05-11T22:14:27.286Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"c6994e6f067cf0fc4c6cca3d164018b1150916f8","status":"affected","lessThan":"557d1d4e862eccd0b74cc377b66de3e1e8d49605","versionType":"git"},{"version":"c6994e6f067cf0fc4c6cca3d164018b1150916f8","status":"affected","lessThan":"21b11e8581285c6f10ef43d05df349d445f24273","versionType":"git"},{"version":"c6994e6f067cf0fc4c6cca3d164018b1150916f8","status":"affected","lessThan":"0d41772d98dcaf6c17e875b7d0ea0154ae1191ee","versionType":"git"},{"version":"c6994e6f067cf0fc4c6cca3d164018b1150916f8","status":"affected","lessThan":"c6da4fed7537aec19880c24f6c3a95065adb1406","versionType":"git"},{"version":"c6994e6f067cf0fc4c6cca3d164018b1150916f8","status":"affected","lessThan":"be2d32f0c3fe333d14c0a9ca90328dacbc3e06b8","versionType":"git"},{"version":"c6994e6f067cf0fc4c6cca3d164018b1150916f8","status":"affected","lessThan":"8e5eb1d6e6a3d7bbea9c92132d0cda5793176426","versionType":"git"},{"version":"c6994e6f067cf0fc4c6cca3d164018b1150916f8","status":"affected","lessThan":"26304d124e7f0383f8fe1168b5801a0ac7e16b1c","versionType":"git"},{"version":"c6994e6f067cf0fc4c6cca3d164018b1150916f8","status":"affected","lessThan":"6e0e34d85cd46ceb37d16054e97a373a32770f6c","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/usb/gadget/function/f_uac1_legacy.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.31","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.31","versionType":"semver"},{"version":"5.10.253","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.203","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.168","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.134","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.81","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.22","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19.12","status":"unaffected","lessThanOrEqual":"6.19.*","versionType":"semver"},{"version":"7.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/usb/gadget/function/f_uac1_legacy.c"]}],"references":["https://git.kernel.org/stable/c/557d1d4e862eccd0b74cc377b66de3e1e8d49605","https://git.kernel.org/stable/c/21b11e8581285c6f10ef43d05df349d445f24273","https://git.kernel.org/stable/c/0d41772d98dcaf6c17e875b7d0ea0154ae1191ee","https://git.kernel.org/stable/c/c6da4fed7537aec19880c24f6c3a95065adb1406","https://git.kernel.org/stable/c/be2d32f0c3fe333d14c0a9ca90328dacbc3e06b8","https://git.kernel.org/stable/c/8e5eb1d6e6a3d7bbea9c92132d0cda5793176426","https://git.kernel.org/stable/c/26304d124e7f0383f8fe1168b5801a0ac7e16b1c","https://git.kernel.org/stable/c/6e0e34d85cd46ceb37d16054e97a373a32770f6c"],"weaknesses":[],"ingestedAt":"2026-10-29T20:11:40.391Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/31xxx/CVE-2026-31720.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-31720","state":"PUBLISHED","datePublished":"2026-05-01T14:14:22.832Z","dateUpdated":"2026-05-11T22:14:27.286Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-03-09T15:48:24.134Z"},"containers":{"cna":{"title":"usb: gadget: f_uac1_legacy: validate control request size","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: f_uac1_legacy: validate control request size\n\nf_audio_complete() copies req->length bytes into a 4-byte stack\nvariable:\n\n  u32 data = 0;\n  memcpy(&data, req->buf, req->length);\n\nreq->length is derived from the host-controlled USB request path,\nwhich can lead to a stack out-of-bounds write.\n\nValidate req->actual against the expected payload size for the\nsupported control selectors and decode only the expected amount\nof data.\n\nThis avoids copying a host-influenced length into a fixed-size\nstack object."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"c6994e6f067cf0fc4c6cca3d164018b1150916f8","status":"affected","lessThan":"557d1d4e862eccd0b74cc377b66de3e1e8d49605","versionType":"git"},{"version":"c6994e6f067cf0fc4c6cca3d164018b1150916f8","status":"affected","lessThan":"21b11e8581285c6f10ef43d05df349d445f24273","versionType":"git"},{"version":"c6994e6f067cf0fc4c6cca3d164018b1150916f8","status":"affected","lessThan":"0d41772d98dcaf6c17e875b7d0ea0154ae1191ee","versionType":"git"},{"version":"c6994e6f067cf0fc4c6cca3d164018b1150916f8","status":"affected","lessThan":"c6da4fed7537aec19880c24f6c3a95065adb1406","versionType":"git"},{"version":"c6994e6f067cf0fc4c6cca3d164018b1150916f8","status":"affected","lessThan":"be2d32f0c3fe333d14c0a9ca90328dacbc3e06b8","versionType":"git"},{"version":"c6994e6f067cf0fc4c6cca3d164018b1150916f8","status":"affected","lessThan":"8e5eb1d6e6a3d7bbea9c92132d0cda5793176426","versionType":"git"},{"version":"c6994e6f067cf0fc4c6cca3d164018b1150916f8","status":"affected","lessThan":"26304d124e7f0383f8fe1168b5801a0ac7e16b1c","versionType":"git"},{"version":"c6994e6f067cf0fc4c6cca3d164018b1150916f8","status":"affected","lessThan":"6e0e34d85cd46ceb37d16054e97a373a32770f6c","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/usb/gadget/function/f_uac1_legacy.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.31","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.31","versionType":"semver"},{"version":"5.10.253","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.203","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.168","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.134","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.81","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.22","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19.12","status":"unaffected","lessThanOrEqual":"6.19.*","versionType":"semver"},{"version":"7.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/usb/gadget/function/f_uac1_legacy.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/557d1d4e862eccd0b74cc377b66de3e1e8d49605"},{"url":"https://git.kernel.org/stable/c/21b11e8581285c6f10ef43d05df349d445f24273"},{"url":"https://git.kernel.org/stable/c/0d41772d98dcaf6c17e875b7d0ea0154ae1191ee"},{"url":"https://git.kernel.org/stable/c/c6da4fed7537aec19880c24f6c3a95065adb1406"},{"url":"https://git.kernel.org/stable/c/be2d32f0c3fe333d14c0a9ca90328dacbc3e06b8"},{"url":"https://git.kernel.org/stable/c/8e5eb1d6e6a3d7bbea9c92132d0cda5793176426"},{"url":"https://git.kernel.org/stable/c/26304d124e7f0383f8fe1168b5801a0ac7e16b1c"},{"url":"https://git.kernel.org/stable/c/6e0e34d85cd46ceb37d16054e97a373a32770f6c"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T22:14:27.286Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.31","versionEndExcluding":"5.10.253"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.31","versionEndExcluding":"5.15.203"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.31","versionEndExcluding":"6.1.168"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.31","versionEndExcluding":"6.6.134"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.31","versionEndExcluding":"6.12.81"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.31","versionEndExcluding":"6.18.22"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.31","versionEndExcluding":"6.19.12"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.31","versionEndExcluding":"7.0"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}