Skip to content

[clang] Miscompiles OpenSSH 10.x's mlkem768 key-exchange protocol when avx512 is enabled. #163053

@iucoen

Description

@iucoen

When OpenSSH 10.x is compiled with Clang (I've tested versions 19 and 20) and using -march=x86-64-v4 -mtune=znver5 to enable AVX512, the resulting ssh client binary is unable to establish SSH connections and reports "incorrect signature" when the "mlkem768x25519-sha256" kex algorithm is used. I've narrowed down to the libcrux_ml_kem_mlkem768_portable_decapsulate() function that's misbehaving and returning the wrong shared secret. It also appears that the CFLAG -fzero-call-used-regs=used which is added by OpenSSH's build system is what's causing the problem. I've isolated just the mlkem768 algorithm and produced a small test case to demonstrate the problem.

Metadata

Metadata

Type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions