PT-2026-166864
CVE-2026-143009
·
Publicado
2026-12-03
·
Atualizado
2026-12-03
Descrição por
CVSS 3.1
7.8
AltaMétricasAV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
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 tty insert flip *() and then calls
tty flip buffer push() to pass it on to the line discipline. The insert
functions take no lock: they check that the current struct tty buffer
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:
- put queue(), puts queue() and fn send intr() insert typed characters and breaks for the keyboard handler. They run under kbd event lock.
- respond string() 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 respond string() share no lock, so they can
interleave:
keyboard handler respond string()
================ ================
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. kbd keycode() already takes
port->lock under kbd event lock, so this lock ordering is not new.
Encontrou algum problema na descrição? Tem algo a acrescentar? Fique à vontade para nos escrever 👾