[packages/emacs] Rel 2; security fix

arekm arekm at pld-linux.org
Sun Aug 23 01:44:19 CEST 2026


commit 067c8ebb4f1edcb75852e2a72ba91d6497e9b933
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sun Aug 23 01:44:10 2026 +0200

    Rel 2; security fix

 emacs-shorthands-code-execution.patch | 59 +++++++++++++++++++++++++++++++++++
 emacs.spec                            |  7 +++--
 2 files changed, 64 insertions(+), 2 deletions(-)
---
diff --git a/emacs.spec b/emacs.spec
index 8dbacd9..8057b04 100644
--- a/emacs.spec
+++ b/emacs.spec
@@ -18,10 +18,10 @@ Summary(tr.UTF-8):	GNU Emacs
 Name:		emacs
 %define	ver	30.2
 Version:	%{ver}
-Release:	1
+Release:	2
 License:	GPL v3+
 Group:		Applications/Editors/Emacs
-Source0:	ftp://ftp.gnu.org/pub/gnu/emacs/%{name}-%{version}.tar.xz
+Source0:	https://ftp.gnu.org/gnu/emacs/%{name}-%{version}.tar.xz
 # Source0-md5:	0adba4843ac864ba8c3c9b2a7deea176
 Source1:	%{name}-dot%{name}
 Source2:	%{name}-site-start.el
@@ -33,6 +33,8 @@ Source7:	%{name}-gtk.desktop
 Source8:	%{name}-motif.desktop
 Source9:	%{name}-nox.desktop
 Patch0:		%{name}-file-expand-wildcards-permission.patch
+# https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-31&id=8466eb44991707d128110bdc549fad14c8e1d61e
+Patch1:		%{name}-shorthands-code-execution.patch
 URL:		http://www.gnu.org/software/emacs/
 BuildRequires:	freetype-devel
 BuildRequires:	giflib-devel
@@ -370,6 +372,7 @@ exit 1
 
 %setup -q -n %{name}-%{ver}
 %patch -P0 -p1
+%patch -P1 -p1
 
 %build
 
diff --git a/emacs-shorthands-code-execution.patch b/emacs-shorthands-code-execution.patch
new file mode 100644
index 0000000..d700d04
--- /dev/null
+++ b/emacs-shorthands-code-execution.patch
@@ -0,0 +1,59 @@
+From 8466eb44991707d128110bdc549fad14c8e1d61e Mon Sep 17 00:00:00 2001
+From: Eshel Yaron <me at eshelyaron.com>
+Date: Wed, 5 Aug 2026 19:58:32 +0200
+Subject: Mitigate arbitrary code execution vulnerability
+
+This mitigates a vulnerability that allowed a specially
+crafted file to trigger execution of attacker-controlled
+arbitrary Emacs Lisp code immediately when the file is
+visited in Emacs (before the file's malicious contents are
+even displayed).  See demonstration in bug#80574.
+
+* lisp/progmodes/cc-fonts.el (c-compose-keywords-list):
+* lisp/vc/vc-hooks.el (vc-find-backend-function):
+Nullify 'read-symbol-shorthands' around risky 'intern' calls.
+Do not merge to master.
+---
+ lisp/progmodes/cc-fonts.el | 10 +++++++---
+ lisp/vc/vc-hooks.el        |  5 ++++-
+ 2 files changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
+index 9103787df7a..49346f81dfb 100644
+--- a/lisp/progmodes/cc-fonts.el
++++ b/lisp/progmodes/cc-fonts.el
+@@ -2585,9 +2585,13 @@ higher."
+   (let* ((doc-keywords (c-get-doc-comment-style))
+ 	 (list (nconc (c--mapcan
+ 		       (lambda (doc-style)
+-			 (let ((sym (intern
+-				     (concat (symbol-name doc-style)
+-					     "-font-lock-keywords"))))
++			 (let ((sym
++				;; Guard `intern' from potentially
++				;; malicious shorthands.
++				(let (read-symbol-shorthands)
++				  (intern
++				   (concat (symbol-name doc-style)
++					   "-font-lock-keywords")))))
+ 			   (cond ((fboundp sym)
+ 				  (funcall sym))
+ 				 ((boundp sym)
+diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
+index 132b9211f88..5775983fd91 100644
+--- a/lisp/vc/vc-hooks.el
++++ b/lisp/vc/vc-hooks.el
+@@ -299,7 +299,10 @@ properties further down the directory hierarchy override ones higher up."
+   "Return BACKEND-specific implementation of FUN.
+ If there is no such implementation, return the default implementation;
+ if that doesn't exist either, return nil."
+-  (let ((f (vc-make-backend-sym backend fun)))
++  ;; Nullify `read-symbol-shorthands' to guard the `intern' calls below
++  ;; and in `vc-make-backend-sym' from potentially malicious shorthands.
++  (let* ((read-symbol-shorthands nil)
++         (f (vc-make-backend-sym backend fun)))
+     (if (fboundp f) f
+       ;; Load vc-BACKEND.el if needed.
+       (require (intern (concat "vc-" (downcase (symbol-name backend)))))
+-- 
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/emacs.git/commitdiff/067c8ebb4f1edcb75852e2a72ba91d6497e9b933



More information about the pld-cvs-commit mailing list