{"id":"CVE-2025-40304","aliases":["CVE-2025-40304"],"related":[],"kind":"vulnerability","state":"published","title":"fbdev: Add bounds checking in bit_putcs to fix vmalloc-out-of-bounds","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nfbdev: Add bounds checking in bit_putcs to fix vmalloc-out-of-bounds\n\nAdd bounds checking to prevent writes past framebuffer boundaries when\nrendering text near screen edges. Return early if the Y position is off-screen\nand clip image height to screen boundary. Break from the rendering loop if the\nX position is off-screen. When clipping image width to fit the screen, update\nthe character count to match the clipped width to prevent buffer size\nmismatches.\n\nWithout the character count update, bit_putcs_aligned and bit_putcs_unaligned\nreceive mismatched parameters where the buffer is allocated for the clipped\nwidth but cnt reflects the original larger count, causing out-of-bounds writes.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nfbdev: Add bounds checking in bit_putcs to fix vmalloc-out-of-bounds\n\nAdd bounds checking to prevent writes past framebuffer boundaries when\nrendering text near screen edges. Return early if the Y position is off-screen\nand clip image height to screen boundary. Break from the rendering loop if the\nX position is off-screen. When clipping image width to fit the screen, update\nthe character count to match the clipped width to prevent buffer size\nmismatches.\n\nWithout the character count update, bit_putcs_aligned and bit_putcs_unaligned\nreceive mismatched parameters where the buffer is allocated for the clipped\nwidth but cnt reflects the original larger count, causing out-of-bounds writes.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nfbdev: Añadir comprobación de límites en bit_putcs para corregir vmalloc-fuera-de-límites\n\nAñadir comprobación de límites para evitar escrituras más allá de los límites del framebuffer al renderizar texto cerca de los bordes de la pantalla. Retornar anticipadamente si la posición Y está fuera de la pantalla y recortar la altura de la imagen al límite de la pantalla. Salir del bucle de renderizado si la posición X está fuera de la pantalla. Al recortar el ancho de la imagen para ajustarse a la pantalla, actualizar el recuento de caracteres para que coincida con el ancho recortado para evitar desajustes de tamaño de búfer.\n\nSin la actualización del recuento de caracteres, bit_putcs_aligned y bit_putcs_unaligned reciben parámetros desajustados donde el búfer se asigna para el ancho recortado pero cnt refleja el recuento original mayor, causando escrituras fuera de límites.","source":"nvd"}],"published":"2025-12-08T00:46:29.013Z","modified":"2026-10-14T22:10:00.210Z","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"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"996bfaa7372d6718b6d860bdf78f6618e850c702","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"f0982400648a3e00580253e0c48e991f34d2684c","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"1943b69e87b0ab35032d47de0a7fca9a3d1d6fc1","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"ebc0730b490c7f27340b1222e01dd106e820320d","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"86df8ade88d290725554cefd03101ecd0fbd3752","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"15ba9acafb0517f8359ca30002c189a68ddbb939","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"2d1359e11674ed4274934eac8a71877ae5ae7bbb","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"3637d34b35b287ab830e66048841ace404382b67","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"2.6.12","status":"affected"},{"type":"semver","introduced":"0","fixed":"2.6.12","status":"unaffected"},{"type":"semver","introduced":"5.4.302","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.247","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.197","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.159","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.117","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.58","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.17.8","lastAffected":"6.17.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.18","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/996bfaa7372d6718b6d860bdf78f6618e850c702","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f0982400648a3e00580253e0c48e991f34d2684c","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/1943b69e87b0ab35032d47de0a7fca9a3d1d6fc1","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ebc0730b490c7f27340b1222e01dd106e820320d","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/86df8ade88d290725554cefd03101ecd0fbd3752","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/15ba9acafb0517f8359ca30002c189a68ddbb939","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/2d1359e11674ed4274934eac8a71877ae5ae7bbb","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3637d34b35b287ab830e66048841ace404382b67","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-06-16T19:54:32.739Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-40304","url":"https://www.cve.org/CVERecord?id=CVE-2025-40304","licence":"CVE Terms of Use","modified":"2026-08-05T12:09:23.704Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-40304","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-40304","licence":"Public domain","modified":"2026-10-14T22:10:00.210Z"}],"updatedAt":"2026-11-25T22:59:08.396Z","epss":{"score":0.00233,"percentile":0.08527,"date":"2026-11-30T12:00:22.000Z"}}