summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc/0002-CVE-2021-35465.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc/0002-CVE-2021-35465.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc/0002-CVE-2021-35465.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc/0002-CVE-2021-35465.patch b/meta/recipes-devtools/gcc/gcc/0002-CVE-2021-35465.patch
new file mode 100644
index 0000000000..38d02dc770
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/0002-CVE-2021-35465.patch
@@ -0,0 +1,40 @@
1From 574e7950bd6b34e9e2cacce18c802b45505d1d0a Mon Sep 17 00:00:00 2001
2From: Richard Earnshaw <rearnsha@arm.com>
3Date: Fri, 18 Jun 2021 17:16:25 +0100
4Subject: [PATCH] arm: add erratum mitigation to __gnu_cmse_nonsecure_call
5 [PR102035]
6
7Add the recommended erratum mitigation sequence to
8__gnu_cmse_nonsecure_call for use on Armv8-m.main devices. Since this
9is in the library code we cannot know in advance whether the core we
10are running on will be affected by this, so always enable it.
11
12libgcc:
13 PR target/102035
14 * config/arm/cmse_nonsecure_call.S (__gnu_cmse_nonsecure_call):
15 Add vlldm erratum work-around.
16
17CVE: CVE-2021-35465
18Upstream-Status: Backport[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=574e7950bd6b34e9e2cacce18c802b45505d1d0a]
19Signed-off-by: Pgowda <pgowda.cve@gmail.com>
20
21---
22 libgcc/config/arm/cmse_nonsecure_call.S | 5 +++++
23 1 file changed, 5 insertions(+)
24
25diff --git a/libgcc/config/arm/cmse_nonsecure_call.S b/libgcc/config/arm/cmse_nonsecure_call.S
26index 00830ade98e..c8e0fbbe665 100644
27--- a/libgcc/config/arm/cmse_nonsecure_call.S
28+++ b/libgcc/config/arm/cmse_nonsecure_call.S
29@@ -102,6 +102,11 @@ blxns r4
30 #ifdef __ARM_PCS_VFP
31 vpop.f64 {d8-d15}
32 #else
33+/* VLLDM erratum mitigation sequence. */
34+mrs r5, control
35+tst r5, #8 /* CONTROL_S.SFPA */
36+it ne
37+.inst.w 0xeeb00a40 /* vmovne s0, s0 */
38 vlldm sp /* Lazy restore of d0-d16 and FPSCR. */
39 add sp, sp, #0x88 /* Free space used to save floating point registers. */
40 #endif /* __ARM_PCS_VFP */