From patchwork Sun Oct 19 17:37:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyorgy Sarvari X-Patchwork-Id: 72677 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6436CCD184 for ; Sun, 19 Oct 2025 17:37:19 +0000 (UTC) Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by mx.groups.io with SMTP id smtpd.web10.711.1760895435937531580 for ; Sun, 19 Oct 2025 10:37:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UC3eKFCE; spf=pass (domain: gmail.com, ip: 209.85.218.44, mailfrom: skandigraun@gmail.com) Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-b5b823b4f3dso686451066b.3 for ; Sun, 19 Oct 2025 10:37:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760895434; x=1761500234; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=9vg1TyhERvugyxnaEQUtX2rIbGFG38ArvytCi9V8rws=; b=UC3eKFCE+hTuvKtt8tPLH/2pZww5NbtDx1nDoeNTB+0i9GpVVHBfZoNzm48EvsBkkR cpzrhxz8TS9iASdiQLFpwllnT345Cl5ZiE0xdzt63sYAy0wbpJUQRbF9jbWSaysC6uPQ l/5kl2m1dfvz+cwTA20wE/+BX/rVhAUIcvypAEFGVn9Yv3STw+PuGOCABY3bB44xt/aP zHUZeXJ3e8xctqU8Sh+CxmYlNEiYIxfcHPd01tZjBA9xCpPY/7jdchg6xLPC3oUDjRT/ Ggzn2YQ6/E5WF5qNKkNPJhpBOI95ZTX6CI6hkNUFi1qnzhAWp8AG/q4oB72N+C3Kufap 6Fkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760895434; x=1761500234; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9vg1TyhERvugyxnaEQUtX2rIbGFG38ArvytCi9V8rws=; b=cqn7MdFZr4hyjO/1bB6/FA8uX4vZopm2mnttWXCuNetaJ1kRlcxP89Gk8BihYjiBKh CEMZ5QCUozUZeUUWryV6N5CoKlR20j+RDn/BmfLVnhiUuBvBbvkJsly6DIOXyxX2NtFN F/+QYQTTbXujgTEb1ctfIZjGrrkL71BKh3/4/dVjsrRDMwhFDirZPE8D5SKAuhq8JD6E K618k7njQ7TihepuwpEjyWsO2nsZx1JvK0x5uFEd2e/jxWW6CO7QttA4CPVHiTIGFnVT TWPSAyTZapPz2TmfEtHZkTVWkzas+NDFi6ObhWaZlh5jxv5II6bwUDKfZjWzx79nr8qL dgqg== X-Gm-Message-State: AOJu0YznVDM+H1hx0Y3LrfigVen2/52NwHERf3RIBXI5+5VkH0G/Ap2W 0ZRJTlkydBzWolhlxa34OjT6Z5ZVHP3wCyFrX+l3m3czVsketMwfwEU+PkpTFg== X-Gm-Gg: ASbGncuIOfsyrpujK5TQyqFHQgjCjMIq12cdn60yoi/EMQdqlZ1rQjeEx3sgg/eKyJ0 fIT/MvCEE6Xcvm8LG6Qy5kcXJtTd0yv8jvXE+rNpLh/2iwmz+sblJNpAeHa/lFuv4Bp5lQiw6PG YnbcC6Y84sGqw0zkQ6pYwsDUE+34mjKUFhOZVhm/Os9m7+wW4yTdA5rSwB/URuh8MKTODXnIHZ0 al4EFfEJofm3UPIX5sZXF88KtyErbbOsq+5v0ASe5mh0ws/l2M8v+MnF/fRQUf3WkPhgkVzlzny FRLQN/VQTTzB6wouMLhlFQNHneR3+XDkOk26UtNm/IvpLK320DIhEObd8hPte10alFxMk13r3v2 LUeTXRgd/OVrFq2/L5omt7OhrDAWv+gw88/Ed9Z+jeUE61RF9XYA0uMHXaeMcDklNtq6dfl45WU gEutY3AQVVxYaDUxryJBY= X-Google-Smtp-Source: AGHT+IFNbBotqI/N1yvtT2je4LZUoI5mHQgcs3B4fuMGnC0QqAp3ktd4PimURPMM/DnRTu7HJI1Mng== X-Received: by 2002:a17:906:2c0c:b0:b64:8464:68cb with SMTP id a640c23a62f3a-b64846468f0mr908853466b.10.1760895434187; Sun, 19 Oct 2025 10:37:14 -0700 (PDT) Received: from desktop ([51.154.145.205]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b65eb036884sm546101966b.40.2025.10.19.10.37.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Oct 2025 10:37:13 -0700 (PDT) From: Gyorgy Sarvari To: openembedded-devel@lists.openembedded.org Subject: [meta-oe][scarthgap][PATCH v3 1/5] emacs: patch CVE-2024-30202 Date: Sun, 19 Oct 2025 19:37:08 +0200 Message-ID: <20251019173712.1460844-2-skandigraun@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251019173712.1460844-1-skandigraun@gmail.com> References: <20251019173712.1460844-1-skandigraun@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 19 Oct 2025 17:37:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/120803 Details: https://nvd.nist.gov/vuln/detail/CVE-2024-30202 Backport the patch mentioned in the details of the link. Signed-off-by: Gyorgy Sarvari --- meta-oe/recipes-support/emacs/emacs_29.1.bb | 1 + ...et-templates-Prevent-code-evaluation.patch | 47 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 meta-oe/recipes-support/emacs/files/0001-org-macro-set-templates-Prevent-code-evaluation.patch diff --git a/meta-oe/recipes-support/emacs/emacs_29.1.bb b/meta-oe/recipes-support/emacs/emacs_29.1.bb index 5cbe4551c0..5375c17f30 100644 --- a/meta-oe/recipes-support/emacs/emacs_29.1.bb +++ b/meta-oe/recipes-support/emacs/emacs_29.1.bb @@ -5,6 +5,7 @@ LICENSE = "GPL-3.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464" SRC_URI = "https://ftp.gnu.org/pub/gnu/emacs/emacs-${PV}.tar.xz \ + file://0001-org-macro-set-templates-Prevent-code-evaluation.patch \ " SRC_URI:append:class-target = " \ file://use-emacs-native-tools-for-cross-compiling.patch \ diff --git a/meta-oe/recipes-support/emacs/files/0001-org-macro-set-templates-Prevent-code-evaluation.patch b/meta-oe/recipes-support/emacs/files/0001-org-macro-set-templates-Prevent-code-evaluation.patch new file mode 100644 index 0000000000..c88843da59 --- /dev/null +++ b/meta-oe/recipes-support/emacs/files/0001-org-macro-set-templates-Prevent-code-evaluation.patch @@ -0,0 +1,47 @@ +From 7b1f10c152e69a32155c0291b9c8e83a8e28ebff Mon Sep 17 00:00:00 2001 +From: Ihor Radchenko +Date: Tue, 20 Feb 2024 12:19:46 +0300 +Subject: [PATCH] org-macro--set-templates: Prevent code evaluation + +* lisp/org/org-macro.el (org-macro--set-templates): Get rid of any +risk to evaluate code when `org-macro--set-templates' is called as a +part of major mode initialization. This way, no code evaluation is +ever triggered when user merely opens the file or when +`mm-display-org-inline' invokes Org major mode to fontify mime part +preview in email messages. + +CVE: CVE-2024-30202 + +Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-29&id=befa9fcaae29a6c9a283ba371c3c5234c7f644eb] +Signed-off-by: Gyorgy Sarvari +--- + lisp/org/org-macro.el | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/lisp/org/org-macro.el b/lisp/org/org-macro.el +index 481e431..a3b5c6e 100644 +--- a/lisp/org/org-macro.el ++++ b/lisp/org/org-macro.el +@@ -109,6 +109,13 @@ previous one, unless VALUE is nil. Return the updated list." + (let ((new-templates nil)) + (pcase-dolist (`(,name . ,value) templates) + (let ((old-definition (assoc name new-templates))) ++ ;; This code can be evaluated unconditionally, as a part of ++ ;; loading Org mode. We *must not* evaluate any code present ++ ;; inside the Org buffer while loading. Org buffers may come ++ ;; from various sources, like received email messages from ++ ;; potentially malicious senders. Org mode might be used to ++ ;; preview such messages and no code evaluation from inside the ++ ;; received Org text should ever happen without user consent. + (when (and (stringp value) (string-match-p "\\`(eval\\>" value)) + ;; Pre-process the evaluation form for faster macro expansion. + (let* ((args (org-macro--makeargs value)) +@@ -121,7 +128,7 @@ previous one, unless VALUE is nil. Return the updated list." + (cadr (read value)) + (error + (user-error "Invalid definition for macro %S" name))))) +- (setq value (eval (macroexpand-all `(lambda ,args ,body)) t)))) ++ (setq value `(lambda ,args ,body)))) + (cond ((and value old-definition) (setcdr old-definition value)) + (old-definition) + (t (push (cons name (or value "")) new-templates))))) From patchwork Sun Oct 19 17:37:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyorgy Sarvari X-Patchwork-Id: 72678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B497CCCD1AB for ; Sun, 19 Oct 2025 17:37:19 +0000 (UTC) Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by mx.groups.io with SMTP id smtpd.web10.712.1760895436537911080 for ; Sun, 19 Oct 2025 10:37:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=S5TZW30l; spf=pass (domain: gmail.com, ip: 209.85.218.46, mailfrom: skandigraun@gmail.com) Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-b463f986f80so716982466b.2 for ; Sun, 19 Oct 2025 10:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760895435; x=1761500235; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Ugs74biWZY1Xs4z+kn1cxfoaJ8uCjPc4IfZMw/T6Mjs=; b=S5TZW30l0+rtwxWr2HBD8j82GBywJaHb61ZHpVuFMBF3+AX0spsVyzDgDakenkdbPq 3mLNMOw50w05juqPatYCqI1qlbafXGQ62gVutACH2xfFJbbNQ2cmgPsek5TPjBXVOUkI VEnxuaqhYPwxjXEwe5qQfswM4J0RioXdy8oVHjUnkD6YsyojFw662tLMCu9hUOTbuyGc 8nox4Ts7yQByKrqEd4f6rgX6CG3U0meSIjMfev7FrGfGkras14Q5/OPxmicwYvWBytav aEo1OoE4SYzAIQtr6BzpOwOiByhlovwHRK5pG9F7yehb7FTpwqpv5zhGcflB6TLlqRIf Dksg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760895435; x=1761500235; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ugs74biWZY1Xs4z+kn1cxfoaJ8uCjPc4IfZMw/T6Mjs=; b=G/tYRCqzE0QlOPJXFc7R9nAklogynq/jciKw9CcCfwtYu6NUMYLwG2zRJ4sOt8g12Q qH0eAkpPa5vKzbhwAGEmcH15yZ/FDiGTaUmAUMURWbMea6tw18CCYpivuabzsS+FX/So f+G5M9uhkdI/ChUNjxFi5vqFXBk/5LQ7IrGI34TKifoSuy+DYaKTSKGttcGzhT37VfXF sNJZtXHA5esfDK9URDpNrd3xTlt7R6RyewnoE1MXvAkBACDA8DInMe/Kw0dSpXCEaH2J YQGPuDXh3huGUs1t/9bF8l3yb+HC2rJldPiovhyEeJ6EseXwl1yQ8S3aPxWbNOV2aPPH ToxQ== X-Gm-Message-State: AOJu0YyWcjdZMGUhvVKVSJD/GXj/qJLn61mql2X+SlrLxZs4PJMaReQM /oI/PCxaYjsQPvt80agKT5ZR6Fb2Y55Brl31bwrHZa5QmkGsJWvjnGz2x/s8kg== X-Gm-Gg: ASbGncuy8dmGsQthYP8wgL+zY1RyMJd5hs+zWvGVNUkyNSvTQ0sb8bPimdAkOS0v6On igFRcHmWxJt0bXtIJpHyFQBG991GpTlKBd6H8fENAIBmF91AjArfo/jb6v9Eunmcj6FeFRqOtCo H1CC6mo5BG91iysV4zc3kTwVlVwJVrWT4wM7zRsgoexkcJZj09tbCF9nwfoh6kCLuKEy7RbL+CT bR6qqEEPChTNJv+oo98fZjooVGcAFGwoexk48GG28/Y/hlyl5StE8Vtlyw10UND493pEzCeq8wH 4/v1xhaTtLu6C6dVDBGweAmNav1teolH4nl4UwjTCbfIeLzCiRtbQtwbM/K8fKsW0THNEiD0MuQ EIo6uq+BX4yGAUt/RFxvgLzbWe974K7If5ZMHwxku7JuhfftYJoZqVZgoYtcTUNgawB+lXmlsrV qM/h6t5qH5 X-Google-Smtp-Source: AGHT+IFXmJHcymRwKB77zfXpR3u4BJ+t/ArccajlKAHTYFVPTWzRr6cKkv1aZBP5nqvYdpuwmRsTiQ== X-Received: by 2002:a17:907:3e24:b0:b04:25e6:2ddc with SMTP id a640c23a62f3a-b6472b5f33fmr1136973766b.8.1760895434812; Sun, 19 Oct 2025 10:37:14 -0700 (PDT) Received: from desktop ([51.154.145.205]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b65eb036884sm546101966b.40.2025.10.19.10.37.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Oct 2025 10:37:14 -0700 (PDT) From: Gyorgy Sarvari To: openembedded-devel@lists.openembedded.org Subject: [meta-oe][scarthgap][PATCH v3 2/5] emacs: patch CVE-2024-30203 Date: Sun, 19 Oct 2025 19:37:09 +0200 Message-ID: <20251019173712.1460844-3-skandigraun@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251019173712.1460844-1-skandigraun@gmail.com> References: <20251019173712.1460844-1-skandigraun@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 19 Oct 2025 17:37:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/120804 Details: https://nvd.nist.gov/vuln/detail/CVE-2024-30203 Pick the patch mentioned in the description. Signed-off-by: Gyorgy Sarvari --- meta-oe/recipes-support/emacs/emacs_29.1.bb | 1 + ...w.el-mm-display-inline-fontify-Mark-.patch | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 meta-oe/recipes-support/emacs/files/0001-lisp-gnus-mm-view.el-mm-display-inline-fontify-Mark-.patch diff --git a/meta-oe/recipes-support/emacs/emacs_29.1.bb b/meta-oe/recipes-support/emacs/emacs_29.1.bb index 5375c17f30..7d5b3cd3fb 100644 --- a/meta-oe/recipes-support/emacs/emacs_29.1.bb +++ b/meta-oe/recipes-support/emacs/emacs_29.1.bb @@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464" SRC_URI = "https://ftp.gnu.org/pub/gnu/emacs/emacs-${PV}.tar.xz \ file://0001-org-macro-set-templates-Prevent-code-evaluation.patch \ + file://0001-lisp-gnus-mm-view.el-mm-display-inline-fontify-Mark-.patch \ " SRC_URI:append:class-target = " \ file://use-emacs-native-tools-for-cross-compiling.patch \ diff --git a/meta-oe/recipes-support/emacs/files/0001-lisp-gnus-mm-view.el-mm-display-inline-fontify-Mark-.patch b/meta-oe/recipes-support/emacs/files/0001-lisp-gnus-mm-view.el-mm-display-inline-fontify-Mark-.patch new file mode 100644 index 0000000000..d951bf4205 --- /dev/null +++ b/meta-oe/recipes-support/emacs/files/0001-lisp-gnus-mm-view.el-mm-display-inline-fontify-Mark-.patch @@ -0,0 +1,27 @@ +From 0e7fe7809daa123921faa0bd088931cf8ddfd705 Mon Sep 17 00:00:00 2001 +From: Ihor Radchenko +Date: Tue, 20 Feb 2024 12:44:30 +0300 +Subject: [PATCH] * lisp/gnus/mm-view.el (mm-display-inline-fontify): Mark + contents untrusted. + +CVE: CVE-2024-30203 + +Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-29&id=937b9042ad7426acdcca33e3d931d8f495bdd804] + +Signed-off-by: Gyorgy Sarvari +--- + lisp/gnus/mm-view.el | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el +index 2c40735..e24f3f3 100644 +--- a/lisp/gnus/mm-view.el ++++ b/lisp/gnus/mm-view.el +@@ -504,6 +504,7 @@ If MODE is not set, try to find mode automatically." + (setq coding-system (mm-find-buffer-file-coding-system))) + (setq text (buffer-string)))) + (with-temp-buffer ++ (setq untrusted-content t) + (insert (cond ((eq charset 'gnus-decoded) + (with-current-buffer (mm-handle-buffer handle) + (buffer-string))) From patchwork Sun Oct 19 17:37:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyorgy Sarvari X-Patchwork-Id: 72676 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B46D0CCD1AA for ; Sun, 19 Oct 2025 17:37:19 +0000 (UTC) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by mx.groups.io with SMTP id smtpd.web10.713.1760895437335401836 for ; Sun, 19 Oct 2025 10:37:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KTv4Nkre; spf=pass (domain: gmail.com, ip: 209.85.218.41, mailfrom: skandigraun@gmail.com) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-b3c2db014easo788289566b.0 for ; Sun, 19 Oct 2025 10:37:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760895436; x=1761500236; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=VzfStEPODpDcRZrAa2DWw1x6BadhhN6KDB6Kg2uFJtg=; b=KTv4NkredS1lj49iMDH6hRtQTbhfEV83BZZ2DJZPuJQWaoD8goWGd6ybUtF+CsTjHE mYRhpKw8EOLg++pJe/ECwC3salQZfxw9d6IB1OhpNywhFL3JqtzrvAXAzyVqOqsYscEA IPRyfmIc7h60k7TFRcemoAzuQ0+6nkzb7I8FDs24kMbyS5+JVQ1PjYiKiJG5VxwH1JGI yugHIEk9KQVCADyq08nGJqUrDsHlzLfllO/pS1Mj3yoz9FHQCme+IcWZXMxRqCuiJDEL WXTGwyODmMVAdkoWzwawcFpChuni+cND3thLyAlw1vH14t+v4D3r6u1kPSv4ttDr5qKg ulUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760895436; x=1761500236; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VzfStEPODpDcRZrAa2DWw1x6BadhhN6KDB6Kg2uFJtg=; b=Wgv6BY8NYhA0uH3AquyIzsgzG9BV3tYhAuA56Fc5opjKzzaWi9UGRO6fB7l1Thj6bu y4TPjWh9LKEnqQCRlUc9oX92W4cASnEiV7SRC+s2gwY/yoeNSc5Y6EcLcG2fVDXvHggg sACB1TWIZUzJD7iMs22Bv1z9RVUhCfyltKq9+jHRA7GBL9IJ4+yGlfpUAp/Awmjr9RP/ AtAx9d2w69skkYYmkb4Bl3sI7DMIl2kbC175KHEmkrBvKjQVyMJubluQ8xbqWImdPWOq GaEm8LSpi9hK1d9NcKZsfIOOf+q063Mk09HBmL6Nmp1piqGRklwyMskI65Tbq2Kt63IU wiWQ== X-Gm-Message-State: AOJu0Yx3tSN7DsW3cw6IrBIPF0KVb9zOOsZQz9H9D/kAr7PvZtL+bz3w KH2UfOyEXCS3ZP4W7nGNc/e4xbifSJVQz6Xwxb45l/Q1GvfhQRm+tScjGjS0rw== X-Gm-Gg: ASbGncsspzpTQtKEznrA4fdDlzaPJ7BUEkW4IZBJyHK+zBicTBWEbQx3nGnHIvrstmn P0gOAGExNH/35Aw8M0fuFCilKEb9K34aC7VxLGiGKgKhuPp/Sxtr3GWLkqOUtS6UC3zqcDBSAVJ IFLFKVU/01DTrtDZQopTGgIfd8P6+sRw1aoveSK1FAyV/mJxjGV3pqkflvTxQTtznJ9yEEhkDIE JsnhYchMRFmui9DOIrd90In2RClxgUw+Olh2GcsWH3wU9tHG/QsD+fJFt5Xyl5YMvtGdZzYfJy8 919x9v+6f6WPvXibps28ZKfEAehz0OOM5MjixnaSerW39iGfgPk9gkCheEYLw3wPV6tvdRygB0b 98CmDxYhQhWKuT1YLf90qzvonSkb+mRFHOwomx/xUk74Yz4edtuiE9HP7mcLCNMN8omA1BzZG3J b0e68RVQvr X-Google-Smtp-Source: AGHT+IHabnhJ9G1KuuMe/0px2flGL6RSs7KSUBuulsd9WGjN07gVKpaUTAxk2W3zdLX8KGg1V5S2tg== X-Received: by 2002:a17:907:3f11:b0:b41:f155:404b with SMTP id a640c23a62f3a-b64730472aamr1181458966b.17.1760895435445; Sun, 19 Oct 2025 10:37:15 -0700 (PDT) Received: from desktop ([51.154.145.205]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b65eb036884sm546101966b.40.2025.10.19.10.37.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Oct 2025 10:37:15 -0700 (PDT) From: Gyorgy Sarvari To: openembedded-devel@lists.openembedded.org Subject: [meta-oe][scarthgap][PATCH v3 3/5] emacs: patch CVE-2024-30204 Date: Sun, 19 Oct 2025 19:37:10 +0200 Message-ID: <20251019173712.1460844-4-skandigraun@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251019173712.1460844-1-skandigraun@gmail.com> References: <20251019173712.1460844-1-skandigraun@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 19 Oct 2025 17:37:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/120805 Details: https://nvd.nist.gov/vuln/detail/CVE-2024-30204 Pick the patch that's mentioned in the description. Signed-off-by: Gyorgy Sarvari --- meta-oe/recipes-support/emacs/emacs_29.1.bb | 1 + ...w-Add-protection-when-untrusted-cont.patch | 60 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 meta-oe/recipes-support/emacs/files/0001-org-latex-preview-Add-protection-when-untrusted-cont.patch diff --git a/meta-oe/recipes-support/emacs/emacs_29.1.bb b/meta-oe/recipes-support/emacs/emacs_29.1.bb index 7d5b3cd3fb..f0666a41c4 100644 --- a/meta-oe/recipes-support/emacs/emacs_29.1.bb +++ b/meta-oe/recipes-support/emacs/emacs_29.1.bb @@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464" SRC_URI = "https://ftp.gnu.org/pub/gnu/emacs/emacs-${PV}.tar.xz \ file://0001-org-macro-set-templates-Prevent-code-evaluation.patch \ file://0001-lisp-gnus-mm-view.el-mm-display-inline-fontify-Mark-.patch \ + file://0001-org-latex-preview-Add-protection-when-untrusted-cont.patch \ " SRC_URI:append:class-target = " \ file://use-emacs-native-tools-for-cross-compiling.patch \ diff --git a/meta-oe/recipes-support/emacs/files/0001-org-latex-preview-Add-protection-when-untrusted-cont.patch b/meta-oe/recipes-support/emacs/files/0001-org-latex-preview-Add-protection-when-untrusted-cont.patch new file mode 100644 index 0000000000..085bc31c17 --- /dev/null +++ b/meta-oe/recipes-support/emacs/files/0001-org-latex-preview-Add-protection-when-untrusted-cont.patch @@ -0,0 +1,60 @@ +From c5cc03c196306372e53700553e0fb5135f6105e6 Mon Sep 17 00:00:00 2001 +From: Ihor Radchenko +Date: Tue, 20 Feb 2024 12:47:24 +0300 +Subject: [PATCH] org-latex-preview: Add protection when `untrusted-content' is + non-nil + +* lisp/org/org.el (org--latex-preview-when-risky): New variable +controlling how to handle LaTeX previews in Org files from untrusted +origin. +(org-latex-preview): Consult `org--latex-preview-when-risky' before +generating previews. + +This patch adds a layer of protection when LaTeX preview is requested +for an email attachment, where `untrusted-content' is set to non-nil. + +CVE: CVE-2024-30204 + +Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-29&id=6f9ea396f49cbe38c2173e0a72ba6af3e03b271c] +Signed-off-by: Gyorgy Sarvari +--- + lisp/org/org.el | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/lisp/org/org.el b/lisp/org/org.el +index d3e14fe..ab58978 100644 +--- a/lisp/org/org.el ++++ b/lisp/org/org.el +@@ -1140,6 +1140,24 @@ the following lines anywhere in the buffer: + :package-version '(Org . "8.0") + :type 'boolean) + ++(defvar untrusted-content) ; defined in files.el ++(defvar org--latex-preview-when-risky nil ++ "If non-nil, enable LaTeX preview in Org buffers from unsafe source. ++ ++Some specially designed LaTeX code may generate huge pdf or log files ++that may exhaust disk space. ++ ++This variable controls how to handle LaTeX preview when rendering LaTeX ++fragments that originate from incoming email messages. It has no effect ++when Org mode is unable to determine the origin of the Org buffer. ++ ++An Org buffer is considered to be from unsafe source when the ++variable `untrusted-content' has a non-nil value in the buffer. ++ ++If this variable is non-nil, LaTeX previews are rendered unconditionally. ++ ++This variable may be renamed or changed in the future.") ++ + (defcustom org-insert-mode-line-in-empty-file nil + "Non-nil means insert the first line setting Org mode in empty files. + When the function `org-mode' is called interactively in an empty file, this +@@ -15687,6 +15705,7 @@ fragments in the buffer." + (interactive "P") + (cond + ((not (display-graphic-p)) nil) ++ ((and untrusted-content (not org--latex-preview-when-risky)) nil) + ;; Clear whole buffer. + ((equal arg '(64)) + (org-clear-latex-preview (point-min) (point-max)) From patchwork Sun Oct 19 17:37:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyorgy Sarvari X-Patchwork-Id: 72675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8FBCCCD1A7 for ; Sun, 19 Oct 2025 17:37:19 +0000 (UTC) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by mx.groups.io with SMTP id smtpd.web10.714.1760895437812323455 for ; Sun, 19 Oct 2025 10:37:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eiHikviP; spf=pass (domain: gmail.com, ip: 209.85.218.47, mailfrom: skandigraun@gmail.com) Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-b456d2dc440so573296766b.0 for ; Sun, 19 Oct 2025 10:37:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760895436; x=1761500236; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=EYoCXOumnYELXiTKxkvBrQSAUPNxHqbkZJ4/VvMw4R4=; b=eiHikviPM6wZAXs4y2E9ZZ4dZ4WOTK528sUAhaK54qm6jWetvKsULFCtT71ovu/Aha SCIhBQBKTx3eHBbKWLlZCz07Li5l/0G66guqi+NPmjehPPK8x3AqX7DDE5zk/T/SFlkZ kEyDO9leEPmumQdV9Sw2PV2tx2hr6esJdiCxwgxLqLmOGhpRbabtNbo6ZuYexhSF5zb5 SZ6Duq2ZFxiD4811GwIlOg4DJZEmrY+cV12Q0ICXIZ7rPwg700Ic/jEJA0Hfky3/+4lb ZWeod3/bqmM517e7lPC79yYOAritgLm3Jtbce5GA65D8+sDfVhkjOBeScUKi1dDsNfy5 ttSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760895436; x=1761500236; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EYoCXOumnYELXiTKxkvBrQSAUPNxHqbkZJ4/VvMw4R4=; b=f3hetEJOPJQMc6jUtxySJipJaKd4xGaM3CNS3kUqTTk7hkXCT7hIpVqnwEbdd7cQuq kqcreT7tG/VGAaswLljxRsr41v6Pd0d8ZBn2X4k59/myuLpGz3avlqnCy6Au6uoaDmT0 PHOtjIbW6J02kUg2/s3qUuao8RPnYldUSDIN/V36sZ8bloN8VeDMKiIXkq3TVSUpskhk /4rq8yyvm/jWUA8doHfNxbSAGusH4pLHKC6J2EeA/9kCJqMe9zWYqG/YWoiPLz1bAPMm l86b7UIySzCw/JPjhwILAU6WOnP8ivyQ6tI31Pe6O+G6I1Kv3yupZjnWTQbcMzJ0gx9x nCOg== X-Gm-Message-State: AOJu0YxSXfpnJ2Xg3ncdZn1cyKu0UPnWUjZfXTynf1Dq3FYJsfyqMMpi bDIcVDotbsB7teRtR8DkP0mh5DF1ASfPEfbpV0uKNHrWVmucIAzW4KCAJ7Prjw== X-Gm-Gg: ASbGncv1SLZEmWwjp0Bvoltk7ypnt616GkdsdBbcgU+6bvc15uSbjRrhFtKd5SHjPkV 0Lid7Dcgvs94YnV6KZXLHvLB31lAX77EJf33FSUusGRo0E3vgNtrc92yW8Hr+8FPb1x+4rLR0MA sRUqzUKj5QeEfqDFqzZB1OeEmm7WhiPpb/zjSkhIb9zv+HQrL/gWrmwLgoJ92j5lpSpAvgD+Ptu vJpthPcl50STMtV0ShpkvkFdBwjMDgEVfsciohXspJ9k5mXLfZcgsqCsnEGz4TpqApydm2nRC2v DuSf7TzM8K9rZ0S4WGDZB0BMxd20NRzN4veivVp7Dw+HfDLwXOoTWuqx4HGNJvcZivDxDHVAEdU Mg4+t1G7oOt7QDam5W1vGfYAq4rd5MZaxSoI1sFbkYfu+X5CZqzK7Q1EYjId4jPo4Ce1hFzvYbI s1NCwxfWGk X-Google-Smtp-Source: AGHT+IGcA8tv0N0Sn9vakzyJ82juu63X6DCA94+lIvDOPvRcpGkmZSI68MdIcNx6YxcmXWNrC3w6UA== X-Received: by 2002:a17:907:26c1:b0:b45:60ad:daff with SMTP id a640c23a62f3a-b6473631232mr1118892166b.28.1760895436042; Sun, 19 Oct 2025 10:37:16 -0700 (PDT) Received: from desktop ([51.154.145.205]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b65eb036884sm546101966b.40.2025.10.19.10.37.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Oct 2025 10:37:15 -0700 (PDT) From: Gyorgy Sarvari To: openembedded-devel@lists.openembedded.org Subject: [meta-oe][scarthgap][PATCH v3 4/5] emacs: patch CVE-2024-30205 Date: Sun, 19 Oct 2025 19:37:11 +0200 Message-ID: <20251019173712.1460844-5-skandigraun@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251019173712.1460844-1-skandigraun@gmail.com> References: <20251019173712.1460844-1-skandigraun@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 19 Oct 2025 17:37:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/120806 Details: https://nvd.nist.gov/vuln/detail/CVE-2024-30205 Pick the patch that's in the description. Signed-off-by: Gyorgy Sarvari --- meta-oe/recipes-support/emacs/emacs_29.1.bb | 1 + ...nts-Consider-all-remote-files-unsafe.patch | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 meta-oe/recipes-support/emacs/files/0001-org-file-contents-Consider-all-remote-files-unsafe.patch diff --git a/meta-oe/recipes-support/emacs/emacs_29.1.bb b/meta-oe/recipes-support/emacs/emacs_29.1.bb index f0666a41c4..abc99d3e08 100644 --- a/meta-oe/recipes-support/emacs/emacs_29.1.bb +++ b/meta-oe/recipes-support/emacs/emacs_29.1.bb @@ -8,6 +8,7 @@ SRC_URI = "https://ftp.gnu.org/pub/gnu/emacs/emacs-${PV}.tar.xz \ file://0001-org-macro-set-templates-Prevent-code-evaluation.patch \ file://0001-lisp-gnus-mm-view.el-mm-display-inline-fontify-Mark-.patch \ file://0001-org-latex-preview-Add-protection-when-untrusted-cont.patch \ + file://0001-org-file-contents-Consider-all-remote-files-unsafe.patch \ " SRC_URI:append:class-target = " \ file://use-emacs-native-tools-for-cross-compiling.patch \ diff --git a/meta-oe/recipes-support/emacs/files/0001-org-file-contents-Consider-all-remote-files-unsafe.patch b/meta-oe/recipes-support/emacs/files/0001-org-file-contents-Consider-all-remote-files-unsafe.patch new file mode 100644 index 0000000000..7408f0e404 --- /dev/null +++ b/meta-oe/recipes-support/emacs/files/0001-org-file-contents-Consider-all-remote-files-unsafe.patch @@ -0,0 +1,38 @@ +From 3a3bc6df4295ff7d5ea7193dfe0492cd858e1664 Mon Sep 17 00:00:00 2001 +From: Ihor Radchenko +Date: Tue, 20 Feb 2024 14:59:20 +0300 +Subject: [PATCH] org-file-contents: Consider all remote files unsafe + +* lisp/org/org.el (org-file-contents): When loading files, consider all +remote files (like TRAMP-fetched files) unsafe, in addition to URLs. + +CVE: CVE-2024-30205 +Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-29&id=2bc865ace050ff118db43f01457f95f95112b877] + +Signed-off-by: Gyorgy Sarvari +--- + lisp/org/org.el | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/lisp/org/org.el b/lisp/org/org.el +index ab58978..03140bd 100644 +--- a/lisp/org/org.el ++++ b/lisp/org/org.el +@@ -4576,12 +4576,16 @@ from file or URL, and return nil. + If NOCACHE is non-nil, do a fresh fetch of FILE even if cached version + is available. This option applies only if FILE is a URL." + (let* ((is-url (org-url-p file)) ++ (is-remote (condition-case nil ++ (file-remote-p file) ++ ;; In case of error, be safe. ++ (t t))) + (cache (and is-url + (not nocache) + (gethash file org--file-cache)))) + (cond + (cache) +- (is-url ++ ((or is-url is-remote) + (if (org--should-fetch-remote-resource-p file) + (condition-case error + (with-current-buffer (url-retrieve-synchronously file) From patchwork Sun Oct 19 17:37:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyorgy Sarvari X-Patchwork-Id: 72674 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A65CECCD195 for ; Sun, 19 Oct 2025 17:37:19 +0000 (UTC) Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by mx.groups.io with SMTP id smtpd.web10.715.1760895438440604076 for ; Sun, 19 Oct 2025 10:37:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OHF4/bjn; spf=pass (domain: gmail.com, ip: 209.85.218.53, mailfrom: skandigraun@gmail.com) Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-b4539dddd99so619038866b.1 for ; Sun, 19 Oct 2025 10:37:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760895437; x=1761500237; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=2Lheu6bPPG+S403mzNgtAohmHDjdgMFRvgS2vhKCS6E=; b=OHF4/bjntX79bB/WVrAycETN8+RSCaB2N23Y+pNl0A+n6CbxL5GQs3Yy4Yt01/JNic qnvun6AiM5cx0HA1bMYHghI1EyNNayo/JsMkJXSvXOEeGKDa+aLTnDhyu781wsfsz1vG WmOKer4AQWlwtoo/4A2cYetQY0Vxj0wInh/qbqwWR7Qxxt/Q7fEEgi1nUXrsWUMGh8Tj GtP8YDRQId8WT2zKFcDzSRyz3z0/ndt2xkwcItZfbnMM8BorHFi331XcIqMdRMKBQE+M DnqbNz5rqF79QXLufMhqs0Nxr3Z/bTo9g4deEvilL9nDEAk2pkyBdodTVzQT8EzUUXY5 UFBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760895437; x=1761500237; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2Lheu6bPPG+S403mzNgtAohmHDjdgMFRvgS2vhKCS6E=; b=qO9r9n7WRyVT4D+/ak5xDkSel1EyredXHHJaL8ojp6dLDGP4DinYA+v6VjOnu5hdzw xmc12gK4IekLLaDgUOtPocNOZLdeNmuApVo8O1VDsCukKYFUX78zAdNHonq96sCCYYRT ayeH+v7CqkxaAZGwc8YMoWxKi6SNP8v8BU95FIw/RiqlIeIVB/Tu7y+u0O/nqbJc4+UV UF53WMnvddFl8MLDki3E0+OYGb6h3ZFA3V9XZC751l6DNDCtr1LNnCy9V8XgFW3/o+M4 eJGtqOwLMlgtpo3g/g7kkp1W+2hyVJaEwY0MHNGx9+rIsGkFVLsfzoOSgTKlpla6pu9W 3GJA== X-Gm-Message-State: AOJu0YwjXgHY7u4ID3bWSuQhEaQ/7Nb8vGStFbUTXJMTHVZsoN+sD/Ej gcNOufcQgvZlZ4kD76eahI2CCoDL3VaqeI5MNcLl0azVIqpH308wDZMyoz5otA== X-Gm-Gg: ASbGncuutMgddN6A/jeT/qowuZiKlZ0eOCkt8rgp+ibkVuE0we3T5HXOhd+8esQDb9d +0zdafv4AjkEIn1AuNYd3Z6uG+ZEBtvQm0wHX3YLjgOgcqYtgUXYLSQMZkw0+wGYiY33RnDh0cW qUFJYL/wcczxZ4V8miZOgrCuuycMfAonPDZ9sDQJuSbQDah8HhomtbN1laGPebb3+pe+DHKcl17 aUV6Or4u2JrYftGCe8b4jYhSmG2lvp8fFJe4fUCg2dk4kJlzz8gQLBV1mz18f3Bf70gy/FMJKBx EkCHP2rxc85nGKpJDCRU10oNLwQe734wA0mBI3sW5W/52X9c19i9sK0v2032JY/yCqrBBCIlBfd HJdr2/mNUJHiL4DKL7NuJbwau3/Zuh+QWSsZGpGJ6Ws1CLgB6hd75fCCsRUcKV9CSL3wJizGtIA == X-Google-Smtp-Source: AGHT+IFdgBawcLEKsnJLM9owJEE+DHjg//i3DU6cANqzPaWHVoSp0ASHtX7OF/FaxThn6JRqB8SQjg== X-Received: by 2002:a17:907:72c6:b0:b2d:9286:506d with SMTP id a640c23a62f3a-b6474940b7dmr1219235266b.38.1760895436726; Sun, 19 Oct 2025 10:37:16 -0700 (PDT) Received: from desktop ([51.154.145.205]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b65eb036884sm546101966b.40.2025.10.19.10.37.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Oct 2025 10:37:16 -0700 (PDT) From: Gyorgy Sarvari To: openembedded-devel@lists.openembedded.org Subject: [meta-oe][scarthgap][PATCH v3 5/5] emacs: patch CVE-2024-39331 Date: Sun, 19 Oct 2025 19:37:12 +0200 Message-ID: <20251019173712.1460844-6-skandigraun@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251019173712.1460844-1-skandigraun@gmail.com> References: <20251019173712.1460844-1-skandigraun@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 19 Oct 2025 17:37:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/120807 Details: https://nvd.nist.gov/vuln/detail/CVE-2024-39331 Pick the patch that's mentioned in thee details. Signed-off-by: Gyorgy Sarvari --- meta-oe/recipes-support/emacs/emacs_29.1.bb | 1 + ...abbrev-Do-not-evaluate-arbitrary-uns.patch | 71 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 meta-oe/recipes-support/emacs/files/0001-org-link-expand-abbrev-Do-not-evaluate-arbitrary-uns.patch diff --git a/meta-oe/recipes-support/emacs/emacs_29.1.bb b/meta-oe/recipes-support/emacs/emacs_29.1.bb index abc99d3e08..23388f309b 100644 --- a/meta-oe/recipes-support/emacs/emacs_29.1.bb +++ b/meta-oe/recipes-support/emacs/emacs_29.1.bb @@ -9,6 +9,7 @@ SRC_URI = "https://ftp.gnu.org/pub/gnu/emacs/emacs-${PV}.tar.xz \ file://0001-lisp-gnus-mm-view.el-mm-display-inline-fontify-Mark-.patch \ file://0001-org-latex-preview-Add-protection-when-untrusted-cont.patch \ file://0001-org-file-contents-Consider-all-remote-files-unsafe.patch \ + file://0001-org-link-expand-abbrev-Do-not-evaluate-arbitrary-uns.patch \ " SRC_URI:append:class-target = " \ file://use-emacs-native-tools-for-cross-compiling.patch \ diff --git a/meta-oe/recipes-support/emacs/files/0001-org-link-expand-abbrev-Do-not-evaluate-arbitrary-uns.patch b/meta-oe/recipes-support/emacs/files/0001-org-link-expand-abbrev-Do-not-evaluate-arbitrary-uns.patch new file mode 100644 index 0000000000..88fdaaf22d --- /dev/null +++ b/meta-oe/recipes-support/emacs/files/0001-org-link-expand-abbrev-Do-not-evaluate-arbitrary-uns.patch @@ -0,0 +1,71 @@ +From 8b8866eb94c7b7140ba94eb2b4e6ead14c0d986d Mon Sep 17 00:00:00 2001 +From: Ihor Radchenko +Date: Fri, 21 Jun 2024 15:45:25 +0200 +Subject: [PATCH] org-link-expand-abbrev: Do not evaluate arbitrary unsafe + Elisp code + +* lisp/org/ol.el (org-link-expand-abbrev): Refuse expanding %(...) +link abbrevs that specify unsafe function. Instead, display a +warning, and do not expand the abbrev. Clear all the text properties +from the returned link, to avoid any potential vulnerabilities caused +by properties that may contain arbitrary Elisp. + +CVE: CVE-2024-39331 +Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?id=c645e1d8205f0f0663ec4a2d27575b238c646c7c] + +Signed-off-by: Gyorgy Sarvari +--- + lisp/org/ol.el | 40 +++++++++++++++++++++++++++++----------- + 1 file changed, 29 insertions(+), 11 deletions(-) + +diff --git a/lisp/org/ol.el b/lisp/org/ol.el +index 9ad191c..c15128f 100644 +--- a/lisp/org/ol.el ++++ b/lisp/org/ol.el +@@ -1063,17 +1063,35 @@ Abbreviations are defined in `org-link-abbrev-alist'." + (if (not as) + link + (setq rpl (cdr as)) +- (cond +- ((symbolp rpl) (funcall rpl tag)) +- ((string-match "%(\\([^)]+\\))" rpl) +- (replace-match +- (save-match-data +- (funcall (intern-soft (match-string 1 rpl)) tag)) +- t t rpl)) +- ((string-match "%s" rpl) (replace-match (or tag "") t t rpl)) +- ((string-match "%h" rpl) +- (replace-match (url-hexify-string (or tag "")) t t rpl)) +- (t (concat rpl tag))))))) ++ ;; Drop any potentially dangerous text properties like ++ ;; `modification-hooks' that may be used as an attack vector. ++ (substring-no-properties ++ (cond ++ ((symbolp rpl) (funcall rpl tag)) ++ ((string-match "%(\\([^)]+\\))" rpl) ++ (let ((rpl-fun-symbol (intern-soft (match-string 1 rpl)))) ++ ;; Using `unsafep-function' is not quite enough because ++ ;; Emacs considers functions like `genenv' safe, while ++ ;; they can potentially be used to expose private system ++ ;; data to attacker if abbreviated link is clicked. ++ (if (or (eq t (get rpl-fun-symbol 'org-link-abbrev-safe)) ++ (eq t (get rpl-fun-symbol 'pure))) ++ (replace-match ++ (save-match-data ++ (funcall (intern-soft (match-string 1 rpl)) tag)) ++ t t rpl) ++ (org-display-warning ++ (format "Disabling unsafe link abbrev: %s ++You may mark function safe via (put '%s 'org-link-abbrev-safe t)" ++ rpl (match-string 1 rpl))) ++ (setq org-link-abbrev-alist-local (delete as org-link-abbrev-alist-local) ++ org-link-abbrev-alist (delete as org-link-abbrev-alist)) ++ link ++ ))) ++ ((string-match "%s" rpl) (replace-match (or tag "") t t rpl)) ++ ((string-match "%h" rpl) ++ (replace-match (url-hexify-string (or tag "")) t t rpl)) ++ (t (concat rpl tag)))))))) + + (defun org-link-open (link &optional arg) + "Open a link object LINK.