mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-05-12 14:20:45 +00:00
mbedtls: CVE-2025-52496 fix
Backported from 3.6.x Fixes a race condition
This commit is contained in:
parent
59faf2506f
commit
07f4c1b44e
8
Externals/mbedtls/library/aesni.c
vendored
8
Externals/mbedtls/library/aesni.c
vendored
@ -42,8 +42,12 @@
|
||||
*/
|
||||
int mbedtls_aesni_has_support(unsigned int what)
|
||||
{
|
||||
static int done = 0;
|
||||
static unsigned int c = 0;
|
||||
/* To avoid a race condition, tell the compiler that the assignment
|
||||
* `done = 1` and the assignment to `c` may not be reordered.
|
||||
* https://github.com/Mbed-TLS/mbedtls/issues/9840
|
||||
*/
|
||||
static volatile int done = 0;
|
||||
static volatile unsigned int c = 0;
|
||||
|
||||
if (!done) {
|
||||
#if MBEDTLS_AESNI_HAVE_CODE == 2
|
||||
|
||||
Loading…
Reference in New Issue
Block a user