{"id":"CVE-2026-31705","aliases":["CVE-2026-31705"],"related":[],"kind":"vulnerability","state":"published","title":"ksmbd: fix out-of-bounds write in smb2_get_ea() EA alignment","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix out-of-bounds write in smb2_get_ea() EA alignment\n\nsmb2_get_ea() applies 4-byte alignment padding via memset() after\nwriting each EA entry. The bounds check on buf_free_len is performed\nbefore the value memcpy, but the alignment memset fires unconditionally\nafterward with no check on remaining space.\n\nWhen the EA value exactly fills the remaining buffer (buf_free_len == 0\nafter value subtraction), the alignment memset writes 1-3 NUL bytes\npast the buf_free_len boundary. In compound requests where the response\nbuffer is shared across commands, the first command (e.g., READ) can\nconsume most of the buffer, leaving a tight remainder for the QUERY_INFO\nEA response. The alignment memset then overwrites past the physical\nkvmalloc allocation into adjacent kernel heap memory.\n\nAdd a bounds check before the alignment memset to ensure buf_free_len\ncan accommodate the padding bytes.\n\nThis is the same bug pattern fixed by commit beef2634f81f (\"ksmbd: fix\npotencial OOB in get_file_all_info() for compound requests\") and\ncommit fda9522ed6af (\"ksmbd: fix OOB write in QUERY_INFO for compound\nrequests\"), both of which added bounds checks before unconditional\nwrites in QUERY_INFO response handlers.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix out-of-bounds write in smb2_get_ea() EA alignment\n\nsmb2_get_ea() applies 4-byte alignment padding via memset() after\nwriting each EA entry. The bounds check on buf_free_len is performed\nbefore the value memcpy, but the alignment memset fires unconditionally\nafterward with no check on remaining space.\n\nWhen the EA value exactly fills the remaining buffer (buf_free_len == 0\nafter value subtraction), the alignment memset writes 1-3 NUL bytes\npast the buf_free_len boundary. In compound requests where the response\nbuffer is shared across commands, the first command (e.g., READ) can\nconsume most of the buffer, leaving a tight remainder for the QUERY_INFO\nEA response. The alignment memset then overwrites past the physical\nkvmalloc allocation into adjacent kernel heap memory.\n\nAdd a bounds check before the alignment memset to ensure buf_free_len\ncan accommodate the padding bytes.\n\nThis is the same bug pattern fixed by commit beef2634f81f (\"ksmbd: fix\npotencial OOB in get_file_all_info() for compound requests\") and\ncommit fda9522ed6af (\"ksmbd: fix OOB write in QUERY_INFO for compound\nrequests\"), both of which added bounds checks before unconditional\nwrites in QUERY_INFO response handlers.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nksmbd: corrección de escritura fuera de límites en la alineación de EA de smb2_get_ea()\n\nsmb2_get_ea() aplica relleno de alineación de 4 bytes a través de memset() después de escribir cada entrada de EA. La comprobación de límites en buf_free_len se realiza antes del memcpy del valor, pero el memset de alineación se activa incondicionalmente después sin una comprobación del espacio restante.\n\nCuando el valor de EA llena exactamente el búfer restante (buf_free_len == 0 después de la resta del valor), el memset de alineación escribe de 1 a 3 bytes NUL más allá del límite de buf_free_len. En solicitudes compuestas donde el búfer de respuesta se comparte entre comandos, el primer comando (p. ej., READ) puede consumir la mayor parte del búfer, dejando un resto ajustado para la respuesta de EA de QUERY_INFO. El memset de alineación luego sobrescribe más allá de la asignación física de kvmalloc en la memoria adyacente del heap del kernel.\n\nAñadir una comprobación de límites antes del memset de alineación para asegurar que buf_free_len pueda acomodar los bytes de relleno.\n\nEste es el mismo patrón de error corregido por el commit beef2634f81f (’ksmbd: fix potencial OOB in get_file_all_info() for compound requests’) y el commit fda9522ed6af (’ksmbd: fix OOB write in QUERY_INFO for compound requests’), ambos de los cuales añadieron comprobaciones de límites antes de escrituras incondicionales en los manejadores de respuesta de QUERY_INFO.","source":"nvd"}],"published":"2026-05-01T13:56:03.896Z","modified":"2026-11-23T08:17:16.123Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-787"],"affected":[{"ranges":[{"type":"git","introduced":"f2283680a80571ca82d710bc6ecd8f8beac67d63","fixed":"1616f77677a30d13baac9fa166999ac1e85f7c61","status":"affected"},{"type":"git","introduced":"9f297df20d93411c0b4ddad7f88ba04a7cd36e77","fixed":"ddbbc8b2a09dd2cfed90871313e3691ae1db08a2","status":"affected"},{"type":"git","introduced":"e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d","fixed":"ffbce350c6fd1e99116ea57383b9031717e36d3b","status":"affected"},{"type":"git","introduced":"e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d","fixed":"98f3de6ef4efbd899348d333f0902dc4ff14380c","status":"affected"},{"type":"git","introduced":"e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d","fixed":"790304c02bf9bd7b8171feda4294d6e62d32ae8f","status":"affected"},{"type":"git","introduced":"e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d","fixed":"922d48fe8c19f388ffa2f709f33acaae4e408de2","status":"affected"},{"type":"git","introduced":"e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d","fixed":"30010c952077a1c89ecdd71fc4d574c75a8f5617","status":"affected"},{"type":"semver","introduced":"5.15.145","fixed":"5.15.226","status":"affected"},{"type":"semver","introduced":"6.1.71","fixed":"6.1.175","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.6","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.6","status":"unaffected"},{"type":"semver","introduced":"5.15.226","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.175","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.136","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.84","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.25","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.0.2","lastAffected":"7.0.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.1","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":"5.15.145","fixed":"5.16"},{"status":"affected","introduced":"6.1.71","fixed":"6.2"},{"status":"affected","introduced":"6.6","fixed":"6.6.136"},{"status":"affected","introduced":"6.7","fixed":"6.12.84"},{"status":"affected","introduced":"6.13","fixed":"6.18.25"},{"status":"affected","introduced":"6.19","fixed":"7.0.2"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/1616f77677a30d13baac9fa166999ac1e85f7c61","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ddbbc8b2a09dd2cfed90871313e3691ae1db08a2","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ffbce350c6fd1e99116ea57383b9031717e36d3b","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/98f3de6ef4efbd899348d333f0902dc4ff14380c","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/790304c02bf9bd7b8171feda4294d6e62d32ae8f","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/922d48fe8c19f388ffa2f709f33acaae4e408de2","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/30010c952077a1c89ecdd71fc4d574c75a8f5617","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-784472.html","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31705","url":"https://www.cve.org/CVERecord?id=CVE-2026-31705","licence":"CVE Terms of Use","modified":"2026-11-23T07:58:43.687Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31705","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31705","licence":"Public domain","modified":"2026-11-23T08:17:16.123Z"}],"updatedAt":"2026-11-25T22:59:20.339Z","epss":{"score":0.00414,"percentile":0.37767,"date":"2026-12-01T12:00:22.000Z"}}