{"id":"CVE-2026-138843","aliases":["CVE-2026-138843"],"related":[],"kind":"vulnerability","state":"published","title":"usb: typec: ucsi: ccg: Validate altmode index in GET_CURRENT_CAM response","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: typec: ucsi: ccg: Validate altmode index in GET_CURRENT_CAM response\n\nWhen the PPM reports more than one DisplayPort alternate mode for a\nconnector, ucsi_ccg_update_altmodes() merges them into a single entry\nin uc->updated[] and sets uc->has_multiple_dp. In that case,\nucsi_ccg_update_get_current_cam_cmd() rewrites the response of the\nGET_CURRENT_CAM command. The response is a single byte holding the\nindex of the currently active alternate mode, and it is provided by\nthe PPM firmware.\n\nThe function uses this byte directly as an index into uc->orig[], and\nthen uses the linked_idx read from that entry as the translated index\ninto uc->updated[]. Both arrays have UCSI_MAX_ALTMODES entries, but\nneither index is checked against that size.\n\nIf a malicious or buggy PPM reports a value of UCSI_MAX_ALTMODES or\nlarger, e.g. 0xFF, uc->orig[cam].linked_idx reads over the end of\nuc->orig[]. The byte read from there is then used as the index for\nwriting cam into uc->updated[new_cam].active_idx, so the out-of-bounds\nread is followed by an out-of-bounds write. This happens without any\nuserspace action, since the UCSI core issues GET_CURRENT_CAM on its own\nwhen handling connector changes.\n\nFix this by rejecting responses whose index is out of range, printing an\nerror and returning -EPROTO, so that the caller cannot accept this.\nAlso check linked_idx before using it as an index, so that the write into\nuc->updated[] is always within bounds.\n\nThe response is now only processed when the command completed without\nan error. ucsi_sync_control_common() only reads the response when the\nCCI reports command completion, so otherwise the buffer is not filled\nand must not be mistaken for an invalid index.\n\nThis bug was found with a Python script that traces where firmware input\nis used.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: typec: ucsi: ccg: Validate altmode index in GET_CURRENT_CAM response\n\nWhen the PPM reports more than one DisplayPort alternate mode for a\nconnector, ucsi_ccg_update_altmodes() merges them into a single entry\nin uc->updated[] and sets uc->has_multiple_dp. In that case,\nucsi_ccg_update_get_current_cam_cmd() rewrites the response of the\nGET_CURRENT_CAM command. The response is a single byte holding the\nindex of the currently active alternate mode, and it is provided by\nthe PPM firmware.\n\nThe function uses this byte directly as an index into uc->orig[], and\nthen uses the linked_idx read from that entry as the translated index\ninto uc->updated[]. Both arrays have UCSI_MAX_ALTMODES entries, but\nneither index is checked against that size.\n\nIf a malicious or buggy PPM reports a value of UCSI_MAX_ALTMODES or\nlarger, e.g. 0xFF, uc->orig[cam].linked_idx reads over the end of\nuc->orig[]. The byte read from there is then used as the index for\nwriting cam into uc->updated[new_cam].active_idx, so the out-of-bounds\nread is followed by an out-of-bounds write. This happens without any\nuserspace action, since the UCSI core issues GET_CURRENT_CAM on its own\nwhen handling connector changes.\n\nFix this by rejecting responses whose index is out of range, printing an\nerror and returning -EPROTO, so that the caller cannot accept this.\nAlso check linked_idx before using it as an index, so that the write into\nuc->updated[] is always within bounds.\n\nThe response is now only processed when the command completed without\nan error. ucsi_sync_control_common() only reads the response when the\nCCI reports command completion, so otherwise the buffer is not filled\nand must not be mistaken for an invalid index.\n\nThis bug was found with a Python script that traces where firmware input\nis used.","source":"cvelist"}],"published":"2026-11-30T13:25:30.059Z","modified":"2026-11-30T14:17:39.663Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"170a6726d0e266f2c8f306e3d61715c32f4ee41e","fixed":"24376aa9ad111077bd018796ba22848db52db920","status":"affected"},{"type":"git","introduced":"170a6726d0e266f2c8f306e3d61715c32f4ee41e","fixed":"9b73d02a9d5d56efa4528622370db1e364628b24","status":"affected"},{"type":"git","introduced":"170a6726d0e266f2c8f306e3d61715c32f4ee41e","fixed":"b46052b769919a02b1be360a93ff9379b1a5fd49","status":"affected"},{"type":"git","introduced":"170a6726d0e266f2c8f306e3d61715c32f4ee41e","fixed":"906bd29c833c0c21835da69044b85b9dce723f80","status":"affected"},{"type":"git","introduced":"170a6726d0e266f2c8f306e3d61715c32f4ee41e","fixed":"7eae4d201b568ee3a6dc5f143b5f5ee9563c3d60","status":"affected"},{"type":"git","introduced":"170a6726d0e266f2c8f306e3d61715c32f4ee41e","fixed":"5d254d1e59da5b4bb05025924220faabb255b48f","status":"affected"},{"type":"git","introduced":"170a6726d0e266f2c8f306e3d61715c32f4ee41e","fixed":"8e3cb6de2c5108cad19541055b60fc4400f97dde","status":"affected"},{"type":"git","introduced":"170a6726d0e266f2c8f306e3d61715c32f4ee41e","fixed":"02ee864e8d2142c5648998944c3306ea6a763c26","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.6","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.6","status":"unaffected"},{"type":"semver","introduced":"5.10.275","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.226","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.193","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.163","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.118","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.63","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.4","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/24376aa9ad111077bd018796ba22848db52db920","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9b73d02a9d5d56efa4528622370db1e364628b24","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b46052b769919a02b1be360a93ff9379b1a5fd49","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/906bd29c833c0c21835da69044b85b9dce723f80","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7eae4d201b568ee3a6dc5f143b5f5ee9563c3d60","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5d254d1e59da5b4bb05025924220faabb255b48f","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/8e3cb6de2c5108cad19541055b60fc4400f97dde","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/02ee864e8d2142c5648998944c3306ea6a763c26","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-138843","url":"https://www.cve.org/CVERecord?id=CVE-2026-138843","licence":"CVE Terms of Use","modified":"2026-11-30T13:25:30.059Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-138843","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138843","licence":"Public domain","modified":"2026-11-30T14:17:39.663Z"}],"updatedAt":"2026-11-30T14:32:25.345Z","epss":{"score":0.00221,"percentile":0.13461,"date":"2026-12-01T12:00:22.000Z"}}