summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-9.2/CVE-2019-15847_2.patch
blob: de7a83c23f4d02a16dc204146bcfbd14ad9a4437 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
From 87bc784a7ca3a43182f7272241597a50d7491342 Mon Sep 17 00:00:00 2001
From: segher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 30 Aug 2019 13:51:26 +0000
Subject: [PATCH] 	Backport from trunk 	2019-08-22  Segher Boessenkool
  <segher@kernel.crashing.org>

	PR target/91481
	* config/rs6000/rs6000.md (unspec): Delete UNSPEC_DARN, UNSPEC_DARN_32,
	and UNSPEC_DARN_RAW.
	(unspecv): New enumerator values UNSPECV_DARN, UNSPECV_DARN_32, and
	UNSPECV_DARN_RAW.
	(darn_32): Use an unspec_volatile, and UNSPECV_DARN_32.
	(darn_raw): Use an unspec_volatile, and UNSPECV_DARN_RAW.
	(darn): Use an unspec_volatile, and UNSPECV_DARN.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-9-branch@275175 138bc75d-0d04-0410-961f-82ee72b054a4

Upstream-Status: Backport
CVE: CVE-2019-15847 p2
Affects <= 9.2.0
Dropped Changelog changes
Signed-off-by: Armin Kuster <akuster@mvista.com>

---
 gcc/config/rs6000/rs6000.md | 12 ++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)

Index: gcc-9.2.0/gcc/config/rs6000/rs6000.md
===================================================================
--- gcc-9.2.0.orig/gcc/config/rs6000/rs6000.md
+++ gcc-9.2.0/gcc/config/rs6000/rs6000.md
@@ -137,9 +137,6 @@
    UNSPEC_LSQ
    UNSPEC_FUSION_GPR
    UNSPEC_STACK_CHECK
-   UNSPEC_DARN
-   UNSPEC_DARN_32
-   UNSPEC_DARN_RAW
    UNSPEC_CMPRB
    UNSPEC_CMPRB2
    UNSPEC_CMPEQB
@@ -170,6 +167,9 @@
    UNSPECV_EH_RR		; eh_reg_restore
    UNSPECV_ISYNC		; isync instruction
    UNSPECV_MFTB			; move from time base
+   UNSPECV_DARN			; darn 1 (deliver a random number)
+   UNSPECV_DARN_32		; darn 2
+   UNSPECV_DARN_RAW		; darn 0
    UNSPECV_NLGR			; non-local goto receiver
    UNSPECV_MFFS			; Move from FPSCR
    UNSPECV_MFFSL		; Move from FPSCR light instruction version
@@ -14333,21 +14333,21 @@
 
 (define_insn "darn_32"
   [(set (match_operand:SI 0 "register_operand" "=r")
-        (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
+        (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
   "TARGET_P9_MISC"
   "darn %0,0"
   [(set_attr "type" "integer")])
 
 (define_insn "darn_raw"
   [(set (match_operand:DI 0 "register_operand" "=r")
-        (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
+        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
   "TARGET_P9_MISC && TARGET_64BIT"
   "darn %0,2"
   [(set_attr "type" "integer")])
 
 (define_insn "darn"
   [(set (match_operand:DI 0 "register_operand" "=r")
-        (unspec:DI [(const_int 0)] UNSPEC_DARN))]
+        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
   "TARGET_P9_MISC && TARGET_64BIT"
   "darn %0,1"
   [(set_attr "type" "integer")])