From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Avoiding arbitrary code execution with macroexpansion Date: Sun, 19 Aug 2018 23:04:26 -0400 Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: blaine.gmane.org Content-Type: text/plain; charset=Utf-8 X-Trace: blaine.gmane.org 1534734842 22263 195.159.176.226 (20 Aug 2018 03:14:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 20 Aug 2018 03:14:02 +0000 (UTC) Cc: emacs-devel@gnu.org To: Wilfred Hughes Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 20 05:13:58 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fradi-0005eZ-DM for ged-emacs-devel@m.gmane.org; Mon, 20 Aug 2018 05:13:58 +0200 Original-Received: from localhost ([::1]:44842 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frafo-0006jo-CW for ged-emacs-devel@m.gmane.org; Sun, 19 Aug 2018 23:16:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frafW-0006iz-1y for emacs-devel@gnu.org; Sun, 19 Aug 2018 23:15:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fraUW-0008NV-RB for emacs-devel@gnu.org; Sun, 19 Aug 2018 23:04:29 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51444) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fraUU-0008LP-JT; Sun, 19 Aug 2018 23:04:26 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1fraUU-0007Rx-DX; Sun, 19 Aug 2018 23:04:26 -0400 In-Reply-To: (message from Wilfred Hughes on Wed, 15 Aug 2018 22:52:04 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:228706 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > Using a macro that calls eval, such as eval-when-compile, > eval-and-compile, c-lang-defconst-eval-immediately (undoubtedly others > too), means anything can happen at macroexpansion time. Can we make macroexpand detect these cases and give an error? It would have to do a codewalk on the macro definition, but that is doable. Perhaps doing an flet of eval and apply would work. -- Dr Richard Stallman President, Free Software Foundation (https://gnu.org, https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)