{"id":"CVE-2021-47288","aliases":["CVE-2021-47288"],"related":[],"kind":"vulnerability","state":"published","title":"media: ngene: Fix out-of-bounds bug in ngene_command_config_free_buf()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmedia: ngene: Fix out-of-bounds bug in ngene_command_config_free_buf()\n\nFix an 11-year old bug in ngene_command_config_free_buf() while\naddressing the following warnings caught with -Warray-bounds:\n\narch/alpha/include/asm/string.h:22:16: warning: '__builtin_memcpy' offset [12, 16] from the object at 'com' is out of the bounds of referenced subobject 'config' with type 'unsigned char' at offset 10 [-Warray-bounds]\narch/x86/include/asm/string_32.h:182:25: warning: '__builtin_memcpy' offset [12, 16] from the object at 'com' is out of the bounds of referenced subobject 'config' with type 'unsigned char' at offset 10 [-Warray-bounds]\n\nThe problem is that the original code is trying to copy 6 bytes of\ndata into a one-byte size member _config_ of the wrong structue\nFW_CONFIGURE_BUFFERS, in a single call to memcpy(). This causes a\nlegitimate compiler warning because memcpy() overruns the length\nof &com.cmd.ConfigureBuffers.config. It seems that the right\nstructure is FW_CONFIGURE_FREE_BUFFERS, instead, because it contains\n6 more members apart from the header _hdr_. Also, the name of\nthe function ngene_command_config_free_buf() suggests that the actual\nintention is to ConfigureFreeBuffers, instead of ConfigureBuffers\n(which takes place in the function ngene_command_config_buf(), above).\n\nFix this by enclosing those 6 members of struct FW_CONFIGURE_FREE_BUFFERS\ninto new struct config, and use &com.cmd.ConfigureFreeBuffers.config as\nthe destination address, instead of &com.cmd.ConfigureBuffers.config,\nwhen calling memcpy().\n\nThis also helps with the ongoing efforts to globally enable\n-Warray-bounds and get us closer to being able to tighten the\nFORTIFY_SOURCE routines on memcpy().","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmedia: ngene: Fix out-of-bounds bug in ngene_command_config_free_buf()\n\nFix an 11-year old bug in ngene_command_config_free_buf() while\naddressing the following warnings caught with -Warray-bounds:\n\narch/alpha/include/asm/string.h:22:16: warning: '__builtin_memcpy' offset [12, 16] from the object at 'com' is out of the bounds of referenced subobject 'config' with type 'unsigned char' at offset 10 [-Warray-bounds]\narch/x86/include/asm/string_32.h:182:25: warning: '__builtin_memcpy' offset [12, 16] from the object at 'com' is out of the bounds of referenced subobject 'config' with type 'unsigned char' at offset 10 [-Warray-bounds]\n\nThe problem is that the original code is trying to copy 6 bytes of\ndata into a one-byte size member _config_ of the wrong structue\nFW_CONFIGURE_BUFFERS, in a single call to memcpy(). This causes a\nlegitimate compiler warning because memcpy() overruns the length\nof &com.cmd.ConfigureBuffers.config. It seems that the right\nstructure is FW_CONFIGURE_FREE_BUFFERS, instead, because it contains\n6 more members apart from the header _hdr_. Also, the name of\nthe function ngene_command_config_free_buf() suggests that the actual\nintention is to ConfigureFreeBuffers, instead of ConfigureBuffers\n(which takes place in the function ngene_command_config_buf(), above).\n\nFix this by enclosing those 6 members of struct FW_CONFIGURE_FREE_BUFFERS\ninto new struct config, and use &com.cmd.ConfigureFreeBuffers.config as\nthe destination address, instead of &com.cmd.ConfigureBuffers.config,\nwhen calling memcpy().\n\nThis also helps with the ongoing efforts to globally enable\n-Warray-bounds and get us closer to being able to tighten the\nFORTIFY_SOURCE routines on memcpy().","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se resolvió la siguiente vulnerabilidad: medios: ngene: corrige un error fuera de los límites en ngene_command_config_free_buf(). Corrige un error de hace 11 años en ngene_command_config_free_buf() mientras se solucionan las siguientes advertencias detectadas con -Warray-bounds: arch/alpha/include/asm/string.h:22:16: advertencia: el desplazamiento '__builtin_memcpy' [12, 16] del objeto en 'com' está fuera de los límites del subobjeto referenciado 'config' con tipo 'carácter sin firmar ' en el desplazamiento 10 [-Warray-bounds] arch/x86/include/asm/string_32.h:182:25: advertencia: el desplazamiento '__builtin_memcpy' [12, 16] del objeto en 'com' está fuera de los límites de subobjeto referenciado 'config' con tipo 'unsigned char' en el desplazamiento 10 [-Warray-bounds] El problema es que el código original está intentando copiar 6 bytes de datos en un miembro de tamaño de un byte _config_ de la estructura incorrecta FW_CONFIGURE_BUFFERS, en una sola llamada a memcpy(). Esto provoca una advertencia legítima del compilador porque memcpy() sobrepasa la longitud de &amp;com.cmd.ConfigureBuffers.config. Parece que la estructura correcta es FW_CONFIGURE_FREE_BUFFERS, porque contiene 6 miembros más además del encabezado _hdr_. Además, el nombre de la función ngene_command_config_free_buf() sugiere que la intención real es ConfigureFreeBuffers, en lugar de ConfigureBuffers (que tiene lugar en la función ngene_command_config_buf(), arriba). Solucione este problema encerrando esos 6 miembros de la estructura FW_CONFIGURE_FREE_BUFFERS en una nueva configuración de estructura y use &amp;com.cmd.ConfigureFreeBuffers.config como dirección de destino, en lugar de &amp;com.cmd.ConfigureBuffers.config, al llamar a memcpy(). Esto también ayuda con los esfuerzos continuos para habilitar globalmente -Warray-bounds y acercarnos a poder ajustar las rutinas FORTIFY_SOURCE en memcpy().","source":"nvd"}],"published":"2024-05-21T14:34:51.776Z","modified":"2026-06-17T04:17:06.677Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":7.1,"rating":"HIGH"}],"cwes":["CWE-125"],"affected":[{"ranges":[{"type":"git","introduced":"dae52d009fc950b5c209260d50fcc000f5becd3c","fixed":"4487b968e5eacd02c493303dc2b61150bb7fe4b2","status":"affected"},{"type":"git","introduced":"dae52d009fc950b5c209260d50fcc000f5becd3c","fixed":"c6ddeb63dd543b5474b0217c4e47538b7ffd7686","status":"affected"},{"type":"git","introduced":"dae52d009fc950b5c209260d50fcc000f5becd3c","fixed":"e818f2ff648581a6c553ae2bebc5dcef9a8bb90c","status":"affected"},{"type":"git","introduced":"dae52d009fc950b5c209260d50fcc000f5becd3c","fixed":"ec731c6ef564ee6fc101fc5d73e3a3a953d09a00","status":"affected"},{"type":"git","introduced":"dae52d009fc950b5c209260d50fcc000f5becd3c","fixed":"e617fa62f6cf859a7b042cdd6c73af905ff8fca3","status":"affected"},{"type":"git","introduced":"dae52d009fc950b5c209260d50fcc000f5becd3c","fixed":"e991457afdcb5f4dbc5bc9d79eaf775be33e7092","status":"affected"},{"type":"git","introduced":"dae52d009fc950b5c209260d50fcc000f5becd3c","fixed":"b9a178f189bb6d75293573e181928735f5e3e070","status":"affected"},{"type":"git","introduced":"dae52d009fc950b5c209260d50fcc000f5becd3c","fixed":"8d4abca95ecc82fc8c41912fa0085281f19cc29f","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"2.6.34","status":"affected"},{"type":"semver","introduced":"0","fixed":"2.6.34","status":"unaffected"},{"type":"semver","introduced":"4.4.277","lastAffected":"4.4.*","status":"unaffected"},{"type":"semver","introduced":"4.9.277","lastAffected":"4.9.*","status":"unaffected"},{"type":"semver","introduced":"4.14.241","lastAffected":"4.14.*","status":"unaffected"},{"type":"semver","introduced":"4.19.199","lastAffected":"4.19.*","status":"unaffected"},{"type":"semver","introduced":"5.4.136","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.54","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.13.6","lastAffected":"5.13.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"5.14","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"2.6.34","fixed":"4.4.277"},{"status":"affected","introduced":"4.5","fixed":"4.9.277"},{"status":"affected","introduced":"4.10","fixed":"4.14.241"},{"status":"affected","introduced":"4.15","fixed":"4.19.199"},{"status":"affected","introduced":"4.20","fixed":"5.4.136"},{"status":"affected","introduced":"5.5","fixed":"5.10.54"},{"status":"affected","introduced":"5.11","fixed":"5.13.6"},{"status":"affected","version":"5.14"},{"status":"affected","version":"5.14"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/4487b968e5eacd02c493303dc2b61150bb7fe4b2","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c6ddeb63dd543b5474b0217c4e47538b7ffd7686","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e818f2ff648581a6c553ae2bebc5dcef9a8bb90c","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ec731c6ef564ee6fc101fc5d73e3a3a953d09a00","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e617fa62f6cf859a7b042cdd6c73af905ff8fca3","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e991457afdcb5f4dbc5bc9d79eaf775be33e7092","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b9a178f189bb6d75293573e181928735f5e3e070","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/8d4abca95ecc82fc8c41912fa0085281f19cc29f","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-05-21T18:48:38.044Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-47288","url":"https://www.cve.org/CVERecord?id=CVE-2021-47288","licence":"CVE Terms of Use","modified":"2026-05-11T13:51:35.497Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-47288","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-47288","licence":"Public domain","modified":"2026-06-17T04:17:06.677Z"}],"updatedAt":"2026-11-25T22:58:08.778Z","epss":{"score":0.00318,"percentile":0.17101,"date":"2026-11-30T12:00:22.000Z"}}