{"id":"CVE-2025-40304","summary":"fbdev: Add bounds checking in bit_putcs to fix vmalloc-out-of-bounds","details":"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.","modified":"2026-03-31T17:29:48.581838Z","published":"2025-12-08T00:46:29.013Z","related":["ALSA-2026:2282","ALSA-2026:2720","ALSA-2026:2722","ALSA-2026:2821","MGASA-2026-0017","MGASA-2026-0018","SUSE-SU-2026:0278-1","SUSE-SU-2026:0281-1","SUSE-SU-2026:0293-1","SUSE-SU-2026:0315-1","SUSE-SU-2026:0316-1","SUSE-SU-2026:20207-1","SUSE-SU-2026:20220-1","SUSE-SU-2026:20228-1","SUSE-SU-2026:20477-1","SUSE-SU-2026:20498-1","SUSE-SU-2026:20845-1","SUSE-SU-2026:20876-1","openSUSE-SU-2026:20145-1"],"database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40304.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/15ba9acafb0517f8359ca30002c189a68ddbb939"},{"type":"WEB","url":"https://git.kernel.org/stable/c/1943b69e87b0ab35032d47de0a7fca9a3d1d6fc1"},{"type":"WEB","url":"https://git.kernel.org/stable/c/2d1359e11674ed4274934eac8a71877ae5ae7bbb"},{"type":"WEB","url":"https://git.kernel.org/stable/c/3637d34b35b287ab830e66048841ace404382b67"},{"type":"WEB","url":"https://git.kernel.org/stable/c/86df8ade88d290725554cefd03101ecd0fbd3752"},{"type":"WEB","url":"https://git.kernel.org/stable/c/996bfaa7372d6718b6d860bdf78f6618e850c702"},{"type":"WEB","url":"https://git.kernel.org/stable/c/ebc0730b490c7f27340b1222e01dd106e820320d"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f0982400648a3e00580253e0c48e991f34d2684c"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40304.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-40304"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2"},{"fixed":"996bfaa7372d6718b6d860bdf78f6618e850c702"},{"fixed":"f0982400648a3e00580253e0c48e991f34d2684c"},{"fixed":"1943b69e87b0ab35032d47de0a7fca9a3d1d6fc1"},{"fixed":"ebc0730b490c7f27340b1222e01dd106e820320d"},{"fixed":"86df8ade88d290725554cefd03101ecd0fbd3752"},{"fixed":"15ba9acafb0517f8359ca30002c189a68ddbb939"},{"fixed":"2d1359e11674ed4274934eac8a71877ae5ae7bbb"},{"fixed":"3637d34b35b287ab830e66048841ace404382b67"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40304.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.6.12"},{"fixed":"5.4.302"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.5.0"},{"fixed":"5.10.247"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.197"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.1.159"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.6.117"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.58"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.17.8"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40304.json"}}],"schema_version":"1.7.5"}