From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: Unprivileged /gnu/store with PRoot Date: Thu, 08 Jun 2017 17:29:05 +0200 Message-ID: <87tw3qebwe.fsf@elephly.net> References: <87d1beoyvi.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIzN9-0006T8-IV for guix-devel@gnu.org; Thu, 08 Jun 2017 11:29:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIzN5-0000QL-HZ for guix-devel@gnu.org; Thu, 08 Jun 2017 11:29:19 -0400 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21132) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dIzN5-0000Pd-Ai for guix-devel@gnu.org; Thu, 08 Jun 2017 11:29:15 -0400 In-reply-to: <87d1beoyvi.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel Ludovic Courtès writes: > One way to work around the problem is to use PRoot, a ptrace(2)-based > tool to virtualize the file system². With the ‘proot-static’ package I > just pushed, one can run, say, hwloc, on such a hostile machine by > sending locally-created packs as well as ‘proot’: > > scp $(guix build proot-static)/bin/proot hostile: > scp $(guix pack hwloc -S /bin=bin) hostile:hwloc.tgz > > and then on the hostile machine: > > mkdir ~/.local > cd ~/.local > tar xf ~/hwloc.tgz > cd > ./proot -b .local:/ /bin/lstopo > > where “proot -b .local:/” essentially “bind-mounts” ~/.local to /. > > Pretty cool no? :-) That *is* very cool indeed! > PRoot adds overhead since it has to intercept every syscall. However, > for a mostly computational process, it should not be much of a problem. Can this be simplified? We really only need that user-space bind-mount feature, nothing else. PRoot does more than that IIUC. Can we preload a little library that provides “open” and implementations of other file access procedures, and simply (I know…) changes any access of “/gnu” with the new target directory? I suspect this is doomed to fail because of the way shebangs work and because we cannot interpose internal glibc calls, though. Ultimately, ptrace really is what we want on Linux and sadly it’s just slow. More power to the Hurd on HPC! -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC https://elephly.net