{"id":"CVE-2026-31478","aliases":["CVE-2026-31478"],"related":[],"kind":"vulnerability","state":"published","title":"ksmbd: replace hardcoded hdr2_len with offsetof() in smb2_calc_max_out_buf_len()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: replace hardcoded hdr2_len with offsetof() in smb2_calc_max_out_buf_len()\n\nAfter this commit (e2b76ab8b5c9 \"ksmbd: add support for read compound\"),\nresponse buffer management was changed to use dynamic iov array.\nIn the new design, smb2_calc_max_out_buf_len() expects the second\nargument (hdr2_len) to be the offset of ->Buffer field in the\nresponse structure, not a hardcoded magic number.\nFix the remaining call sites to use the correct offsetof() value.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: replace hardcoded hdr2_len with offsetof() in smb2_calc_max_out_buf_len()\n\nAfter this commit (e2b76ab8b5c9 \"ksmbd: add support for read compound\"),\nresponse buffer management was changed to use dynamic iov array.\nIn the new design, smb2_calc_max_out_buf_len() expects the second\nargument (hdr2_len) to be the offset of ->Buffer field in the\nresponse structure, not a hardcoded magic number.\nFix the remaining call sites to use the correct offsetof() value.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nksmbd: reemplazar hdr2_len codificado de forma rígida con offsetof() en smb2_calc_max_out_buf_len()\n\nDespués de este commit (e2b76ab8b5c9 ’ksmbd: añadir soporte para read compound’), la gestión del búfer de respuesta fue cambiada para usar un array iov dinámico. En el nuevo diseño, smb2_calc_max_out_buf_len() espera que el segundo argumento (hdr2_len) sea el desplazamiento del campo   ->  Buffer en la estructura de respuesta, no un número mágico codificado de forma rígida. Corregir los sitios de llamada restantes para usar el valor correcto de offsetof().","source":"nvd"}],"published":"2026-04-22T13:54:06.157Z","modified":"2026-11-11T23:10:00.263Z","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-131"],"affected":[{"ranges":[{"type":"git","introduced":"f2283680a80571ca82d710bc6ecd8f8beac67d63","fixed":"70b4c414889492c522b6e4331562360f49be2361","status":"affected"},{"type":"git","introduced":"9f297df20d93411c0b4ddad7f88ba04a7cd36e77","fixed":"9a7166f0ef8cbb7bb48dd05e2471d995566003f5","status":"affected"},{"type":"git","introduced":"e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d","fixed":"c3a89e3ec1ccf64fa6a34e391e1581ebbcba8683","status":"affected"},{"type":"git","introduced":"e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d","fixed":"6aef1765d6807e0f027cd87f6ac973eb0879a46d","status":"affected"},{"type":"git","introduced":"e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d","fixed":"80824c7e527b70cf9039534e60aff592e8f209d1","status":"affected"},{"type":"git","introduced":"e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d","fixed":"4cb537ae4f37d7d0f617815ed4bed7173fb50861","status":"affected"},{"type":"git","introduced":"e2b76ab8b5c9327ab2dae6da05d0752eb2f4771d","fixed":"0e55f63dd08f09651d39e1b709a91705a8a0ddcb","status":"affected"},{"type":"semver","introduced":"5.15.145","fixed":"5.15.203","status":"affected"},{"type":"semver","introduced":"6.1.71","fixed":"6.1.168","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.203","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.168","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.131","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.80","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.21","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.11","lastAffected":"6.19.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.0","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.15.203"},{"status":"affected","introduced":"6.1.71","fixed":"6.1.168"},{"status":"affected","introduced":"6.6.1","fixed":"6.6.131"},{"status":"affected","introduced":"6.7","fixed":"6.12.80"},{"status":"affected","introduced":"6.13","fixed":"6.18.21"},{"status":"affected","introduced":"6.19","fixed":"6.19.11"},{"status":"affected","version":"6.6"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/70b4c414889492c522b6e4331562360f49be2361","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9a7166f0ef8cbb7bb48dd05e2471d995566003f5","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c3a89e3ec1ccf64fa6a34e391e1581ebbcba8683","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6aef1765d6807e0f027cd87f6ac973eb0879a46d","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/80824c7e527b70cf9039534e60aff592e8f209d1","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/4cb537ae4f37d7d0f617815ed4bed7173fb50861","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0e55f63dd08f09651d39e1b709a91705a8a0ddcb","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-10-16T15:09:58.409Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31478","url":"https://www.cve.org/CVERecord?id=CVE-2026-31478","licence":"CVE Terms of Use","modified":"2026-10-19T18:45:53.152Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31478","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31478","licence":"Public domain","modified":"2026-11-11T23:10:00.263Z"}],"updatedAt":"2026-11-25T22:59:19.282Z","epss":{"score":0.00522,"percentile":0.45787,"date":"2026-12-01T12:00:22.000Z"}}