serial: caif: hold tty->link reference in ldisc_open and ser_release
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e31d5a05948e4478ba8396063d1e1f39880928e2 · < 35b58d3bc716ebb9ebd10fe1cac8c1177242511c| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
serial: caif: hold tty->link reference in ldisc_open and ser_release
A reproducer triggers a KASAN slab-use-after-free in pty_write_room() when caif_serial's TX path calls tty_write_room(). The faulting access is on tty->link->port.
Hold an extra kref on tty->link for the lifetime of the caif_serial line discipline: get it in ldisc_open() and drop it in ser_release(), and also drop it on the ldisc_open() error path.
With this change applied, the reproducer no longer triggers the UAF in my testing.
From the CVE record · Linux
The Linux kernel's caif_serial line discipline can access freed memory when its transmit path calls tty_write_room(). A reproducer triggers this fault; the input does not establish an attacker impact or specify whether network access, authentication, or user interaction is required.
Engineers running Linux kernels with the caif_serial line discipline should check their versions; affected versions are not specified.