CVE-2026-143009: vt: serialise the producers of the flip buffer
In the Linux kernel, the following vulnerability has been resolved:
vt: serialise the producers of the flip buffer
Typing on a virtual console while the console replies to an escape sequence can make the kernel write past the end of a buffer. A user who can write to the foreground console can cause this on purpose if they can also inject key events, through /dev/uinput or by writing to the /dev/input/event node of a keyboard.
Input for a tty goes through the flip buffer of its port. A driver inserts the data with ttyinsertflip() and then calls ttyflipbufferpush() to pass it on to the line discipline. The insert functions take no lock: they check that the current struct ttybuffer has room, copy the data to offset ->used, and then advance ->used. So a flip buffer supports only one producer at a time, and a driver that has several must serialise them.
Four functions feed the flip buffer of a virtual console:
- putqueue(), putsqueue() and fnsendintr() insert typed characters and breaks for the keyboard handler. They run under kbdeventlock. - respondstring() inserts the reply when a program writes an escape sequence that requests one, such as a cursor position report. It runs under the console lock.
The keyboard handler gets its events from the input layer and feeds the foreground console. Key events that a program writes to /dev/uinput or to an event node reach it in the same way as typed keys.
The keyboard handler and respondstring() share no lock, so they can interleave:
keyboard handler respondstring() ================ ================ room check passes room check passes memcpy() to offset used used += len memcpy() to offset used used += len / used > size of the buffer /
The room check subtracts ->used from the size, and both are unsigned. Once ->used exceeds the size, the result wraps, so the check always passes, and each later insert lands further past the buffer.
Reproduced as root, with keys from a uinput keyboard and cursor position reports on the same console: KFENCE reported an out-of-bounds write 1,024 bytes past the buffer in under 10 s.
Fix this by taking port->lock, with interrupts disabled, around the insert and the push in these four functions. kbdkeycode() already takes port->lock under kbdeventlock, so this lock ordering is not new.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In the Linux kernel VT code, serialize flip-buffer producers by taking port->lock with interrupts disabled around the insert and push in put_queue(), puts_queue(), fn_send_intr(), and respond_string().
Event History
Frequently Asked Questions
Who is exposed to this issue?
Systems using Linux virtual consoles are exposed when console input and escape-sequence replies can be processed concurrently. The affected path is the virtual console flip buffer.
What capabilities does an attacker need to trigger the overflow?
An attacker needs to be able to write to the foreground console and also inject keyboard events. The description identifies /dev/uinput or writing to the /dev/input/event* node for a keyboard as ways to inject those events.