CVE-2022-49164

In the Linux kernel, the following vulnerability has been resolved: powerpc/tm: Fix more userspace r13 corruption Commit cf13435b730a ("powerpc/tm: Fix userspace r13 corruption") fixes a problem in treclaim where a SLB miss can occur on the thread_struct->ckpt_regs while SCRATCH0 is live with the saved user r13 value, clobbering it with the kernel r13 and ultimately resulting in kernel r13 being stored in ckpt_regs. There is an equivalent problem in trechkpt where the user r13 value is loaded into r13 from chkpt_regs to be recheckpointed, but a SLB miss could occur on ckpt_regs accesses after that, which will result in r13 being clobbered with a kernel value and that will get recheckpointed and then restored to user registers. The same memory page is accessed right before this critical window where a SLB miss could cause corruption, so hitting the bug requires the SLB entry be removed within a small window of instructions, which is possible if a SLB related MCE hits there. PAPR also permits the hypervisor to discard this SLB entry (because slb_shadow->persistent is only set to SLB_NUM_BOLTED) although it's not known whether any implementations would do this (KVM does not). So this is an extremely unlikely bug, only found by inspection. Fix this by also storing user r13 in a temporary location on the kernel stack and don't change the r13 register from kernel r13 until the RI=0 critical section that does not fault. The SCRATCH0 change is not strictly part of the fix, it's only used in the RI=0 section so it does not have the same problem as the previous SCRATCH0 bug.
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*

History

23 Sep 2025, 14:20

Type Values Removed Values Added
CWE NVD-CWE-noinfo
References () https://git.kernel.org/stable/c/5dce84f475d13b773a1a4c823581cab25044d86a - () https://git.kernel.org/stable/c/5dce84f475d13b773a1a4c823581cab25044d86a - Patch
References () https://git.kernel.org/stable/c/73d8082c90f17dfba57cad4ca94db5cae323f1b1 - () https://git.kernel.org/stable/c/73d8082c90f17dfba57cad4ca94db5cae323f1b1 - Patch
References () https://git.kernel.org/stable/c/9d71165d3934e607070c4e48458c0cf161b1baea - () https://git.kernel.org/stable/c/9d71165d3934e607070c4e48458c0cf161b1baea - Patch
First Time Linux linux Kernel
Linux
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 5.5
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: powerpc/tm: Fix more userspace r13 democracy Commit cf13435b730a ("powerpc/tm: Fix userspace r13 democracy") corrige un problema en treclaim donde puede ocurrir un error de SLB en thread_struct->ckpt_regs mientras SCRATCH0 está activo con el valor r13 del usuario guardado, golpeándolo con el r13 del kernel y, en última instancia, resultando en que el r13 del kernel se almacene en ckpt_regs. Hay un problema equivalente en trechkpt donde el valor r13 del usuario se carga en r13 desde chkpt_regs para volver a establecer un punto de control, pero podría ocurrir un error de SLB en los accesos a ckpt_regs después de eso, lo que resultará en que r13 se golpee con un valor del kernel y que se vuelva a establecer un punto de control y luego se restaure a los registros del usuario. Se accede a la misma página de memoria justo antes de esta ventana crítica donde un error de SLB podría causar corrupción, por lo que encontrar el error requiere que la entrada de SLB se elimine dentro de una pequeña ventana de instrucciones, lo que es posible si un MCE relacionado con SLB llega allí. PAPR también permite que el hipervisor descarte esta entrada de SLB (porque slb_shadow->persistent solo está configurado en SLB_NUM_BOLTED) aunque no se sabe si alguna implementación haría esto (KVM no lo hace). Por lo tanto, este es un error extremadamente improbable, que solo se encuentra por inspección. Arregle esto almacenando también el usuario r13 en una ubicación temporal en la pila del kernel y no cambie el registro r13 del kernel r13 hasta la sección crítica RI=0 que no falla. El cambio SCRATCH0 no es estrictamente parte de la solución, solo se usa en la sección RI=0, por lo que no tiene el mismo problema que el error SCRATCH0 anterior.
CPE cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*

26 Feb 2025, 07:00

Type Values Removed Values Added
New CVE

Information

Published : 2025-02-26 07:00

Updated : 2025-09-23 14:20


NVD link : CVE-2022-49164

Mitre link : CVE-2022-49164

CVE.ORG link : CVE-2022-49164


JSON object : View

Products Affected

linux

  • linux_kernel