{"id":"CVE-2022-50131","summary":"HID: mcp2221: prevent a buffer overflow in mcp_smbus_write()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nHID: mcp2221: prevent a buffer overflow in mcp_smbus_write()\n\nSmatch Warning:\ndrivers/hid/hid-mcp2221.c:388 mcp_smbus_write() error: __memcpy()\n'&mcp-\u003etxbuf[5]' too small (59 vs 255)\ndrivers/hid/hid-mcp2221.c:388 mcp_smbus_write() error: __memcpy() 'buf'\ntoo small (34 vs 255)\n\nThe 'len' variable can take a value between 0-255 as it can come from\ndata-\u003eblock[0] and it is user data. So add an bound check to prevent a\nbuffer overflow in memcpy().","modified":"2026-04-03T13:14:32.654764Z","published":"2025-06-18T11:02:56.796Z","related":["SUSE-SU-2025:02264-1","SUSE-SU-2025:02321-1","SUSE-SU-2025:02322-1","SUSE-SU-2025:02537-1"],"database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50131.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/3c0f8a59f2cc8841ee6653399a77f4f3e6e9a270"},{"type":"WEB","url":"https://git.kernel.org/stable/c/62ac2473553a00229e67bdf3cb023b62cf7f5a9a"},{"type":"WEB","url":"https://git.kernel.org/stable/c/6402116a7b5ec80fa40fd145a80c813019cd555f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/66c8e816f2f2ca4a61b406503bd10bad1b35f72f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/91443c669d280937968f0aa4edefa741cfe35314"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50131.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50131"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"67a95c21463d066060b0f66d65a75d45bb386ffb"},{"fixed":"66c8e816f2f2ca4a61b406503bd10bad1b35f72f"},{"fixed":"91443c669d280937968f0aa4edefa741cfe35314"},{"fixed":"6402116a7b5ec80fa40fd145a80c813019cd555f"},{"fixed":"3c0f8a59f2cc8841ee6653399a77f4f3e6e9a270"},{"fixed":"62ac2473553a00229e67bdf3cb023b62cf7f5a9a"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50131.json"}}],"schema_version":"1.7.5"}