CVE-2026-98839: vt: selection: Fix unsigned underflow and slab-out-of-bounds read in paste_selection()

Published Oct 18, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

vt: selection: Fix unsigned underflow and slab-out-of-bounds read in pasteselection()

In pasteselection(), the loop copies mint(unsigned int, vcsel.buflen - pasted,tty->receiveroom) bytes per iteration into ttyldiscreceivebuf() and increments pasted += count.

Because the selection mutex (vcsel.lock) is dropped inside the loop Whenever the line discipline buffer fills up and pasteselection() sleeps on tty->writewait, a concurrent TIOCLINUX (TIOCLSETSEL) ioctl can replace vcsel.buffer with a shorter selection and reduce vcsel.buflen below pasted.

When pasteselection() resumes, vcsel.buflen - pasted underflows as an unsigned integer to a large positive value, causing ttyldiscreceivebuf(ld, vcsel.buffer + pasted, NULL, count) to read up to 4094 bytes out-of-bounds past the newly allocated vcsel.buffer.

Fix this by terminating the loop when pasted >= vcsel.buflen.

Kernel stack trace (Linux 7.3.0-rc3): ================================================================== BUG: KASAN: slab-out-of-bounds in nttyreceivebufcommon+0xa01/0x1650 Read of size 4094 at addr ffff888101c58010 by task kworker/u17:1/65 Workqueue: eventsunbound flushtoldisc Call Trace: <TASK> dumpstacklvl+0x70/0xa0 printreport+0x153/0x4c6 kasanreport+0xf1/0x120 kasancheckrange+0x11c/0x200 asanmemcpy+0x29/0x70 nttyreceivebufcommon+0xa01/0x1650 ttyldiscreceivebuf+0x66/0x110 ttyportdefaultreceivebuf+0x6b/0xb0 flushtoldisc+0x1b4/0x410 processonework+0x6ff/0x1110 workerthread+0x4a8/0xb70 kthread+0x307/0x3e0 retfromfork+0x3ed/0x680 </TASK> ==================================================================

Affected Software

1 affected component
Linux Linux kernel=7.3.0-rc3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    In paste_selection(), terminate the loop when pasted >= vc_sel.buf_len to prevent vc_sel.buf_len - pasted from underflowing and causing an out-of-bounds read.

Event History

Oct 18, 2026
CVE Published
via MITRE·03:50 PM
Data Sourced
via MITRE·03:50 PM
Description
Data Sourced
via NVD·04:17 PM
Description

Frequently Asked Questions

1

What conditions are required to trigger the out-of-bounds read?

A paste operation must block because the line discipline buffer is full and paste_selection() sleeps on tty->write_wait. While the selection mutex is dropped, a concurrent TIOCLINUX TIOCL_SETSEL ioctl must replace the selection buffer with a shorter one before the paste resumes.

2

What is the practical impact of the race?

When the paste resumes after the selection is shortened, the unsigned subtraction vc_sel.buf_len - pasted can underflow. This can cause tty_ldisc_receive_buf() to read up to 4094 bytes beyond the newly allocated selection buffer.

3

How can systems determine whether they have the fix?

Check whether the kernel includes the paste_selection() loop termination condition for pasted >= vc_sel.buf_len. The provided stable references identify commits containing the correction.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203