CVE-2023-52568

In the Linux kernel, the following vulnerability has been resolved: x86/sgx: Resolves SECS reclaim vs. page fault for EAUG race The SGX EPC reclaimer (ksgxd) may reclaim the SECS EPC page for an enclave and set secs.epc_page to NULL. The SECS page is used for EAUG and ELDU in the SGX page fault handler. However, the NULL check for secs.epc_page is only done for ELDU, not EAUG before being used. Fix this by doing the same NULL check and reloading of the SECS page as needed for both EAUG and ELDU. The SECS page holds global enclave metadata. It can only be reclaimed when there are no other enclave pages remaining. At that point, virtually nothing can be done with the enclave until the SECS page is paged back in. An enclave can not run nor generate page faults without a resident SECS page. But it is still possible for a #PF for a non-SECS page to race with paging out the SECS page: when the last resident non-SECS page A triggers a #PF in a non-resident page B, and then page A and the SECS both are paged out before the #PF on B is handled. Hitting this bug requires that race triggered with a #PF for EAUG. Following is a trace when it happens. BUG: kernel NULL pointer dereference, address: 0000000000000000 RIP: 0010:sgx_encl_eaug_page+0xc7/0x210 Call Trace: ? __kmem_cache_alloc_node+0x16a/0x440 ? xa_load+0x6e/0xa0 sgx_vma_fault+0x119/0x230 __do_fault+0x36/0x140 do_fault+0x12f/0x400 __handle_mm_fault+0x728/0x1110 handle_mm_fault+0x105/0x310 do_user_addr_fault+0x1ee/0x750 ? __this_cpu_preempt_check+0x13/0x20 exc_page_fault+0x76/0x180 asm_exc_page_fault+0x27/0x30
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.6:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.6:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.6:rc3:*:*:*:*:*:*

History

11 Dec 2024, 16:23

Type Values Removed Values Added
CPE cpe:2.3:o:linux:linux_kernel:6.6:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.6:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.6:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
References () https://git.kernel.org/stable/c/1348f7f15d7c7798456856bee74a4235c2da994e - () https://git.kernel.org/stable/c/1348f7f15d7c7798456856bee74a4235c2da994e - Patch
References () https://git.kernel.org/stable/c/811ba2ef0cb6402672e64ba1419d6ef95aa3405d - () https://git.kernel.org/stable/c/811ba2ef0cb6402672e64ba1419d6ef95aa3405d - Patch
References () https://git.kernel.org/stable/c/c6c2adcba50c2622ed25ba5d5e7f05f584711358 - () https://git.kernel.org/stable/c/c6c2adcba50c2622ed25ba5d5e7f05f584711358 - Patch
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 4.7
CWE CWE-476
First Time Linux linux Kernel
Linux

21 Nov 2024, 08:40

Type Values Removed Values Added
References () https://git.kernel.org/stable/c/1348f7f15d7c7798456856bee74a4235c2da994e - () https://git.kernel.org/stable/c/1348f7f15d7c7798456856bee74a4235c2da994e -
References () https://git.kernel.org/stable/c/811ba2ef0cb6402672e64ba1419d6ef95aa3405d - () https://git.kernel.org/stable/c/811ba2ef0cb6402672e64ba1419d6ef95aa3405d -
References () https://git.kernel.org/stable/c/c6c2adcba50c2622ed25ba5d5e7f05f584711358 - () https://git.kernel.org/stable/c/c6c2adcba50c2622ed25ba5d5e7f05f584711358 -
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: x86/sgx: Resuelve reclamación SECS versus error de página para la ejecución EAUG. El recuperador SGX EPC (ksgxd) puede reclamar la página SECS EPC para un enclave y establecer secs.epc_page en NULL. La página SECS se utiliza para EAUG y ELDU en el controlador de fallas de la página SGX. Sin embargo, la verificación NULL para secs.epc_page solo se realiza para ELDU, no para EAUG, antes de usarse. Solucione este problema haciendo la misma verificación NULL y recargando la página SECS según sea necesario tanto para EAUG como para ELDU. La página SECS contiene metadatos del enclave global. Solo se puede reclamar cuando no quedan otras páginas del enclave. En ese punto, prácticamente no se puede hacer nada con el enclave hasta que se vuelva a paginar la página SECS. Un enclave no puede ejecutarse ni generar errores de página sin una página SECS residente. Pero aún es posible que un #PF para una página que no es SECS se compita con la paginación de la página SECS: cuando la última página A residente que no es SECS activa un #PF en una página B no residente, y luego la página A y Ambos SECS se paginan antes de que se maneje el #PF en B. Para solucionar este error es necesario que la ejecución se active con un #PF para EAUG. A continuación se muestra un rastro de cuando sucede. ERROR: desreferencia del puntero NULL del kernel, dirección: 0000000000000000 RIP: 0010:sgx_encl_eaug_page+0xc7/0x210 Seguimiento de llamadas:? __kmem_cache_alloc_node+0x16a/0x440 ? xa_load+0x6e/0xa0 sgx_vma_fault+0x119/0x230 __do_fault+0x36/0x140 do_fault+0x12f/0x400 __handle_mm_fault+0x728/0x1110 handle_mm_fault+0x105/0x310 do_user_addr_fault+0x1ee/ 0x750? __this_cpu_preempt_check+0x13/0x20 exc_page_fault+0x76/0x180 asm_exc_page_fault+0x27/0x30

02 Mar 2024, 22:15

Type Values Removed Values Added
New CVE

Information

Published : 2024-03-02 22:15

Updated : 2024-12-11 16:23


NVD link : CVE-2023-52568

Mitre link : CVE-2023-52568

CVE.ORG link : CVE-2023-52568


JSON object : View

Products Affected

linux

  • linux_kernel
CWE
CWE-476

NULL Pointer Dereference