From patchwork Sun Oct 19 17:07:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyorgy Sarvari X-Patchwork-Id: 72673 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 76183CCD1AD for ; Sun, 19 Oct 2025 17:07:49 +0000 (UTC) Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by mx.groups.io with SMTP id smtpd.web10.193.1760893660625165096 for ; Sun, 19 Oct 2025 10:07:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZFqSmgu7; spf=pass (domain: gmail.com, ip: 209.85.218.45, mailfrom: skandigraun@gmail.com) Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-b3d196b7eeeso633065966b.0 for ; Sun, 19 Oct 2025 10:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760893659; x=1761498459; 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=UKMX3BVsKhYeP38y7aiQFRPzaRF9pggxY6KjUU+Ac1o=; b=ZFqSmgu7ffD06H/FLo6fiAZxd94nQQ7pfSONGwlL4/bB7RW2oyVhvQspwMvfCHutMo gLLAiR4HKAOu/KJ00TXzygw9Hgf7FSjT00LZl+xkv/0nhJLFZNOaiFoVYqiu4vDzgqRn CGJmGpf34Y0EPi0NeYUyMJzH0rZXMFaRn1ucKpa26Q7qKr/Qq9ZLOCnYTgJuUyEc4ap2 R+ifXBefyN/MqWIZWHP9wDr+YOS4+TN2UspkakQAGFSGUMPRIm61soFMjrH4mV+9uSBO 9hMVs3hk+BLYFG6DYAjttUDuMUA2FjWj1d7uRxWHul7nkIIM1RHD+tQIDIZIoKoBNlz0 KhwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760893659; x=1761498459; 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=UKMX3BVsKhYeP38y7aiQFRPzaRF9pggxY6KjUU+Ac1o=; b=n/96zTiBEEc7adqPoQ4DKrDd1XO+FkjZv1W82RNrYVkVrnsQ9HXZXvCYRqbILhV4f1 XsG3nXMcbyQUbgg2o/+PURCYeiUG2MpgpxsvMt/xx+nDVmthYshdDKjQm6bkKR87tgZs wAMYD3/zMEVYa+XnNyOHP20C+5RJJRUxdC6gfj9411dTn1h96pz+S0ujOMrkzP9GxxDs miRhn14zdiUyBzJZLMypQ4ldBEcseR1nR0IqtSKFJUt+XWuH3eQqR4LeaeVdOBCAiEJW WuiROAqIjINmCjmm2rD5dX20ZOj+fD56WQiK4C41eRRjJFnxyk2mgZZ5lVdgfm1nhVuA NUPw== X-Gm-Message-State: AOJu0Yx41BiKrdxzJePjbV4r2gIPGeKtjsvtkCASe2lgUI0TA3KZxXMC xhW4SEJMdnxJgiIQ8hcLiQ7bfRn21DTWsb5Etn8EGh7VQqm2va6Vp/QqyNG+hg== X-Gm-Gg: ASbGncvNMdYHHYK55he9ePZDtca1BvhqV/YMJNJiiVyoO3DTFNPGzFv+9VYf0Fkbopu flSPBd4mlcL+S8zPp131VxhAWlVXoqIsl2yOD6IixK33QAR5BMF9Lm5RA2oKyBDOePwGT/JzmWA xvgaKR+9L6AHzUg8IuTnqsFCam/yMt/8L6gLnilWSadz+l8+ax29VkC/QZatemWXbLtVKXn6cK1 VSPvbY4woYhps5JoFJiv8VqqAqEb8aipBtJC8MH6SL44zdXonHlO+Xq7UAY1TKxuorYwoY2T4j+ hfWnspl81uWM26UsYMXdOdieNaItGG5OxHbJYFGz9jL+8Gm9p1/EwFXKiPGhL6YoRqtlRGAT1Mr 270CdxecGE81jqe83uoa22IbRySvn3kGybhccncx9qtoiAbNKrrEmLnmp1wL8+54wqlaCmarGjm 4S/BV10mZr X-Google-Smtp-Source: AGHT+IG5Z+DmC9h5BCW2GYX69WkSafC9Eg5v5bo1w2DY+I1bGgzt97mDsdk+re3oh7feSCCI+qKF1A== X-Received: by 2002:a17:907:3daa:b0:b3d:656b:9088 with SMTP id a640c23a62f3a-b64749416admr1356290066b.54.1760893658819; Sun, 19 Oct 2025 10:07:38 -0700 (PDT) Received: from desktop ([51.154.145.205]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b65ebb499dasm556206766b.73.2025.10.19.10.07.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Oct 2025 10:07:38 -0700 (PDT) From: Gyorgy Sarvari To: openembedded-devel@lists.openembedded.org Subject: [meta-oe][scarthgap][PATCH v2 1/5] emacs: patch CVE-2024-30202 Date: Sun, 19 Oct 2025 19:07:33 +0200 Message-ID: <20251019170737.1311808-2-skandigraun@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251019170737.1311808-1-skandigraun@gmail.com> References: <20251019170737.1311808-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:07:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/120797 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 | 6 +++ ...et-templates-Prevent-code-evaluation.patch | 47 +++++++++++++++++++ 2 files changed, 53 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..b1b795dace 100644 --- a/meta-oe/recipes-support/emacs/emacs_29.1.bb +++ b/meta-oe/recipes-support/emacs/emacs_29.1.bb @@ -5,10 +5,16 @@ 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 \ file://avoid-running-host-binaries-for-sanity.patch \ + 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 \ + file://0001-org-link-expand-abbrev-Do-not-evaluate-arbitrary-uns.patch \ " SRC_URI[sha256sum] = "d2f881a5cc231e2f5a03e86f4584b0438f83edd7598a09d24a21bd8d003e2e01" 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:07:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyorgy Sarvari X-Patchwork-Id: 72670 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 66F68CCD1AB for ; Sun, 19 Oct 2025 17:07:49 +0000 (UTC) Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by mx.groups.io with SMTP id smtpd.web10.195.1760893661135131776 for ; Sun, 19 Oct 2025 10:07:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mvgCAisP; spf=pass (domain: gmail.com, ip: 209.85.218.48, mailfrom: skandigraun@gmail.com) Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-b3e9d633b78so876702566b.1 for ; Sun, 19 Oct 2025 10:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760893659; x=1761498459; 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=xnG4PhdZvzQB5rN4dfICF0h2ooGh3vYfTfk6YB6TJWw=; b=mvgCAisPqmcJO6uBQxFy3Rk126b1T/YuA8jKPuuGLZF2DXI80XUStzvCiSx+lCxzdX oOkl2jBG+UiGQ834PpHqdDe0FEI+xmSkS8xYM0o89g3rewQlwWYZknmuT3gXqZe9aVTO XJgOKs7Eyu3x9bYUXyqx+tzz7q2IugE7iihMIyMhndjv17oNfpvz9titIo/N7ohCay/B 0gjJWvEk1IlwwLxLud9izGDvldzx0RZn60tSyEh6g2E8rWTqlCBE7GKlyHNrFXFNHhSu YLo5Evrtx4uCAE3QCLs4uF7XjvNeCiBxLk0KEtECcMVk+Ya835/ahT5Q+eNm5ZTybYV9 nyJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760893659; x=1761498459; 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=xnG4PhdZvzQB5rN4dfICF0h2ooGh3vYfTfk6YB6TJWw=; b=u9D9m0OB6YWGibQFCe31UEtaKPHYhPIIlMuxp+Y21+785xuQyv+xIZPfssGh8uIqsW qEuA/Da0xHKVBcqlEIEEoBfXgclOhNh1c4XbzAcrL5M/89eEqX20eH5Dy5YLB0atgJNW up5Lee1pA/ZzZCne2h7FrH1cKOGE9IEGhAooyCKi8b1S0CdIel67XBgAI+8EFzBt+5Ly uWV4ce2OFr4T/onMVM+Q5mNmp+oJelEvC8uvqhhsC4LQjU+/LXoiQqcmLuxtOuDUZv8c VLfbPnPW9hFLlGrgVDMMNCtS2ygL4a+fCSzP4OWmWH3Xhfao37SleCtHGyk8cq1kJLBk 5FNQ== X-Gm-Message-State: AOJu0YzBpmhIsVHBnRtpdZPfzpP5Emkhq2FzLHU2N7zx1sEyTDUqy/dw ry+4TZBL9eXOmBjFKkhjsey6FTRD7cOMUdEJA4G0psSB9M3ClA3TMEa5DFFohw== X-Gm-Gg: ASbGncvXxfCxmE4H8zi1m4OQmMi6SpI1aKdRVwr/5MEpfGVZCK7Nxs6/ZlVTBmf488o YEL6nEc6apPoHKr4Q3qUf9msRqlkfHqIEQp/KT3Ae2uJyqfmW7qgQVgIEoQF05B8zZJKvryn1Hu qTB4jhHPufzC1l9EUi0MTXLl8uO3LPru3l5rihelsMBd9xmzpnO4B7ycpOX6TRjXeBsHemKET3H WSAi+r+6JPrg/9xWIkCw/5tYFF8td9vyYNBiqnAQacYvGeXUJ/5VaXmWi6vWWFWuGPwxCQFsFh7 AI1/+YB4km3IehG+xetPWccxccGdWJwlRwXugfSh8/IpaAxWgN3o4XRJ5A/Kbsy3QkWvc7BuoIv UIxYkeVwUEzs1oEN08cC9MYydCXjMEFtKHF10kNNVoXR6IY3JVAeqbMo4HLYH3mYJZeSJQxZpy+ CA560N7Tnh X-Google-Smtp-Source: AGHT+IH8FIIOCbCM7b9gjzCoZygyFoddbdg6W+PRisH0OziJ36lHrq9G0WOXD+TfYFISf16hAtr9CQ== X-Received: by 2002:a17:907:c786:b0:b4f:6d1c:6f4d with SMTP id a640c23a62f3a-b6051dc37f8mr1574692666b.5.1760893659476; Sun, 19 Oct 2025 10:07:39 -0700 (PDT) Received: from desktop ([51.154.145.205]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b65ebb499dasm556206766b.73.2025.10.19.10.07.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Oct 2025 10:07:39 -0700 (PDT) From: Gyorgy Sarvari To: openembedded-devel@lists.openembedded.org Subject: [meta-oe][scarthgap][PATCH v2 2/5] emacs: patch CVE-2024-30203 Date: Sun, 19 Oct 2025 19:07:34 +0200 Message-ID: <20251019170737.1311808-3-skandigraun@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251019170737.1311808-1-skandigraun@gmail.com> References: <20251019170737.1311808-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:07:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/120798 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 b1b795dace..c3f36007f8 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:07:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyorgy Sarvari X-Patchwork-Id: 72671 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 66F1BCCD1A5 for ; Sun, 19 Oct 2025 17:07:49 +0000 (UTC) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by mx.groups.io with SMTP id smtpd.web10.197.1760893661866324302 for ; Sun, 19 Oct 2025 10:07:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cihhSAe0; spf=pass (domain: gmail.com, ip: 209.85.218.50, mailfrom: skandigraun@gmail.com) Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-b3b3a6f4dd4so664589066b.0 for ; Sun, 19 Oct 2025 10:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760893660; x=1761498460; 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=LmsSRdKfnbmOTqjseB1cL2U6uCkgqxuSGnIQTwP5CDE=; b=cihhSAe014Vb5KIddeZBqG2KkW8KwzH4NS8T76cB24WbXgNln9QY6c1hb+LtzIjpeG RUdO/vYKAY4c1kQGLDccxbwGro02zRF1h1ZK9sNT/M3bl2zQ5X1tK2hmxxy5JP2CMQqA FcDo2RyO485fu3u/9+PZWHtwzjV6YNgCw12D4zJ+uM6B91XTVgKN5PMLIedIdisiMRIe 66Z5KBRcfuF23V+WynNlp0dN9vYyHvazHjcGlL4UXPO9gMo36N1P9k0bkTnzqDKi/b5i hScyf8W7qO1jq6lCx7pUkuk30Hw4xeiSstBewUqkdllIumASwFMYAzRxpPTKiBdJB0yR Pq4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760893660; x=1761498460; 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=LmsSRdKfnbmOTqjseB1cL2U6uCkgqxuSGnIQTwP5CDE=; b=YQqmZIW/IPongy8fMqEp6SQIuukZdH236Z9vMXBrMUqtY9BogWkMHIBo5JxkthEsFA pW1CvpRJH5avxXHDCgp8FDIKWsLQ88h2udko3XDzfkoZifrWMKbvM86BOyF2lYp16cq7 x9VQk52ufi4CDFCfGeFYl7SlfAzx8DetqwGY/sRtvkJnAFs9aa5HBCbI4pQvMcOmUYa5 plVzyFiDrB9kDKINn+cM72C5Ae7RXcHmAw8rAeSekcvgbJhjkSzMBQw06YQrnMj8+Ha9 nuvXXYUX/ZciPB32L33UtE4NUvOOkFN+3XJb5Wng3tP5z242e+fLCgEKiNtcFiaCUKfw 1iRQ== X-Gm-Message-State: AOJu0YwZAYMqytXu/trFbvPL+A3agK0R/uu+YcEAZhZSiLOoGaJKq5kA L7wtYtpUSW9jmRCnCfC8lZA5dKD0E5kzruC5hdlx80q5CZfrl/fLKuzyNqKU3w== X-Gm-Gg: ASbGncsYVvq9kQ+nlsIiCDlfSWoC2seXSDkUq6mHoJ1SragedyL81DKP5gMMYBn6dtE zCPmQ0oyj87rRv0KV/2JDzkPB93hov2Tt60rn8yWPh5Q6PvPhM7VwSQBN/MkDPyOGjr0I/63TSO D4aB4GDgUr2uD98hYeSUiuTo68inQZoUQj1VEDcYAvWYkNagURkophp4TZt/XEJ9DEW3XrYdamp je3MFFH1fH6D/MJaX7ec2aQQoRNELhkaVHkYfLd2JaI3lJYOR7PdcbKWUUKaWx0nCiOAOPNd4tc jig4MoEgj5bHQkMm9mDwjVEZ+LJYcuyzHqxjBhpdssZoY146Xf4SYi+TJ5hhUjgdw8dA3i6DSVv WnqpAKnpQd5hzQnMyC/tHlhnBZ7P7gCdqIm7POFz/JpBmdsRlSTBQZL2myrSVGfhB9H6MQ1n8xA == X-Google-Smtp-Source: AGHT+IEeZkzeE7gqtpBxKFP+4hCIx6a71BRqUM1mr+t57vTKHQNWGh1iZQnNb4VSsPgUa8p3Rrn1gw== X-Received: by 2002:a17:907:1c0a:b0:b40:52:19c2 with SMTP id a640c23a62f3a-b647463a240mr1275932466b.20.1760893660080; Sun, 19 Oct 2025 10:07:40 -0700 (PDT) Received: from desktop ([51.154.145.205]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b65ebb499dasm556206766b.73.2025.10.19.10.07.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Oct 2025 10:07:39 -0700 (PDT) From: Gyorgy Sarvari To: openembedded-devel@lists.openembedded.org Subject: [meta-oe][scarthgap][PATCH v2 3/5] emacs: patch CVE-2024-30204 Date: Sun, 19 Oct 2025 19:07:35 +0200 Message-ID: <20251019170737.1311808-4-skandigraun@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251019170737.1311808-1-skandigraun@gmail.com> References: <20251019170737.1311808-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:07:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/120799 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 c3f36007f8..0af77ef05d 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:07:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyorgy Sarvari X-Patchwork-Id: 72669 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 5B289CCD184 for ; Sun, 19 Oct 2025 17:07:49 +0000 (UTC) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by mx.groups.io with SMTP id smtpd.web11.190.1760893662456549370 for ; Sun, 19 Oct 2025 10:07:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=H1mE+JwV; spf=pass (domain: gmail.com, ip: 209.85.218.50, mailfrom: skandigraun@gmail.com) Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-b4aed12cea3so618253366b.1 for ; Sun, 19 Oct 2025 10:07:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760893661; x=1761498461; 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=MNWhniv2B+4QOIAgIjkLoSlMjj/5Y62IWbW83+gVBII=; b=H1mE+JwVjrsoYtehjgBgaxV7MMFcCil44NulBsgBIZS2yus/vRiRiV4wjXEV5prRwU +A7Vgn7ojCb/JJAaAB/Y7EWrRg0NvLSM/iw9ypJqYsOMRIzy6W4jddOPMIw28XXjFJdV t+s5qF/C2lu2xuttENcW/gWmcC3m8WpwqoizU1XUNH1EFPBfkfscWJOE/36y4KhFOyMV VCEC25MSmPwgBQmEni5eTazb1gzNHLX+ES8lFm+AQLjBuYuiaYqC+V4N/c6w6g7/aV/K HM4DRgbjjiA/5ALVpACDJJ2V8zwOWtfQQ9cjXeKnfsK8X/FEXlNfZNGkj9ih5h+nyHhw dS2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760893661; x=1761498461; 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=MNWhniv2B+4QOIAgIjkLoSlMjj/5Y62IWbW83+gVBII=; b=Hvolil2EPP6Bb2/xHVTwax5u9UOauBDfwQP4ze2NJPLwAnb9yZgVUMxpHdsSoR1ZQa wK9fpxJDJxYvsTiIpdVaSv0AVJs34AWKJemO2Hvk+1zej/LCN868ENjR4YoZNL0YchZz Y6yAEsZsLBADqgxitksrIO48FQssKXSf/K/Y2sR4MLymsFt9M3c1ugaZUcGt7oPPjsLp TWQYG4+Ai/Qfv1YI8GhuucRQXJ08IW881tMUGe4bMyy3KJlZgDUsUFkrlwEwGDEzTbnp A3lr5X87Wa8TwACg0K8a9QXVUxq+XWZnoLSEbNDcEPPBrCWONqxF0TjjhbFu1Ocn1amJ k14g== X-Gm-Message-State: AOJu0YxGBS56QGi/ZqCCz/pobjzqmMs/0PCRLZMYQU4Mi8ueEqBKWbC0 ue06Hk1mR5EuN0AlvccR071u4TVesXNbQpD6zHqi0T7tyQvGqDtMBWkWAsmUmw== X-Gm-Gg: ASbGncvWTTekmcYI6f1BmPLzzj8Et+SbRNCtAmWeRk/1gdr4lp/qg9pZre7TOlZNcyy 8A/vnfuPUpzlRgbhs1/4sZRMaSu59nLjSnFL1kCNVCQ1jXpcHlr2CKFu/wIJt+QXnxrClMH6gHo TpWvqQk8WNf7SY7+fKYsJ2guca/vDyOhmkxEodEBxN0WoT0njIwzoTkME0b+qA4RtwvKVE2vN1C 5QaqFwfdwZV4VgfU1jbHmCVL75SMcvXM8IDH01hnqeysQ/Ycpia1eRY8zp/+Fn1Gd32F/1J4fSC nz50GD2cX6cHwqxXqopl1mHO/mqTmq7EwvfTCJKZbqM28hE1+ZoYxp/XIWFVuVVxaZBWLuBFbjt 50poHI3Pj2196vxWMqu47zjSXQ80BNOICH8FuAcZzEkqFC0+iN0i+6vLG1OlTt6NlGwGgCNVLCA == X-Google-Smtp-Source: AGHT+IGabjR7B6LxqQVfDaOFu5tH2qcPej3J/EaAmLvxcqGYlFfq4DQjNgKdMAkhlf1RFlWcMaox0A== X-Received: by 2002:a17:906:f5a1:b0:b57:2d81:41f with SMTP id a640c23a62f3a-b6474b3602bmr1232003966b.40.1760893660688; Sun, 19 Oct 2025 10:07:40 -0700 (PDT) Received: from desktop ([51.154.145.205]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b65ebb499dasm556206766b.73.2025.10.19.10.07.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Oct 2025 10:07:40 -0700 (PDT) From: Gyorgy Sarvari To: openembedded-devel@lists.openembedded.org Subject: [meta-oe][scarthgap][PATCH v2 4/5] emacs: patch CVE-2024-30205 Date: Sun, 19 Oct 2025 19:07:36 +0200 Message-ID: <20251019170737.1311808-5-skandigraun@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251019170737.1311808-1-skandigraun@gmail.com> References: <20251019170737.1311808-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:07:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/120800 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 0af77ef05d..0a88b0282a 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:07:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyorgy Sarvari X-Patchwork-Id: 72672 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 5BE96CCD1A7 for ; Sun, 19 Oct 2025 17:07:49 +0000 (UTC) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by mx.groups.io with SMTP id smtpd.web11.191.1760893663145442235 for ; Sun, 19 Oct 2025 10:07:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jbUUiN4x; spf=pass (domain: gmail.com, ip: 209.85.218.50, mailfrom: skandigraun@gmail.com) Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-b64cdbb949cso535443766b.1 for ; Sun, 19 Oct 2025 10:07:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760893661; x=1761498461; 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=TFLFMsSWpeDkPquvW/ycWTWMvJZ+2BtY+RXjfy4VFnU=; b=jbUUiN4xCz1IevEzv0KJzLdnKNXaCL9LqVyAgGV5gCgOihCp2hsfx0qWBJxZJ8UWFQ LUSy1uoN5zt+SRU7qFfHw2ymWXvsSOQEvyVGiFvMLuAXaeAht07Jec1iqBN5zK/p/Us0 0rzyJFSV4uTNE7G9HygesVNZjMwL1SSOTE7UBRCIlc2RZRnVptaKgH5LGJb2GBfnwPwQ MQ4KpLDFTUeV3DzcbZuIF7Dau6cueW+6EVYmFoppNrlyDP2VKk41ZeS3YyMgTxfnoBdQ GwbtgZaXo8YQHNAujgCRq1bgeV+Ix7UYTNQQ4+FGqcGhyMnuUEbUwNrLTIG2TpLuLP+k Z3BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760893661; x=1761498461; 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=TFLFMsSWpeDkPquvW/ycWTWMvJZ+2BtY+RXjfy4VFnU=; b=cGhio2+ytOAtQJFlI0ZT4+yvozRnSVaxPFl4+ZGrQF4LgBQ6DcxxWtmSa6UalJBTs/ zBMaDQR8Ird8nVLOt+ZCw+eA7V2DfIzRXhhNs/Eo78eO5sBMhlYcWMZDqARE+ZcqQbue 4ufwqGZ9Fp2kfu8uvOi5SfjyOLTb3XGgMreEq4G+MGyDL91CKt2HF9mcxq6IwWt68MZE Qv7ZQQz5OB/74+jwLdS/gmHPPGEE/pNUw0e1li3YlkQt0aQieBdCbn8hoWcMJhPDTowg Dz1maG7gMTq/T0n/8AC8kVG/xjOiyy0vVZ85bp+RpdX8Mhz/RIFAJXuyFeo+CBVQ0G56 Kz8A== X-Gm-Message-State: AOJu0YyFXgZMSiMxke6mnnTWsmhmIn4jNah8hkon8YhMRzoDSJIGQw4h L84hXpKcyi7DN5Df3hu3nyLtC1O4YNxZuiXGFoMHN74Gl0ZPrJHmhQfquWgJWg== X-Gm-Gg: ASbGnctuxRM2Y4EiOdAm93H1+9jIDnaoWP/m7QFlgXvaxoiQZsG3mDTV3qDLGw8Vo8N OjtJqxCGASyF3v8JeoNkBNMhznqirxScTgM/m7p2EaBXUMysvbI1JFeDd3spwNuaVQiFgRtBMLe zp4ZZht77flfZ96Ks6QReaRwKI9H33Ku3IHNAgg6YgiD8/os9S/KxN6d+yJl10iY6OjPFZ485Xt 8JK8SkFOTK5Xoyy9f3tNvYxpuBTJlsr/xa8gdhNhxAU0lQjCHVJ0onZ6yKdVEGl63A+FvmlLKlL 8WZtYj1vibdv6g0iJ4Ustt8rCOpxJCbG5PgPbEY0zDVE56UdV+or9a35sRjiTeYB+vUVviYebik 0OWnI6Z7xXKI18d6S/8BgpCOqFUnT3op4HNSwma0VKzAmIyZpWwUebtYq1e6CvMXCIniTUNWb8g == X-Google-Smtp-Source: AGHT+IGjl3SOUdtGmih+6/cUtDra4+4xyPgVwn6bV2sT8KPzchq6SkJv7F/m7jheKJLtjYKCvfJbKw== X-Received: by 2002:a17:906:794e:b0:ad5:d597:561e with SMTP id a640c23a62f3a-b6475708a50mr1248626166b.56.1760893661349; Sun, 19 Oct 2025 10:07:41 -0700 (PDT) Received: from desktop ([51.154.145.205]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b65ebb499dasm556206766b.73.2025.10.19.10.07.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Oct 2025 10:07:41 -0700 (PDT) From: Gyorgy Sarvari To: openembedded-devel@lists.openembedded.org Subject: [meta-oe][scarthgap][PATCH v2 5/5] emacs: patch CVE-2024-39331 Date: Sun, 19 Oct 2025 19:07:37 +0200 Message-ID: <20251019170737.1311808-6-skandigraun@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251019170737.1311808-1-skandigraun@gmail.com> References: <20251019170737.1311808-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:07:49 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/120801 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 0a88b0282a..438029f83b 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.