CVE-2022-50625
JSON

Not scored

serial: amba-pl011: avoid SBSA UART accessing DMACR register

Severity
Not scored
Exploit likelihood
0.26% (higher than 18% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: serial: amba-pl011: avoid SBSA UART accessing DMACR register Chapter "B Generic UART" in "ARM Server Base System Architecture" [1] documentation describes a generic UART interface. Such generic UART does not support DMA. In current code, sbsa_uart_pops and amba_pl011_pops share the same stop_rx operation, which will invoke pl011_dma_rx_stop, leading to an access of the DMACR register. This commit adds a using_rx_dma check in pl011_dma_rx_stop to avoid the access to DMACR register for SBSA UARTs which does not support DMA. When the kernel enables DMA engine with "CONFIG_DMA_ENGINE=y", Linux SBSA PL011 driver will access PL011 DMACR register in some functions. For most real SBSA Pl011 hardware implementations, the DMACR write behaviour will be ignored. So these DMACR operations will not cause obvious problems. But for some virtual SBSA PL011 hardware, like Xen virtual SBSA PL011 (vpl011) device, the behaviour might be different. Xen vpl011 emulation will inject a data abort to guest, when guest is accessing an unimplemented UART register. As Xen VPL011 is SBSA compatible, it will not implement DMACR register. So when Linux SBSA PL011 driver access DMACR register, it will get an unhandled data abort fault and the application will get a segmentation fault: Unhandled fault at 0xffffffc00944d048 Mem abort info: ESR = 0x96000000 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x00: ttbr address size fault Data abort info: ISV = 0, ISS = 0x00000000 CM = 0, WnR = 0 swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000020e2e000 [ffffffc00944d048] pgd=100000003ffff803, p4d=100000003ffff803, pud=100000003ffff803, pmd=100000003fffa803, pte=006800009c090f13 Internal error: ttbr address size fault: 96000000 [#1] PREEMPT SMP ... Call trace: pl011_stop_rx+0x70/0x80 tty_port_shutdown+0x7c/0xb4 tty_port_close+0x60/0xcc uart_close+0x34/0x8c tty_release+0x144/0x4c0 __fput+0x78/0x220 ____fput+0x1c/0x30 task_work_run+0x88/0xc0 do_notify_resume+0x8d0/0x123c el0_svc+0xa8/0xc0 el0t_64_sync_handler+0xa4/0x130 el0t_64_sync+0x1a0/0x1a4 Code: b9000083 b901f001 794038a0 8b000042 (b9000041) ---[ end trace 83dd93df15c3216f ]--- note: bootlogd[132] exited with preempt_count 1 /etc/rcS.d/S07bootlogd: line 47: 132 Segmentation fault start-stop-daemon This has been discussed in the Xen community, and we think it should fix this in Linux. See [2] for more information. [1] https://developer.arm.com/documentation/den0094/c/?lang=en [2] https://lists.xenproject.org/archives/html/xen-devel/2022-11/msg00543.html

Affected

Product or packageVersionsReported by
Linux Linuxfrom 0dd1e247fd39aed20fd2baacc62ca44d82534798 before 1c5f0d3f480abd8c26761b6b1f486822e77faea3, from 0dd1e247fd39aed20fd2baacc62ca44d82534798 before a4ea20ab82aa2b197dc7b08f51e1d615578276a0, from 0dd1e247fd39aed20fd2baacc62ca44d82534798 before 78d837ce20517e0c1ff3ebe08ad64636e02c2e48, from 0dd1e247fd39aed20fd2baacc62ca44d82534798 before 965f07ea5fd1b9591bcccc825a93ad883e56222c, from 0dd1e247fd39aed20fd2baacc62ca44d82534798 before d5b16eb076f46c88d02d41ece5bec4e0d89158bb, from 0dd1e247fd39aed20fd2baacc62ca44d82534798 before d71a611fca1984c0765f9317ff471ac8cd0e3e2f, from 0dd1e247fd39aed20fd2baacc62ca44d82534798 before 38a10fdd54d17590d45cb1c43b9889da383b6b1a, from 0dd1e247fd39aed20fd2baacc62ca44d82534798 before 64bc5dbc3260230e2f022288c71e5c680059384a and 2 more
Not affected: before 4.2, from 4.9.337 up to 4.9.*, from 4.14.303 up to 4.14.*, from 4.19.270 up to 4.19.*, from 5.4.229 up to 5.4.*, from 5.10.163 up to 5.10.*
CVE List

What each source says

CVE List

In the Linux kernel, the following vulnerability has been resolved: serial: amba-pl011: avoid SBSA UART accessing DMACR register Chapter "B Generic UART" in "ARM Server Base System Architecture" [1] documentation describes a generic UART interface. Such generic UART does not support DMA. In current code, sbsa_uart_pops and amba_pl011_pops share the same stop_rx operation, which will invoke pl011_dma_rx_stop, leading to an access of the DMACR register. This commit adds a using_rx_dma check in pl011_dma_rx_stop to avoid the access to DMACR register for SBSA UARTs which does not support DMA. When the kernel enables DMA engine with "CONFIG_DMA_ENGINE=y", Linux SBSA PL011 driver will access PL011 DMACR register in some functions. For most real SBSA Pl011 hardware implementations, the DMACR write behaviour will be ignored. So these DMACR operations will not cause obvious problems. But for some virtual SBSA PL011 hardware, like Xen virtual SBSA PL011 (vpl011) device, the behaviour might be different. Xen vpl011 emulation will inject a data abort to guest, when guest is accessing an unimplemented UART register. As Xen VPL011 is SBSA compatible, it will not implement DMACR register. So when Linux SBSA PL011 driver access DMACR register, it will get an unhandled data abort fault and the application will get a segmentation fault: Unhandled fault at 0xffffffc00944d048 Mem abort info: ESR = 0x96000000 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x00: ttbr address size fault Data abort info: ISV = 0, ISS = 0x00000000 CM = 0, WnR = 0 swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000020e2e000 [ffffffc00944d048] pgd=100000003ffff803, p4d=100000003ffff803, pud=100000003ffff803, pmd=100000003fffa803, pte=006800009c090f13 Internal error: ttbr address size fault: 96000000 [#1] PREEMPT SMP ... Call trace: pl011_stop_rx+0x70/0x80 tty_port_shutdown+0x7c/0xb4 tty_port_close+0x60/0xcc uart_close+0x34/0x8c tty_release+0x144/0x4c0 __fput+0x78/0x220 ____fput+0x1c/0x30 task_work_run+0x88/0xc0 do_notify_resume+0x8d0/0x123c el0_svc+0xa8/0xc0 el0t_64_sync_handler+0xa4/0x130 el0t_64_sync+0x1a0/0x1a4 Code: b9000083 b901f001 794038a0 8b000042 (b9000041) ---[ end trace 83dd93df15c3216f ]--- note: bootlogd[132] exited with preempt_count 1 /etc/rcS.d/S07bootlogd: line 47: 132 Segmentation fault start-stop-daemon This has been discussed in the Xen community, and we think it should fix this in Linux. See [2] for more information. [1] https://developer.arm.com/documentation/den0094/c/?lang=en [2] https://lists.xenproject.org/archives/html/xen-devel/2022-11/msg00543.html

NVD (es)

En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: serial: amba-pl011: evitar que la UART SBSA acceda al registro DMACR El capítulo ’B Generic UART’ en la documentación ’ARM Server Base System Architecture’ [1] describe una interfaz UART genérica. Dicha UART genérica no es compatible con DMA. En el código actual, sbsa_uart_pops y amba_pl011_pops comparten la misma operación stop_rx, lo que invocará pl011_dma_rx_stop, lo que lleva a un acceso al registro DMACR. Este commit añade una comprobación using_rx_dma en pl011_dma_rx_stop para evitar el acceso al registro DMACR para las UART SBSA que no son compatibles con DMA. Cuando el kernel habilita el motor DMA con ’CONFIG_DMA_ENGINE=y’, el controlador Linux SBSA PL011 accederá al registro PL011 DMACR en algunas funciones. Para la mayoría de las implementaciones de hardware SBSA PL011 reales, el comportamiento de escritura del DMACR será ignorado. Por lo tanto, estas operaciones DMACR no causarán problemas obvios. Pero para algunos hardware SBSA PL011 virtuales, como el dispositivo Xen virtual SBSA PL011 (vpl011), el comportamiento podría ser diferente. La emulación Xen vpl011 inyectará un aborto de datos al invitado, cuando el invitado esté accediendo a un registro UART no implementado. Como Xen VPL011 es compatible con SBSA, no implementará el registro DMACR. Así que cuando el controlador Linux SBSA PL011 acceda al registro DMACR, obtendrá un fallo de aborto de datos no manejado y la aplicación obtendrá un fallo de segmentación: Fallo no manejado en 0x ffffffc00944d048 Información de aborto de memoria: ESR = 0x 96000000 EC = 0x25: DABT (EL actual), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x00: fallo de tamaño de dirección ttbr Información de aborto de datos: ISV = 0, ISS = 0x 00000000 CM = 0, WnR = 0 tabla de páginas del swapper: páginas de 4k, VAs de 39 bits, pgdp=0000000020e2e000 [ffffffc00944d048] pgd=100000003ffff803, p4d=100000003ffff803, pud=100000003ffff803, pmd=100000003fffa803, pte=006800009c090f13 Error interno: fallo de tamaño de dirección ttbr: 96000000 [#1] PREEMPT SMP ... Rastro de llamada: pl011_stop_rx+0x70/0x80 tty_port_shutdown+0x7c/0xb4 tty_port_close+0x60/0xcc uart_close+0x34/0x8c tty_release+0x144/0x4c0 __fput+0x78/0x220 ____fput+0x1c/0x30 task_work_run+0x88/0xc0 do_notify_resume+0x8d0/0x 123c el0_svc+0xa8/0xc0 el0t_64_sync_handler+0xa4/0x130 el0t_64_sync+0x1a0/0x1a4 Código: b9000083 b901f001 794038a0 8b000042 (b9000041) - --[ fin del rastro 83dd93df15c3216f ]- -- nota: bootlogd[132] salió con preempt_count 1 /etc/rcS.d/S07bootlogd: línea 47: 132 Fallo de segmentación start-stop-daemon Esto ha sido discutido en la comunidad Xen, y creemos que debería solucionarse en Linux. Consulte [2] para más información. [1] https://developer.arm.com/documentation/den0094/c/?lang=en [2] https://lists.xenproject.org/archives/html/xen-devel/2022-11/msg00543.html

References

Sources

SourceRecordLicence
CVE ListCVE-2022-50625 changed 2026-05-11CVE Terms of Use
NVDCVE-2022-50625 changed 2026-11-11Public domain