From 541055e1975de95d9f4f0f0de1509ff20275e280 Mon Sep 17 00:00:00 2001 From: Jeffrey Martin Date: Mon, 14 Jan 2019 18:16:34 -0600 Subject: [PATCH 1/3] Backport #1949 into mbedtls-2.16 Signed-off-by: Jeffrey Martin --- ChangeLog | 4 ++++ include/mbedtls/bn_mul.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b39b95391..a82d1f401 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,10 @@ Bugfix previously lead to a stack overflow on constrained targets. * Add `MBEDTLS_SELF_TEST` for the mbedtls_self_test functions in the header files, which missed the precompilation check. #971 + * Extend register cleanup needed on MIPS assembly optimizations. Adds hi, lo + registers hints to the compiler for usage with the embedded MIPS assembly. + Reported in #1722, fix suggested by @aurel32 and submitted + by Jeffrey Martin, #1949. = mbed TLS 2.16.0 branch released 2018-12-21 diff --git a/include/mbedtls/bn_mul.h b/include/mbedtls/bn_mul.h index 2f7b72fe4..26cfa77de 100644 --- a/include/mbedtls/bn_mul.h +++ b/include/mbedtls/bn_mul.h @@ -750,7 +750,7 @@ "sw $10, %2 \n\t" \ : "=m" (c), "=m" (d), "=m" (s) \ : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "$9", "$10", "$11", "$12", "$13", "$14", "$15" \ + : "$9", "$10", "$11", "$12", "$13", "$14", "$15", "lo", "hi" \ ); #endif /* MIPS */ From 60269ee4537ee9cbe292d2efd26905664494192e Mon Sep 17 00:00:00 2001 From: Jeffrey Martin Date: Tue, 15 Jan 2019 09:03:24 -0600 Subject: [PATCH 2/3] update ChangLog per comments Signed-off-by: Jeffrey Martin --- ChangeLog | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a82d1f401..d19ec9495 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,10 +11,11 @@ Bugfix previously lead to a stack overflow on constrained targets. * Add `MBEDTLS_SELF_TEST` for the mbedtls_self_test functions in the header files, which missed the precompilation check. #971 - * Extend register cleanup needed on MIPS assembly optimizations. Adds hi, lo - registers hints to the compiler for usage with the embedded MIPS assembly. - Reported in #1722, fix suggested by @aurel32 and submitted - by Jeffrey Martin, #1949. + * Fix clobber list in MIPS assembly for large integer multiplication. + Previously, this could lead to functionally incorrect assembly being + produced by some optimizing compilers, showing up as failures in + e.g. RSA or ECC signature operations. Reported in #1722, fix suggested + by @aurel32 and submitted by Jeffrey Martin. = mbed TLS 2.16.0 branch released 2018-12-21 From 55a23e497150b7235cd60cf6f60bcd502db63743 Mon Sep 17 00:00:00 2001 From: Jeffrey Martin Date: Wed, 16 Jan 2019 09:27:11 -0600 Subject: [PATCH 3/3] update ChangLog credit Signed-off-by: Jeffrey Martin --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d19ec9495..99bdf39f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,7 +15,7 @@ Bugfix Previously, this could lead to functionally incorrect assembly being produced by some optimizing compilers, showing up as failures in e.g. RSA or ECC signature operations. Reported in #1722, fix suggested - by @aurel32 and submitted by Jeffrey Martin. + by Aurelien Jarno and submitted by Jeffrey Martin. = mbed TLS 2.16.0 branch released 2018-12-21