From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#45198: 28.0.50; Sandbox mode Date: Thu, 17 Dec 2020 18:55:52 +0100 Message-ID: <26556EDE-9133-450F-9181-2859E058677C@acm.org> References: <0917E396-F78C-45BF-8A1F-5C23CA722D9A@acm.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8572"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Bastien , 45198@debbugs.gnu.org, Stefan Monnier , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 17 18:58:27 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kpxXm-00026s-6h for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Dec 2020 18:58:26 +0100 Original-Received: from localhost ([::1]:45550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpxXk-00034M-LU for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Dec 2020 12:58:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpxVS-0001lp-9J for bug-gnu-emacs@gnu.org; Thu, 17 Dec 2020 12:56:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53648) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kpxVS-0004FD-0k for bug-gnu-emacs@gnu.org; Thu, 17 Dec 2020 12:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kpxVR-00014K-UD for bug-gnu-emacs@gnu.org; Thu, 17 Dec 2020 12:56:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Dec 2020 17:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45198 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 45198-submit@debbugs.gnu.org id=B45198.16082277614101 (code B ref 45198); Thu, 17 Dec 2020 17:56:01 +0000 Original-Received: (at 45198) by debbugs.gnu.org; 17 Dec 2020 17:56:01 +0000 Original-Received: from localhost ([127.0.0.1]:36961 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kpxVQ-000144-Mw for submit@debbugs.gnu.org; Thu, 17 Dec 2020 12:56:00 -0500 Original-Received: from mail70c50.megamailservers.eu ([91.136.10.80]:37548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kpxVO-00013u-5f for 45198@debbugs.gnu.org; Thu, 17 Dec 2020 12:56:00 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1608227756; bh=JVq79grn5sYaO8lzjeT2KAae2tU5HjJtriItnpFETig=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=FxShkDelGQ0Ez98qJNW37bVQcxQw7GUDkUTpBu16Ksf0/Zi478Nx3FSG2vD2k5//Z LRGprBZNsS4S4SNom6wZGyoE2S52RENHZY7KGS7Tg02/RdV6gvxSj5QSJg5DAStxDO qwRaA6iA8Lk7CY+4rLNR6aHAX6+PJqi/MsKXhOYY= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] (c188-150-171-71.bredband.comhem.se [188.150.171.71]) (authenticated bits=0) by mail70c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 0BHHtqOu001687; Thu, 17 Dec 2020 17:55:54 +0000 In-Reply-To: X-Mailer: Apple Mail (2.3445.104.17) X-CTCH-RefID: str=0001.0A782F27.5FDB9BAC.000F, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=UIOj4xXy c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=pGLkceISAAAA:8 a=DTTHb2eM3JguN3yHLMoA:9 a=CjuIK1q_8ugA:10 X-Origin-Country: SE X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:196271 Archived-At: 17 dec. 2020 kl. 14.08 skrev Philipp Stephani : > Dynamic libraries tend to start threads for background work, so while > there aren't that many, they still exist. Well, there's no accounting for taste. Still, I'm not ready to close the = door to possible solutions until they really do appear to lead no way. = (It's not an urgent concern since we will need a traditional fork-exec = solution first of all.) > I haven't tried this out yet, but allowing reads from load-path > entries plus the installation directory should be fine. Assuming this is sufficient; I think autoloaded definitions can specify = files in arbitrary directories, not necessarily in the load-path. > Yes, but see my other comment: restricting an open policy after the > fact is much harder than opening up an initially-restrictive one, so > I'd really start with a restrictive one (no file reading allowed > except for allowed directories and files). Depends on the platform I suppose -- macOS and BSD should work either = way. On Linux it depends on the method used; I admit not having looked = closely at seccomp lately. > The gains are largely realized using threads these days. Indeed, although forking still has a few niche uses. (For there record = I'm a firm believer that the fork-exec model was a mistake from its = inception, but now that it's there...) Emacs would be better served with threads, too, if it weren't that (I) = we don't have a good threading story yet and (II) Elisp code can cause = way too much damage at compile time. Fixing either would bring many = other benefits! > I'd think that we'd always run the sandboxed Emacs with --quick > --batch and an empty environment (to provide for some reproducibility > and avoid LD_PRELOAD attacks etc.), and then startup tends to be fast > enough (emacs -Q -batch takes ~50 ms on my system). That's not quite fair; the byte-compiler needs the right load-path and = autoload definitions, and the byte-compiler itself needs to be loaded as = well. (Anyone who can set LD_PRELOAD already has the machine.) The easiest way is to run the user's init file. Perhaps it's possible to = just transmit a list of paths and packages to the subprocess as = arguments but the user may have things loaded or defined outside the = standard package manager.