diff --git a/logs/20261120-fe25519/README.txt b/logs/20261120-fe25519/README.txt new file mode 100644 index 00000000..e027b404 --- /dev/null +++ b/logs/20261120-fe25519/README.txt @@ -0,0 +1,16 @@ +The nightly's v4-checks failure of 2026-11-20 (run 333, job 923, on master fdf9c194), reproduced +without the capsule-signing key. + +CI: san-mesh-boot: kernel/src/crypto/fe25519.c:31:26: runtime error: left shift of negative value -1 +Here: repro.c, built with the sanitize gate's flags (-O1 -fsanitize=address,undefined + -fno-sanitize-recover=all) against kernel/src/crypto/fe25519.c alone: run.txt, the same line. + +Cause: fe25519_carry computes c = v[i] >> 51 and then v[i] -= c << 51. After fe25519_sub, a limb is +negative, c is -1, and a left shift of a negative value is undefined in C99. The comment says the +code "works for negative limbs too (arithmetic shift preserves sign)", which holds for the right +shift, not the left. Line 35 (limb 4) has the same form. + +Why locally the sanitize gate passes: with no signing key the capsules are unsigned, and the mesh +boot never verifies an Ed25519 signature, so this code does not run there. CI has the key. + +Not fixed (reported to Captain Bob). diff --git a/logs/20261120-fe25519/build.txt b/logs/20261120-fe25519/build.txt new file mode 100644 index 00000000..e69de29b diff --git a/logs/20261120-fe25519/repro.c b/logs/20261120-fe25519/repro.c new file mode 100644 index 00000000..d8f27df7 --- /dev/null +++ b/logs/20261120-fe25519/repro.c @@ -0,0 +1,15 @@ +/* Reproduces the nightly's san-mesh-boot failure (run 333, 2026-11-20) without the signing key: + * fe25519_sub(0, 1) leaves limb 0 at -1, and fe25519_carry shifts the carry of -1 left by 51. */ +#include "starkernel/fe25519.h" +#include +int main(void) +{ + fe25519 zero, one, r; + fe25519_0(&zero); + fe25519_1(&one); + printf("fe25519_sub(0, 1) ...\n"); + fflush(stdout); + fe25519_sub(&r, &zero, &one); + printf("done: v[0]=%lld\n", (long long)r.v[0]); + return 0; +} diff --git a/logs/20261120-fe25519/run.txt b/logs/20261120-fe25519/run.txt new file mode 100644 index 00000000..9848f2a3 --- /dev/null +++ b/logs/20261120-fe25519/run.txt @@ -0,0 +1,3 @@ +fe25519_sub(0, 1) ... +kernel/src/crypto/fe25519.c:31:26: runtime error: left shift of negative value -1 +exit 1