CVE-2025-40304

fbdev: Add bounds checking in bit_putcs to fix vmalloc-out-of-bounds

State
Published
Severity
7.8 High
Published
Dec 8, 2025
Updated
Aug 5, 2026
Reserved
Apr 16, 2025

Read the record on cve.org

Description

In the Linux kernel, the following vulnerability has been resolved:

fbdev: Add bounds checking in bit_putcs to fix vmalloc-out-of-bounds

Add bounds checking to prevent writes past framebuffer boundaries when rendering text near screen edges. Return early if the Y position is off-screen and clip image height to screen boundary. Break from the rendering loop if the X position is off-screen. When clipping image width to fit the screen, update the character count to match the clipped width to prevent buffer size mismatches.

Without the character count update, bit_putcs_aligned and bit_putcs_unaligned receive mismatched parameters where the buffer is allocated for the clipped width but cnt reflects the original larger count, causing out-of-bounds writes.

Scores

CVSSScoreVectorSource
3.17.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HLinux

Weaknesses

The record names no weakness.

Affected Products

ProductVersions
LinuxLinux
  • 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 to before 996bfaa7372d6718b6d860bdf78f6618e850c702Affected
  • 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 to before f0982400648a3e00580253e0c48e991f34d2684cAffected
  • 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 to before 1943b69e87b0ab35032d47de0a7fca9a3d1d6fc1Affected
  • 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 to before ebc0730b490c7f27340b1222e01dd106e820320dAffected
  • 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 to before 86df8ade88d290725554cefd03101ecd0fbd3752Affected
  • 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 to before 15ba9acafb0517f8359ca30002c189a68ddbb939Affected
  • 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 to before 2d1359e11674ed4274934eac8a71877ae5ae7bbbAffected
  • 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 to before 3637d34b35b287ab830e66048841ace404382b67Affected
LinuxLinux
  • 2.6.12Affected
  • before 2.6.12Not affected
  • 5.4.302 through 5.4.*Not affected
  • 5.10.247 through 5.10.*Not affected
  • 5.15.197 through 5.15.*Not affected
  • 6.1.159 through 6.1.*Not affected
  • 6.6.117 through 6.6.*Not affected
  • 6.12.58 through 6.12.*Not affected
  • 6.17.8 through 6.17.*Not affected
  • 6.18 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.