Skip to content

Commit 02ac9c9

Browse files
committed
aesv8-armx.pl: Avoid buffer overrread in AES-XTS decryption
Original author: Nevine Ebeid (Amazon) Fixes: CVE-2023-1255 The buffer overread happens on decrypts of 4 mod 5 sizes. Unless the memory just after the buffer is unmapped this is harmless. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> (Merged from #20759) (cherry picked from commit 72dfe46)
1 parent ba56257 commit 02ac9c9

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

CHANGES.md

+10
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ breaking changes, and mappings for the large list of deprecated functions.
3030

3131
### Changes between 3.0.8 and 3.0.9 [xx XXX xxxx]
3232

33+
* Fixed buffer overread in AES-XTS decryption on ARM 64 bit platforms which
34+
happens if the buffer size is 4 mod 5. This can trigger a crash of an
35+
application using AES-XTS decryption if the memory just after the buffer
36+
being decrypted is not mapped.
37+
Thanks to Anton Romanov (Amazon) for discovering the issue.
38+
([CVE-2023-1255])
39+
40+
*Nevine Ebeid*
41+
3342
* Reworked the Fix for the Timing Oracle in RSA Decryption ([CVE-2022-4304]).
3443
The previous fix for this timing side channel turned out to cause
3544
a severe 2-3x performance regression in the typical use case
@@ -19617,6 +19626,7 @@ ndif
1961719626

1961819627
<!-- Links -->
1961919628

19629+
[CVE-2023-1255]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-1255
1962019630
[CVE-2023-0466]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0466
1962119631
[CVE-2023-0465]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0465
1962219632
[CVE-2023-0464]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0464

NEWS.md

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ OpenSSL 3.0
2020

2121
### Major changes between OpenSSL 3.0.8 and OpenSSL 3.0.9 [under development]
2222

23+
* Fixed buffer overread in AES-XTS decryption on ARM 64 bit platforms
24+
([CVE-2023-1255])
2325
* Fixed documentation of X509_VERIFY_PARAM_add0_policy() ([CVE-2023-0466])
2426
* Fixed handling of invalid certificate policies in leaf certificates
2527
([CVE-2023-0465])
@@ -1437,6 +1439,7 @@ OpenSSL 0.9.x
14371439
* Support for various new platforms
14381440

14391441
<!-- Links -->
1442+
[CVE-2023-1255]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-1255
14401443
[CVE-2023-0466]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0466
14411444
[CVE-2023-0465]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0465
14421445
[CVE-2023-0464]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0464

crypto/aes/asm/aesv8-armx.pl

+3-1
Original file line numberDiff line numberDiff line change
@@ -3353,7 +3353,7 @@ ()
33533353
.align 4
33543354
.Lxts_dec_tail4x:
33553355
add $inp,$inp,#16
3356-
vld1.32 {$dat0},[$inp],#16
3356+
tst $tailcnt,#0xf
33573357
veor $tmp1,$dat1,$tmp0
33583358
vst1.8 {$tmp1},[$out],#16
33593359
veor $tmp2,$dat2,$tmp2
@@ -3362,6 +3362,8 @@ ()
33623362
veor $tmp4,$dat4,$tmp4
33633363
vst1.8 {$tmp3-$tmp4},[$out],#32
33643364
3365+
b.eq .Lxts_dec_abort
3366+
vld1.32 {$dat0},[$inp],#16
33653367
b .Lxts_done
33663368
.align 4
33673369
.Lxts_outer_dec_tail:

0 commit comments

Comments
 (0)