Overview
About vulnerability
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: RFCOMM: Fix session UAF in set_termios
rfcomm_tty_set_termios() tests dlc->session without rfcomm_mutex and later passes the pointer to rfcomm_send_rpn(). The latter dereferences both session->initiator and session->sock. Meanwhile, krfcommd can unlink the DLC and free the session while holding rfcomm_mutex.
The race can proceed as follows:
TTY ioctl task krfcommd
load dlc->session enter rfcomm_send_rpn() lock rfcomm_mutex clear dlc->session free session unlock rfcomm_mutex read session->initiator
KASAN reported:
BUG: KASAN: slab-use-after-free in rfcomm_send_rpn+0x297/0x2a0 Read of size 4 at addr ffff88810012a850 by task poc/92
Call Trace: rfcomm_send_rpn+0x297/0x2a0 rfcomm_tty_set_termios+0x50d/0x850 tty_set_termios+0x596/0x950 set_termios+0x46a/0x6e0 tty_mode_ioctl+0x152/0xbd0 tty_ioctl+0x915/0x1240 __x64_sys_ioctl+0x134/0x1c0
Allocated by task 92: rfcomm_session_add+0x9e/0x2e0 rfcomm_dlc_open+0x8b1/0xe00 rfcomm_dev_activate+0x85/0x1a0 rfcomm_tty_open+0x90/0x280
Freed by task 68: kfree+0x131/0x3c0 rfcomm_session_del+0x119/0x180 rfcomm_run+0x737/0x4710
Add rfcomm_dlc_send_rpn(), which holds rfcomm_mutex while it verifies that the DLC is still attached and sends the RPN frame. Have the TTY path use the helper and drop its unlocked session check. This keeps the session valid through both the frame construction and socket send.
Details
- Affected product:
- AlmaLinux 9.2 ESU , Amazon Linux 2 ELS , CentOS 6 ELS , CentOS 7 ELS , CentOS 8.4 ELS , CentOS 8.5 ELS , CentOS Stream 8 ELS , CloudLinux 7 ELS , Debian 10 ELS , Debian 11 ELS , Oracle Linux 6 ELS , Oracle Linux 7 ELS , RHEL 7 ELS , TuxCare 9.6 ESU , TuxCare 9.8 ESU , Ubuntu 16.04 ELS , Ubuntu 18.04 ELS , Ubuntu 20.04 ELS
- Affected packages:
- linux @ 4.19.0 (+19 more)
Fixes
KernelCare state
Live-patch status from KernelCare for each operating system.
| Operating system | Status | Covered kernels |
|---|---|---|
| AlmaLinux 10 | Released |
67 kernels
|
| AlmaLinux 8 | Released |
134 kernels
|
| AlmaLinux 9 | Released |
134 kernels
|
| AlmaLinux 9.2 ESU | Released |
34 kernels
|
| AlmaLinux 9.6 ESU | Planned | — |
| CentOS 7 ELS | Released |
36 kernels
|
| CentOS 8 | Released |
33 kernels
|
| CloudLinux OS 7h | Released |
119 kernels
|
| CloudLinux OS 8 | Released |
114 kernels
|
| Debian 12 | Released |
43 kernels
|
| Debian 13 | Planned | — |
| Oracle Linux 10 | Released |
53 kernels
|
| Oracle Linux 8 | Released |
152 kernels
|
| Oracle Linux 8 UEK 7 | Released |
112 kernels
|
| Oracle Linux 9 | Released |
133 kernels
|
| Oracle Linux 9 UEK 7 | Released |
112 kernels
|
| RHEL 10 | Released |
68 kernels
|
| RHEL 8 | Released |
150 kernels
|
| RHEL 9 | Released |
132 kernels
|
| Rocky Linux 10 | Released |
52 kernels
|
| Rocky Linux 8 | Released |
111 kernels
|
| Rocky Linux 9 | Released |
109 kernels
|
| Ubuntu 22.04 | Planned | — |
| Ubuntu 22.04 AWS | Planned | — |
| Ubuntu 22.04 Azure | Planned | — |
| Ubuntu 24.04 | Planned | — |
| Ubuntu 24.04 AWS | Planned | — |
| Ubuntu 26.04 | Will Not Fix | — |