{"id":"CVE-2026-31641","aliases":["CVE-2026-31641"],"related":[],"kind":"vulnerability","state":"published","title":"rxrpc: Fix RxGK token loading to check bounds","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nrxrpc: Fix RxGK token loading to check bounds\n\nrxrpc_preparse_xdr_yfs_rxgk() reads the raw key length and ticket length\nfrom the XDR token as u32 values and passes each through round_up(x, 4)\nbefore using the rounded value for validation and allocation.  When the raw\nlength is >= 0xfffffffd, round_up() wraps to 0, so the bounds check and\nkzalloc both use 0 while the subsequent memcpy still copies the original\n~4 GiB value, producing a heap buffer overflow reachable from an\nunprivileged add_key() call.\n\nFix this by:\n\n (1) Rejecting raw key lengths above AFSTOKEN_GK_KEY_MAX and raw ticket\n     lengths above AFSTOKEN_GK_TOKEN_MAX before rounding, consistent with\n     the caps that the RxKAD path already enforces via AFSTOKEN_RK_TIX_MAX.\n\n (2) Sizing the flexible-array allocation from the validated raw key\n     length via struct_size_t() instead of the rounded value.\n\n (3) Caching the raw lengths so that the later field assignments and\n     memcpy calls do not re-read from the token, eliminating a class of\n     TOCTOU re-parse.\n\nThe control path (valid token with lengths within bounds) is unaffected.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nrxrpc: Fix RxGK token loading to check bounds\n\nrxrpc_preparse_xdr_yfs_rxgk() reads the raw key length and ticket length\nfrom the XDR token as u32 values and passes each through round_up(x, 4)\nbefore using the rounded value for validation and allocation.  When the raw\nlength is >= 0xfffffffd, round_up() wraps to 0, so the bounds check and\nkzalloc both use 0 while the subsequent memcpy still copies the original\n~4 GiB value, producing a heap buffer overflow reachable from an\nunprivileged add_key() call.\n\nFix this by:\n\n (1) Rejecting raw key lengths above AFSTOKEN_GK_KEY_MAX and raw ticket\n     lengths above AFSTOKEN_GK_TOKEN_MAX before rounding, consistent with\n     the caps that the RxKAD path already enforces via AFSTOKEN_RK_TIX_MAX.\n\n (2) Sizing the flexible-array allocation from the validated raw key\n     length via struct_size_t() instead of the rounded value.\n\n (3) Caching the raw lengths so that the later field assignments and\n     memcpy calls do not re-read from the token, eliminating a class of\n     TOCTOU re-parse.\n\nThe control path (valid token with lengths within bounds) is unaffected.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: rxrpc: Solución para la carga de tokens RxGK para verificar los límites rxrpc_preparse_xdr_yfs_rxgk() lee la longitud de clave sin procesar y la longitud de ticket del token XDR como valores u32 y pasa cada uno a través de round_up(x, 4) antes de usar el valor redondeado para validación y asignación. Cuando la longitud sin procesar es mayor o igual que 0x fffffffd, round_up() se ajusta a 0, por lo que la verificación de límites y kzalloc usan 0 mientras que el memcpy posterior aún copia el valor original de ~4 GiB, produciendo un desbordamiento de búfer de pila alcanzable desde una llamada add_key() no privilegiada. Esto se soluciona mediante: (1) Rechazando longitudes de clave sin procesar superiores a AFSTOKEN_GK_KEY_MAX y longitudes de ticket sin procesar superiores a AFSTOKEN_GK_TOKEN_MAX antes del redondeo, consistente con los límites que la ruta RxKAD ya impone a través de AFSTOKEN_RK_TIX_MAX. (2) Dimensionando la asignación de array flexible a partir de la longitud de clave sin procesar validada a través de struct_size_t() en lugar del valor redondeado. (3) Almacenando en caché las longitudes sin procesar para que las asignaciones de campo posteriores y las llamadas memcpy no vuelvan a leer del token, eliminando una clase de re-análisis TOCTOU. La ruta de control (token válido con longitudes dentro de los límites) no se ve afectada.","source":"nvd"}],"published":"2026-04-24T14:44:56.204Z","modified":"2026-11-11T23:10:00.263Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"redhat-SADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H","score":7.3,"rating":"HIGH"}],"cwes":["CWE-125","CWE-190"],"affected":[{"ranges":[{"type":"git","introduced":"0ca100ff4df64f5d0f6c1dd5080c3e096786bea6","fixed":"3e04596cba8a86cbff9c3f4bf0a524a3a488773c","status":"affected"},{"type":"git","introduced":"0ca100ff4df64f5d0f6c1dd5080c3e096786bea6","fixed":"49875b360c2b83a3c226e189c502e501d83e6445","status":"affected"},{"type":"git","introduced":"0ca100ff4df64f5d0f6c1dd5080c3e096786bea6","fixed":"d179a868dd755b0cfcf7582e00943d702b9943b8","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.16","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.16","status":"unaffected"},{"type":"semver","introduced":"6.18.23","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.13","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":[{"type":"rpm","introduced":"0:6.12.0-211.26.1.el10_2","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 10","package":"kernel","cpe":"cpe:/o:redhat:enterprise_linux:10.2","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 10","package":"kpatch-patch","cpe":"cpe:/o:redhat:enterprise_linux:10.2","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 6","package":"kernel","cpe":"cpe:/o:redhat:enterprise_linux:6","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 7","package":"kernel","cpe":"cpe:/o:redhat:enterprise_linux:7","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 7","package":"kernel-rt","cpe":"cpe:/o:redhat:enterprise_linux:7","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 8","package":"kernel","cpe":"cpe:/o:redhat:enterprise_linux:8","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 8","package":"kernel-rt","cpe":"cpe:/o:redhat:enterprise_linux:8","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 9","package":"kernel","cpe":"cpe:/o:redhat:enterprise_linux:9","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 9","package":"kernel-rt","cpe":"cpe:/o:redhat:enterprise_linux:9","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.16.1","fixed":"6.18.23"},{"status":"affected","introduced":"6.19","fixed":"6.19.13"},{"status":"affected","version":"6.16"},{"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/3e04596cba8a86cbff9c3f4bf0a524a3a488773c","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/49875b360c2b83a3c226e189c502e501d83e6445","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d179a868dd755b0cfcf7582e00943d702b9943b8","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-31641","tags":["vdb-entry","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2461548","tags":["issue-tracking","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31641.json","tags":["x-sadp-csaf-vex"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:27288","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:55618","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31641","url":"https://www.cve.org/CVERecord?id=CVE-2026-31641","licence":"CVE Terms of Use","modified":"2026-08-20T12:31:55.191Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31641","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31641","licence":"Public domain","modified":"2026-11-11T23:10:00.263Z"}],"updatedAt":"2026-11-25T22:59:19.528Z","epss":{"score":0.00148,"percentile":0.04223,"date":"2026-12-01T12:00:22.000Z"}}