From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?iso-8859-1?Q?Jo=E3o_T=E1vora?= Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] scratch/allow-custom-load-paths-in-elisp-flymake 4ef9711: Allow custom load paths in elisp's byte-compilation Flymake Date: Wed, 05 Dec 2018 15:14:04 +0000 Message-ID: References: <20181204233600.7907.75252@vcs0.savannah.gnu.org> <20181204233601.273DD209DC@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1544022797 20315 195.159.176.226 (5 Dec 2018 15:13:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 5 Dec 2018 15:13:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 05 16:13:13 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 1gUYrQ-0005CR-RP for ged-emacs-devel@m.gmane.org; Wed, 05 Dec 2018 16:13:13 +0100 Original-Received: from localhost ([::1]:35032 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUYtV-0002i7-HV for ged-emacs-devel@m.gmane.org; Wed, 05 Dec 2018 10:15:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUYsd-0002hk-4Q for emacs-devel@gnu.org; Wed, 05 Dec 2018 10:14:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUYsP-0006w9-Qr for emacs-devel@gnu.org; Wed, 05 Dec 2018 10:14:18 -0500 Original-Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:56136) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gUYsM-0006uZ-5N for emacs-devel@gnu.org; Wed, 05 Dec 2018 10:14:11 -0500 Original-Received: by mail-wm1-x329.google.com with SMTP id y139so13578708wmc.5 for ; Wed, 05 Dec 2018 07:14:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=K+iRmS2wE3i+aqrUPySBJfd39jwqC/QrgktLTD8gFk0=; b=XWAHtWGlKPsFiQ3cvdlqyEftQXLqo1cwejfrk0hWFTbPWD1sbWTXkyjx7O7hCjWDlm VbUyC0sfSMguRb7lPgbymnVkDujFxlxaTcCWuvMehtV6RXF6zRJ1muHjgwlt4Z4x8XLt zskDxNiQ4mNLkVpmz2y1ULGGvwbswmrmlUcYp9BZ5QTDumQ2G7Ye2DkXRDFfXtscyt5H Gk50qtX235wxlFYcQCsrMlj50gFz6pDAU7Twc7LrY2pPtIihc/aBydP7rmyMtsJgdnYo 8UD96VjinPgLJeF5r4gZqIi9DlKH2b37ou6OsEQmWTTFkWkHzIuwFmFZOVremOpOGavF KJ+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=K+iRmS2wE3i+aqrUPySBJfd39jwqC/QrgktLTD8gFk0=; b=pnOduFt0HXPLKBE5DLSS6MQz7KJ1v0jPFcmGg3s190VozdvzuOxweRd4hBUCzJRLLF +VcWfJN43Q2E8AiP8OK2Yj7JnFOMYupASRnajdZHfrtXkLBhozFMcVq6O9hxwOsqXaAM kDFhHsvv7sCwinc38UCReSxfjFKz1TYneSK9JMAt5C0/PZuX8NjDlKdzctVosXsoaFvQ pYxKx5cXuwuzWCixgGWvH2o954eZW9VtElBHREFA2okD/q9FNGoiBqUSXZNI5VmQu2rz F1koz5vfhn2GOV/LVHZjxHJyIOsf6+MUgYhE2Wn+SJwg0B3UQR9C+5nvzIXOEzg2jc23 /05g== X-Gm-Message-State: AA+aEWYTIVQdzkknOHjFlsuLPAytUYA1w3Zjoo2+eY2jZKQlIqDeRoI3 +cuiHpI8oHtpUMkKmHp/AXqHX2tr X-Google-Smtp-Source: AFSGD/VUcMJ/jQRkotmUClqVujAzDUvZgCt/ykVBxVIrsX7KJn0oo5lRoQqRHu+BvDxIZ55toTakmw== X-Received: by 2002:a1c:d988:: with SMTP id q130mr17129721wmg.41.1544022848196; Wed, 05 Dec 2018 07:14:08 -0800 (PST) Original-Received: from GONDOMAR.yourcompany.com (mail3.siscog.pt. [195.23.29.18]) by smtp.gmail.com with ESMTPSA id e142sm33593792wmf.46.2018.12.05.07.14.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Dec 2018 07:14:07 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Tue, 04 Dec 2018 23:34:48 -0500") X-Antivirus: AVG (VPS 181205-0, 05-12-2018), Outbound message X-Antivirus-Status: Clean X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::329 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:231627 Archived-At: Stefan Monnier writes: >> +(put 'elisp-flymake-byte-compile-load-path 'safe-local-variable >> + (lambda (x) (and (listp x) (catch 'tag >> + (dolist (path x t) (unless (stringp p= ath) >> + (throw 'tag nil)= )))))) > > Just reminded me: we have a serious problem w.r.t security of > flymake-mode in Elisp buffers: if someone enables flymake-mode for all > elisp-mode buffers (i.e. what I'd like to do by default), the mere act > of visiting an Elisp file means that file will be passed to byte-compile > which will happily execute some of the code within, running arbitrarily > dangerous code. True. And that's why we don't enable flymake-mode automatically, and possibly never will (unless we come up with a solution). The fact that it is so inherently dangerous is the reason that I considered adding a safety spec to elisp-flymake-byte-compile-load-path at all, because having flymake-mode in elisp is already quite dangerous it itself. But it does make it slightly *more* dangerous, because you can visit a file that would otherwise be safe, but be betrayed by a .dir-locals.el that spoofs the load-path to run some attacker's code. Not sure if this is a reasonable scenario. So should I push this to master with or without the safety spec? Jo=E3o