CVE-2025-40304
fbdev: Add bounds checking in bit_putcs to fix vmalloc-out-of-bounds
Reported by linux · Published December 8, 2025
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| kernel | Amazon Linux | 1:6.1.159-181.297.amzn2023 |
| kernel-libbpf-static | Amazon Linux | 1:6.1.159-181.297.amzn2023 |
| kernel6.12-modules-extra | Amazon Linux | 1:6.12.58-82.121.amzn2023 |
| kernel-libbpf-devel | Amazon Linux | 1:6.1.159-181.297.amzn2023 |
| bpftool6.12 | Amazon Linux | 1:6.12.58-82.121.amzn2023 |
| kernel6.12-tools-devel | Amazon Linux | 1:6.12.58-82.121.amzn2023 |
| kernel-libbpf | Amazon Linux | 1:6.1.159-181.297.amzn2023 |
| python3-perf6.12 | Amazon Linux | 1:6.12.58-82.121.amzn2023 |
| kernel6.12 | Amazon Linux | 1:6.12.58-82.121.amzn2023 |
| kernel-devel | Amazon Linux | 1:6.1.159-181.297.amzn2023 |
| python3-perf | Amazon Linux | 1:6.1.159-181.297.amzn2023 |
| kernel-modules-extra-common | Amazon Linux | 1:6.1.159-181.297.amzn2023 |
7 more packages have a fixed version. See every fix in Lookup.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 |
| Linux | Linux | 2.6.12, 0, 5.4.302 |
| linux | linux_kernel | 2.6.12, 2.6.12, 2.6.12 |
| amazon:2023 | kernel | 0 |
| amazon:2023 | kernel-libbpf-static | 0 |
| amazon:2023 | kernel6.12-modules-extra | 0 |
| amazon:2023 | kernel-libbpf-devel | 0 |
| amazon:2023 | bpftool6.12 | 0 |
| amazon:2023 | kernel6.12-tools-devel | 0 |
| amazon:2023 | kernel-libbpf | 0 |
| amazon:2023 | python3-perf6.12 | 0 |
| amazon:2023 | kernel6.12 | 0 |
| amazon:2023 | kernel-devel | 0 |
| amazon:2023 | python3-perf | 0 |
| amazon:2023 | kernel-modules-extra-common | 0 |
| amazon:2023 | kernel6.12-libbpf | 0 |
| amazon:2023 | bpftool | 0 |
| amazon:2023 | kernel-tools-devel | 0 |
| amazon:2023 | kernel6.12-libbpf-devel | 0 |
| amazon:2023 | perf | 0 |
…and 12 more
Timeline
- Dec 7, 2025 CVE Published
- Dec 8, 2025 EPSS Score (30 in total, the first dated here)
- Mar 29, 2026 Distribution Patch (184 in total, the first dated here)
- Mar 29, 2026 Security Advisory (223 in total, the first dated here)
- Jun 8, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2025-40304
vulnetix vdb fixes CVE-2025-40304
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2025-40304/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart