Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/emacs-tools:patchsets commit in: emacs/23.4/, emacs/24.5/, emacs/25.2/
Date: Mon, 11 Sep 2017 17:52:36
Message-Id: 1505150934.9b7d42cbf4ccc1a7099ac24d94306b6c9002d23c.ulm@gentoo
1 commit: 9b7d42cbf4ccc1a7099ac24d94306b6c9002d23c
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 11 17:28:54 2017 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 11 17:28:54 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/emacs-tools.git/commit/?id=9b7d42cb
7
8 Fix security vulnerability in enriched mode, bug 630680.
9
10 emacs/23.4/29_all_enriched-mode.patch | 79 ++++++++++++++++++++++++++++++++++
11 emacs/24.5/08_all_enriched-mode.patch | 78 ++++++++++++++++++++++++++++++++++
12 emacs/25.2/01_all_enriched-mode.patch | 80 +++++++++++++++++++++++++++++++++++
13 3 files changed, 237 insertions(+)
14
15 diff --git a/emacs/23.4/29_all_enriched-mode.patch b/emacs/23.4/29_all_enriched-mode.patch
16 new file mode 100644
17 index 0000000..b4b682f
18 --- /dev/null
19 +++ b/emacs/23.4/29_all_enriched-mode.patch
20 @@ -0,0 +1,79 @@
21 +Fix security vulnerability in enriched mode.
22 +https://bugs.gentoo.org/630680
23 +
24 +Backported from Emacs 25:
25 +
26 +commit 9ad0fcc54442a9a01d41be19880250783426db70
27 +Author: Lars Ingebrigtsen <larsi@××××.org>
28 +Date: Fri Sep 8 20:23:31 2017 -0700
29 +
30 + Remove unsafe enriched mode translations
31 +
32 + * lisp/gnus/mm-view.el (mm-inline-text):
33 + Do not worry about enriched or richtext type.
34 + * lisp/textmodes/enriched.el (enriched-translations):
35 + Remove translations for FUNCTION, display (Bug#28350).
36 + (enriched-handle-display-prop, enriched-decode-display-prop): Remove.
37 +
38 +--- emacs-23.4-orig/lisp/gnus/mm-view.el
39 ++++ emacs-23.4/lisp/gnus/mm-view.el
40 +@@ -454,10 +454,6 @@
41 + (goto-char (point-max))))
42 + (save-restriction
43 + (narrow-to-region b (point))
44 +- (when (member type '("enriched" "richtext"))
45 +- (set-text-properties (point-min) (point-max) nil)
46 +- (ignore-errors
47 +- (enriched-decode (point-min) (point-max))))
48 + (mm-handle-set-undisplayer
49 + handle
50 + `(lambda ()
51 +--- emacs-23.4-orig/lisp/textmodes/enriched.el
52 ++++ emacs-23.4/lisp/textmodes/enriched.el
53 +@@ -118,12 +118,7 @@
54 + (full "flushboth")
55 + (center "center"))
56 + (PARAMETER (t "param")) ; Argument of preceding annotation
57 +- ;; The following are not part of the standard:
58 +- (FUNCTION (enriched-decode-foreground "x-color")
59 +- (enriched-decode-background "x-bg-color")
60 +- (enriched-decode-display-prop "x-display"))
61 + (read-only (t "x-read-only"))
62 +- (display (nil enriched-handle-display-prop))
63 + (unknown (nil format-annotate-value))
64 + ; (font-size (2 "bigger") ; unimplemented
65 + ; (-2 "smaller"))
66 +@@ -474,33 +469,6 @@
67 + (message "Warning: no color specified for <x-bg-color>")
68 + nil))
69 +
70 +-;;; Handling the `display' property.
71 +-
72 +-
73 +-(defun enriched-handle-display-prop (old new)
74 +- "Return a list of annotations for a change in the `display' property.
75 +-OLD is the old value of the property, NEW is the new value. Value
76 +-is a list `(CLOSE OPEN)', where CLOSE is a list of annotations to
77 +-close and OPEN a list of annotations to open. Each of these lists
78 +-has the form `(ANNOTATION PARAM ...)'."
79 +- (let ((annotation "x-display")
80 +- (param (prin1-to-string (or old new))))
81 +- (if (null old)
82 +- (cons nil (list (list annotation param)))
83 +- (cons (list (list annotation param)) nil))))
84 +-
85 +-(defun enriched-decode-display-prop (start end &optional param)
86 +- "Decode a `display' property for text between START and END.
87 +-PARAM is a `<param>' found for the property.
88 +-Value is a list `(START END SYMBOL VALUE)' with START and END denoting
89 +-the range of text to assign text property SYMBOL with value VALUE."
90 +- (let ((prop (when (stringp param)
91 +- (condition-case ()
92 +- (car (read-from-string param))
93 +- (error nil)))))
94 +- (unless prop
95 +- (message "Warning: invalid <x-display> parameter %s" param))
96 +- (list start end 'display prop)))
97 +
98 + ;; arch-tag: 05cae488-3fea-45cd-ac29-5b02cb64e42b
99 + ;;; enriched.el ends here
100
101 diff --git a/emacs/24.5/08_all_enriched-mode.patch b/emacs/24.5/08_all_enriched-mode.patch
102 new file mode 100644
103 index 0000000..4979b5e
104 --- /dev/null
105 +++ b/emacs/24.5/08_all_enriched-mode.patch
106 @@ -0,0 +1,78 @@
107 +Fix security vulnerability in enriched mode.
108 +https://bugs.gentoo.org/630680
109 +
110 +Backported from Emacs 25:
111 +
112 +commit 9ad0fcc54442a9a01d41be19880250783426db70
113 +Author: Lars Ingebrigtsen <larsi@××××.org>
114 +Date: Fri Sep 8 20:23:31 2017 -0700
115 +
116 + Remove unsafe enriched mode translations
117 +
118 + * lisp/gnus/mm-view.el (mm-inline-text):
119 + Do not worry about enriched or richtext type.
120 + * lisp/textmodes/enriched.el (enriched-translations):
121 + Remove translations for FUNCTION, display (Bug#28350).
122 + (enriched-handle-display-prop, enriched-decode-display-prop): Remove.
123 +
124 +--- emacs-24.5-orig/lisp/gnus/mm-view.el
125 ++++ emacs-24.5/lisp/gnus/mm-view.el
126 +@@ -472,10 +472,6 @@
127 + (goto-char (point-max))))
128 + (save-restriction
129 + (narrow-to-region b (point))
130 +- (when (member type '("enriched" "richtext"))
131 +- (set-text-properties (point-min) (point-max) nil)
132 +- (ignore-errors
133 +- (enriched-decode (point-min) (point-max))))
134 + (mm-handle-set-undisplayer
135 + handle
136 + `(lambda ()
137 +--- emacs-24.5-orig/lisp/textmodes/enriched.el
138 ++++ emacs-24.5/lisp/textmodes/enriched.el
139 +@@ -117,12 +117,7 @@
140 + (full "flushboth")
141 + (center "center"))
142 + (PARAMETER (t "param")) ; Argument of preceding annotation
143 +- ;; The following are not part of the standard:
144 +- (FUNCTION (enriched-decode-foreground "x-color")
145 +- (enriched-decode-background "x-bg-color")
146 +- (enriched-decode-display-prop "x-display"))
147 + (read-only (t "x-read-only"))
148 +- (display (nil enriched-handle-display-prop))
149 + (unknown (nil format-annotate-value))
150 + ; (font-size (2 "bigger") ; unimplemented
151 + ; (-2 "smaller"))
152 +@@ -476,32 +471,5 @@
153 + (message "Warning: no color specified for <x-bg-color>")
154 + nil))
155 +
156 +-;;; Handling the `display' property.
157 +-
158 +-
159 +-(defun enriched-handle-display-prop (old new)
160 +- "Return a list of annotations for a change in the `display' property.
161 +-OLD is the old value of the property, NEW is the new value. Value
162 +-is a list `(CLOSE OPEN)', where CLOSE is a list of annotations to
163 +-close and OPEN a list of annotations to open. Each of these lists
164 +-has the form `(ANNOTATION PARAM ...)'."
165 +- (let ((annotation "x-display")
166 +- (param (prin1-to-string (or old new))))
167 +- (if (null old)
168 +- (cons nil (list (list annotation param)))
169 +- (cons (list (list annotation param)) nil))))
170 +-
171 +-(defun enriched-decode-display-prop (start end &optional param)
172 +- "Decode a `display' property for text between START and END.
173 +-PARAM is a `<param>' found for the property.
174 +-Value is a list `(START END SYMBOL VALUE)' with START and END denoting
175 +-the range of text to assign text property SYMBOL with value VALUE."
176 +- (let ((prop (when (stringp param)
177 +- (condition-case ()
178 +- (car (read-from-string param))
179 +- (error nil)))))
180 +- (unless prop
181 +- (message "Warning: invalid <x-display> parameter %s" param))
182 +- (list start end 'display prop)))
183 +
184 + ;;; enriched.el ends here
185
186 diff --git a/emacs/25.2/01_all_enriched-mode.patch b/emacs/25.2/01_all_enriched-mode.patch
187 new file mode 100644
188 index 0000000..fe70b34
189 --- /dev/null
190 +++ b/emacs/25.2/01_all_enriched-mode.patch
191 @@ -0,0 +1,80 @@
192 +Fix security vulnerability in enriched mode.
193 +https://bugs.gentoo.org/630680
194 +
195 +commit 9ad0fcc54442a9a01d41be19880250783426db70
196 +Author: Lars Ingebrigtsen <larsi@××××.org>
197 +Date: Fri Sep 8 20:23:31 2017 -0700
198 +
199 + Remove unsafe enriched mode translations
200 +
201 + * lisp/gnus/mm-view.el (mm-inline-text):
202 + Do not worry about enriched or richtext type.
203 + * lisp/textmodes/enriched.el (enriched-translations):
204 + Remove translations for FUNCTION, display (Bug#28350).
205 + (enriched-handle-display-prop, enriched-decode-display-prop): Remove.
206 +
207 +diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
208 +index e5859d002c..77ad271d1d 100644
209 +--- a/lisp/gnus/mm-view.el
210 ++++ b/lisp/gnus/mm-view.el
211 +@@ -383,10 +383,6 @@
212 + (goto-char (point-max))))
213 + (save-restriction
214 + (narrow-to-region b (point))
215 +- (when (member type '("enriched" "richtext"))
216 +- (set-text-properties (point-min) (point-max) nil)
217 +- (ignore-errors
218 +- (enriched-decode (point-min) (point-max))))
219 + (mm-handle-set-undisplayer
220 + handle
221 + `(lambda ()
222 +diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el
223 +index beb6c6dda3..a8f0d3891a 100644
224 +--- a/lisp/textmodes/enriched.el
225 ++++ b/lisp/textmodes/enriched.el
226 +@@ -117,12 +117,7 @@ expression, which is evaluated to get the string to insert.")
227 + (full "flushboth")
228 + (center "center"))
229 + (PARAMETER (t "param")) ; Argument of preceding annotation
230 +- ;; The following are not part of the standard:
231 +- (FUNCTION (enriched-decode-foreground "x-color")
232 +- (enriched-decode-background "x-bg-color")
233 +- (enriched-decode-display-prop "x-display"))
234 + (read-only (t "x-read-only"))
235 +- (display (nil enriched-handle-display-prop))
236 + (unknown (nil format-annotate-value))
237 + ; (font-size (2 "bigger") ; unimplemented
238 + ; (-2 "smaller"))
239 +@@ -477,32 +472,5 @@ Return value is \(begin end name positive-p), or nil if none was found."
240 + (message "Warning: no color specified for <x-bg-color>")
241 + nil))
242 +
243 +-;;; Handling the `display' property.
244 +-
245 +-
246 +-(defun enriched-handle-display-prop (old new)
247 +- "Return a list of annotations for a change in the `display' property.
248 +-OLD is the old value of the property, NEW is the new value. Value
249 +-is a list `(CLOSE OPEN)', where CLOSE is a list of annotations to
250 +-close and OPEN a list of annotations to open. Each of these lists
251 +-has the form `(ANNOTATION PARAM ...)'."
252 +- (let ((annotation "x-display")
253 +- (param (prin1-to-string (or old new))))
254 +- (if (null old)
255 +- (cons nil (list (list annotation param)))
256 +- (cons (list (list annotation param)) nil))))
257 +-
258 +-(defun enriched-decode-display-prop (start end &optional param)
259 +- "Decode a `display' property for text between START and END.
260 +-PARAM is a `<param>' found for the property.
261 +-Value is a list `(START END SYMBOL VALUE)' with START and END denoting
262 +-the range of text to assign text property SYMBOL with value VALUE."
263 +- (let ((prop (when (stringp param)
264 +- (condition-case ()
265 +- (car (read-from-string param))
266 +- (error nil)))))
267 +- (unless prop
268 +- (message "Warning: invalid <x-display> parameter %s" param))
269 +- (list start end 'display prop)))
270 +
271 + ;;; enriched.el ends here