CVE-2026-31742 Details
Description
In the Linux kernel, the following vulnerability has been resolved: vt: discard stale unicode buffer on alt screen exit after resize When enter_alt_screen() saves vc_uni_lines into vc_saved_uni_lines and sets vc_uni_lines to NULL, a subsequent console resize via vc_do_resize() skips reallocating the unicode buffer because vc_uni_lines is NULL. However, vc_saved_uni_lines still points to the old buffer allocated for the original dimensions. When leave_alt_screen() later restores vc_saved_uni_lines, the buffer dimensions no longer match vc_rows/vc_cols. Any operation that iterates over the unicode buffer using the current dimensions (e.g. csi_J clearing the screen) will access memory out of bounds, causing a kernel oops: BUG: unable to handle page fault for address: 0x0000002000000020 RIP: 0010:csi_J+0x133/0x2d0 The faulting address 0x0000002000000020 is two adjacent u32 space characters (0x20) interpreted as a pointer, read from the row data area past the end of the 25-entry pointer array in a buffer allocated for 80x25 but accessed with 240x67 dimensions. Fix this by checking whether the console dimensions changed while in the alternate screen. If they did, free the stale saved buffer instead of restoring it. The unicode screen will be lazily rebuilt via vc_uniscr_check() when next needed.
A vulnerability in the Linux kernel's virtual terminal (VT) driver can lead to out-of-bounds memory access, causing a kernel oops. This issue arises when the console is resized while in an alternate screen mode, leading to a mismatch between the dimensions of the Unicode buffer and the actual console size. The problem occurs in the VT driver when the 'enter_alt_screen' function saves the current Unicode line data and then a console resize operation is performed. The resize operation skips reallocating the Unicode buffer because the pointer to the current buffer is set to NULL. However, the saved pointer still points to the old buffer, which can no longer accommodate the current dimensions. As a result, any operation that clears the screen using the current dimensions will access memory beyond the allocated buffer, causing a page fault and a kernel oops. This vulnerability affects the Linux kernel stable tree.
The vulnerability has been fixed in the Linux kernel. Users should upgrade to the latest version of the stable Linux kernel to address this issue.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
No SSVC data is available for this CVE.
References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://git.kernel.org/stable/c/40014493cece72a0be5672cd86763e53fb3ec613 | kernel.org | Patch |
| https://git.kernel.org/stable/c/428fdf55301e6c8fa5a36b426240797b1cf86570 | kernel.org | Patch |
| https://git.kernel.org/stable/c/891d790fdb5c96c6e1d2841e06ee6c360f2d1288 | kernel.org | Patch |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-125 | Out-of-bounds Read | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| linux linux kernel | >= 6.18.20, < 6.18.22 >= 6.19.10, < 6.19.12 7.0 rc5 7.0 rc6 |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | kernel.org |
| May 7, 2026 | Initial Analysis | [email protected] |
| May 3, 2026 | CVE Modified | kernel.org |
| May 1, 2026 | New CVE Received | kernel.org |