HIGH Introduced in 7.2
vt VcsWrite UAF
CVE-2026-98840
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: vc_screen: reload vc pointer before if (ret) in vcs_write() to avoid UAF The reload of 'vc' added by commit 8fb9ea65c9d1 ("vc_screen: reload load of struct vc_data pointer in vcs_write() to avoid UAF") sits after the 'if (ret)' block, so the copy-failure break path exits the loop without reloading vc. If the vc was kfree()'d via vc_port_destruct during the unlocked copy_from_user() window, the post-loop 'if (written && vc) vcs_scr_updated(vc)' is reached with a stale non-NULL vc. The '&& vc' guard from commit a287620312dc ("vc_screen: fix null-ptr-deref in vcs_notifier() during concurrent vcs_write") only handles the NULL case, not this stale-non-NULL case; vcs_notifier() then reads param->vc->vc_num from freed memory: BUG: KASAN: slab-use-after-free in vcs_notifier+0x7c/0xd0 Read of size 2 at addr ffff888007149190 Call Trace: vcs_notifier+0x7c/0xd0 atomic_notifier_call_chain+0x70/0xa0 vcs_scr_updated+0x77/0xa0 vcs_write+0x71b/0x7e0 Allocated by task: vc_allocate -> con_install -> tty_open Freed by task: kfree <- vt_ioctl (VT_DISALLOCATE -> vc_port_destruct) Move the reload to immediately after console_lock(), before 'if (ret)', so every break path below passes a fresh vc to the post-loop vcs_scr_updated().
02KernelScan AI Analysis
Risk summary
A local attacker with access to virtual console screen devices (/dev/vcs*) can trigger a use-after-free by racing a write operation against virtual console deallocation. Successful exploitation allows kernel memory corruption, leading to privilege escalation, information disclosure, or system crash. Systems with interactive user access, containers exposing vcs devices, or multi-tenant kernels are at highest risk.
Vulnerability analysis
The vcs_write() function drops the console lock while copying data from userspace via copy_from_user(). During this window, another thread can deallocate the virtual console (via VT_DISALLOCATE ioctl), freeing the vc_data structure. The original code reloaded the vc pointer only after the copy-failure check, so a failed copy would exit the loop with a stale pointer. The post-loop notifier call then dereferenced this freed memory. The fix moves the pointer reload immediately after re-acquiring the console lock, before any failure checks, ensuring every exit path validates the pointer before use. Any local user who can write to /dev/vcs* devices — typically console users, SSH sessions with a TTY, or containers granted device access — can trigger this race.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 5.10.260 | 5.10.273 | cbc05413d369 |
| 5.15 | 5.15.211 | 5.15.224 | 942742000a02 |
| 6.1 | 6.1.177 | 6.1.191 | c9f56d4b2979 |
| 6.12 | 6.12.95 | 6.12.113 | 1485a3dd97ab |
| 6.18 | 6.18.37 | 6.18.56 | 233a2e190b12 |
| 6.6 | 6.6.144 | 6.6.160 | c073d01f6f53 |
| 7.0 | 7.0.14 | 7.1 | 9dfcadc5e003 |
| 7.1 | 7.1.2 | 7.2 | 226bd5603371 |
| 7.2 | 7.2 | 7.2.10 | — |
| mainline | 7.2 | 7.3 | — |
| cip/6.12 | 7.2 | 6.12.114-cip34 | 1485a3dd97ab |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.114-cip34 |
| cip/6.1 | Affected — no CIP fix yet (latest 6.1.190-cip62) |
| cip/6.1-rt | Affected — no CIP fix yet (latest 6.1.189-cip61-rt32) |
| cip/5.10 | Affected — no CIP fix yet (latest 5.10.272-cip79) |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.272-cip79-rt35) |